---
id: CVE-2026-77474
title: >-
  dcg: Exponential-time command-substitution preprocessing lets a crafted
  command hang dcg and bypass the guard via hook-timeout fail-open
summary: >-
  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…
severity: high
cvss: 7.1
cvssVector: 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H'
cvssSource: cna
cwe:
  - CWE-400
  - CWE-407
  - CWE-693
vendor: Dicklesworthstone
product: destructive_command_guard
affected:
  - destructive_command_guard < 0.6.6
published: '2026-10-16'
updated: '2026-10-16'
sourceUpdated: '2026-10-16T16:10:57.120Z'
source: CVEORG
sourceUrl: 'https://www.cve.org/CVERecord?id=CVE-2026-77474'
references:
  - url: >-
      https://github.com/Dicklesworthstone/destructive_command_guard/security/advisories/GHSA-4cfr-w3v5-w5j5
    label: >-
      https://github.com/Dicklesworthstone/destructive_command_guard/security/advisories/GHSA-4cfr-w3v5-w5j5
  - url: 'https://github.com/Dicklesworthstone/destructive_command_guard/issues/189'
    label: 'https://github.com/Dicklesworthstone/destructive_command_guard/issues/189'
  - url: >-
      https://github.com/Dicklesworthstone/destructive_command_guard/commit/ba16bdd074b045329dc0ca6ec9a08c44403cfe1b
    label: >-
      https://github.com/Dicklesworthstone/destructive_command_guard/commit/ba16bdd074b045329dc0ca6ec9a08c44403cfe1b
  - url: >-
      https://github.com/Dicklesworthstone/destructive_command_guard/releases/tag/v0.6.6
    label: >-
      https://github.com/Dicklesworthstone/destructive_command_guard/releases/tag/v0.6.6
tags:
  - cve.org
ingestedAt: '2026-10-16T17:24:46.885Z'
---

## Overview

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.

## Affected

- `destructive_command_guard < 0.6.6`

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
