Description
destructive_command_guard (dcg) is a command-line safety tool that blocks destructive shell commands before AI coding agents run them. Prior to 0.6.6, nested or unclosed substitutions are recursively rescanned after an inner scan returns unterminated, producing exponential-time work. The affected scanners are reached through split_command_segments in src/packs/mod.rs. a destructive command followed by nested or unclosed $( or $(( sequences. nested or unclosed $( and $(( sequences cause repeated rescanning of the remaining command suffix. a hung PreToolUse hook fails open, allowing the destructive command to proceed. This issue is fixed in version 0.6.6.
Published: 2026-10-16
Score: 7.1 High
EPSS: n/a
KEV: No
Impact: Destructive Command Execution
Action: Immediate Patch
AI Analysis

Impact

The flaw in destructive_command_guard arises when a maliciously crafted command string contains nested or unclosed command‑substitution sequences such as $( or $((. The scanner repeatedly rescans the remainder of the command after each unterminated substitution, creating exponential‑time work. This can cause the PreToolUse hook to hang and, because the hook times out in a fail‑open manner, the protective guard is bypassed and the destructive command is allowed to run. The bug manifests only in versions prior to 0.6.6 and was addressed by patching the scanning logic in v0.6.6.

Affected Systems

The vulnerability affects the destructive_command_guard utility published by Dicklesworthstone, specifically any installation built from source or packaged that uses the scanning component in src/packs/mod.rs. All releases before version 0.6.6 are affected; later versions contain the fix. Users who employ this tool to safeguard AI coding agent executions are at risk.

Risk and Exploitability

The CVSS score of 7.1 indicates that the flaw can be exploited with moderate effort and carries significant impact. Because the Exploit Prediction Scoring System score is not available, we cannot precisely gauge real‑world exploitation probability, but the absence of a KEV listing and lack of external exploitation reports suggests the exploit is not currently actively deployed. The vulnerability is local to any environment where destructive_command_guard runs, so an attacker who can influence the command string, such as a compromised AI agent or a malicious user with write access, could trigger the denial‑of‑service and bypass. Users should assume that the failure‑open behavior can lead to arbitrary destructive command execution.

Generated by OpenCVE AI on October 16, 2026 at 18:24 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade destructive_command_guard to version 0.6.6 or later, which contains a patch that stops exponential scanning and eliminates the ditching of the PreToolUse hook.
  • If an upgrade cannot be performed immediately, configure the tool or your execution environment to enforce stricter time limits on the PreToolUse hook or isolate the agent so it cannot inject nested $( or $(( into command strings.
  • Review and restrict the commands permissible in the AI agent’s output, removing any that contain unclosed or nested command‑substitution syntax, to avoid triggering the recursive scan.

Generated by OpenCVE AI on October 16, 2026 at 18:24 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Fri, 16 Oct 2026 16:30:00 +0000

Type Values Removed Values Added
Description destructive_command_guard (dcg) is a command-line safety tool that blocks destructive shell commands before AI coding agents run them. Prior to 0.6.6, nested or unclosed substitutions are recursively rescanned after an inner scan returns unterminated, producing exponential-time work. The affected scanners are reached through split_command_segments in src/packs/mod.rs. a destructive command followed by nested or unclosed $( or $(( sequences. nested or unclosed $( and $(( sequences cause repeated rescanning of the remaining command suffix. a hung PreToolUse hook fails open, allowing the destructive command to proceed. This issue is fixed in version 0.6.6.
Title dcg: Exponential-time command-substitution preprocessing lets a crafted command hang dcg and bypass the guard via hook-timeout fail-open
Weaknesses CWE-400
CWE-407
CWE-693
References
Metrics cvssV3_1

{'score': 7.1, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-16T16:10:57.120Z

Reserved: 2026-08-20T20:07:49.963Z

Link: CVE-2026-77474

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-10-16T17:17:50.390

Modified: 2026-10-16T17:17:50.390

Link: CVE-2026-77474

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-16T18:30:14Z

Weaknesses
  • CWE-400

    Uncontrolled Resource Consumption

  • CWE-407

    Inefficient Algorithmic Complexity

  • CWE-693

    Protection Mechanism Failure