chore: update DocGuard extension to v0.23.0
DocGuard Community Extension Update
Updates the DocGuard community extension catalog entry.
Changes
- Version: v0.21.1
- Download:
spec-kit-docguard-v0.21.1.zip - Repository: https://github.com/raccioly/docguard
Release Notes
Security patch — closes issue #190. Command injection vulnerability in
docguard init via the ai field of .specify/init-options.json is fixed.
Security
-
Issue #190: command injection in
cli/commands/init.mjsandcli/ensure-skills.mjs. ThedetectAIAgent()helper returned theaifield from.specify/init-options.jsonwithout validation, and that value was then shell-interpolated into anexecSyncinvocation:const aiFlag = `--ai ${detectedAgent}`; execSync(`specify init ... ${aiFlag} ...`);A local attacker with file-system write access to a victim's repo could plant
{"ai": "claude; touch /tmp/pwned;"}and trigger arbitrary command execution on the victim's nextdocguard init.Severity: Medium (requires local file-system access; pre-fix
detectAIAgentconsumed configs from any project DocGuard ran in).Discovered: 23 duplicate auto-generated draft PRs from the "Sentinel" AI agent flagged this during the v0.19 cleanup sweep. The drafts were closed as noise but the underlying finding was tracked in #190 — fixed properly here.
Fix (two layers, defense in depth):
getDetectedAgent()now allowlist-validates theaifield against/^[a-zA-Z0-9_-]{1,32}$/. Anything else (shell metacharacters, non-strings, oversized values) returnsnull.- New
safeSpawnSpecify(args, opts)helper usesexecFileSyncwith args passed as an array — no shell interpolation possible. Both unsafe call sites (init.mjsandensure-skills.mjs) now use this helper. Cross-platform (POSIX direct exec / Windowscmd.exe /c specify.cmd).
Tests
- 596 → 610 (+14):
tests/security-init-injection.test.mjspins both defense layers. Tests every shell metacharacter (;, backtick,$(),|,&&, newline), oversized values, non-string types, malformed JSON, missing config files. Asserts the legitimate allowlist (claude, cursor-agent, gemini, agy, copilot, windsurf, codex, roo, amp, kiro-cli, tabnine, underscore-bearing future names).
Audit
grep -rn execSync cli/ was re-run; remaining call sites are all
hardcoded literals (no attacker-influenced interpolation): freshness
git probes, score's git probe, setup/doc-quality which-style
detection. Documented in commit message.
This PR was automatically generated by the DocGuard release pipeline.
Please address Copilot feedback and resolve conflicts. After merging this PR I would recommend any new/updated extensions submission to go through the extension submission issue template so you do not have to deal with so much back and forth.
Addressed the review feedback:
- ✅ Conflicts resolved — rebased onto current
main. The diff is now just thedocguardentry, the catalog/entryupdated_attimestamps, and the matchingdocs/community/extensions.mdrow. - ✅ Version reconciled to v0.25.0 — title, description, catalog version, and download URL all match now (the v0.21.1 / v0.23.0 mismatch Copilot flagged is gone). The v0.25.0 release asset is published and verified.
- ✅ Docs table synced with the catalog description.
Understood on the Extension Submission issue template — I'll route future DocGuard updates through it. Thanks @mnriem!
Thank you!