Skip to content

[compiler-threat-spec] spec: add CTR-022 (git argument injection) and CTR-023 (bash allowlist illusion) - #49895

Merged
pelikhan merged 1 commit into
mainfrom
spdd/ctr-022-023-2026-08-03-c211eade82ec248b
Aug 3, 2026
Merged

[compiler-threat-spec] spec: add CTR-022 (git argument injection) and CTR-023 (bash allowlist illusion)#49895
pelikhan merged 1 commit into
mainfrom
spdd/ctr-022-023-2026-08-03-c211eade82ec248b

Conversation

@github-actions

@github-actions github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Overview

Adds two new threat-detection rules to specs/compiler-threat-detection-spec.md, bumping the spec version from 1.0.19 to 1.0.20. This is a documentation-only change (1 file, specs/compiler-threat-detection-spec.md) that formalizes detection behavior already implemented in the codebase — no .lock.yml schema changes.

What changed

  • CTR-022 — Git Subprocess Argument Injection (CWE-88): Documents the requirement to reject ref/path values (from remote import specs or download configuration) that begin with -, contain NUL bytes, contain .. traversal segments, or (for paths) are absolute, before they are passed as positional arguments to a git subprocess (git archive --remote, git ls-remote, git show). Implementation already exists in pkg/gitutil/gitutil.go (ValidateGitRef, ValidateGitPath), invoked from pkg/cli/download_workflow.go, pkg/parser/remote_resolve_sha.go, pkg/parser/remote_workflow_spec.go, pkg/parser/remote_download_file.go, and pkg/parser/import_remote.go.
  • CTR-023 — Bash Command Allowlist Illusion: Documents rejection of workflows that declare an explicit tools.bash restriction (bash: false, bash: [], or a non-wildcard command list) for an engine whose EngineCapabilities.BashCommandAllowlist is false (e.g. codex), since such engines silently ignore the restriction at runtime — creating a false sense of security. Implementation already exists in pkg/workflow/agent_validation.go (validateBashCommandAllowlistSupport, hasBashExplicitRestriction) and pkg/workflow/agentic_engine.go (EngineCapabilities.BashCommandAllowlist).
  • Added test ID entries T-CTR-022 and T-CTR-023 (Section 8.1), extended the rule-to-implementation mapping table (Section 7.1), updated the version compatibility table (Section 2) to map spec 1.0.20 to minimum binary v0.83.6, and appended a 1.0.20 Change Log entry (Section 10).
  • Change log also records an audit of commits since the 1.0.19 review (2026-07-31 → 2026-08-03), concluding no additional new threat classes beyond CTR-022/CTR-023 were identified.

Why

Both behaviors were already implemented in the compiler (CTR-022 fixed upstream in commit 85d757b6 as CWE-88 remediation; CTR-023 implemented in commit 34035eee5) but were not yet reflected in the threat-detection specification. This PR closes that documentation gap so the spec accurately tracks enforced compile-time security boundaries.

Verification

  • Spec-only change; existing Go tests already cover the underlying behavior: pkg/gitutil/gitutil_test.go (TestValidateGitRef, TestValidateGitPath), pkg/cli/download_workflow_test.go, and pkg/workflow/bash_command_allowlist_validation_test.go (TestValidateBashCommandAllowlistSupport, TestEngineBashCommandAllowlistCapability).
  • No breaking changes; no .lock.yml schema impact.

Generated by PR Description Updater for #49895 · auto · 51.8 AIC · ⌖ 5.66 AIC · ⊞ 6.9K ·

…sh allowlist illusion)

- CTR-022: documents already-implemented ValidateGitRef/ValidateGitPath
  guards (pkg/gitutil/gitutil.go) that reject unsafe ref/path values
  before they reach git subprocess calls, fixed for the git archive
  fallback path (CWE-88, commit 85d757b) and confirmed present at all
  other git subprocess call sites.
- CTR-023: documents already-implemented
  validateBashCommandAllowlistSupport (pkg/workflow/agent_validation.go)
  that rejects explicit tools.bash restrictions for engines lacking
  BashCommandAllowlist capability, preventing a silently-ignored bash
  restriction illusion (commit 34035ee).
- Bumped spec version to 1.0.20, updated Section 2 sync table, Section
  5.1 rule catalog, Section 7.1 mapping table, Section 8.1 test ID
  catalog, and Section 10 change log.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan merged commit 379e063 into main Aug 3, 2026
@pelikhan
pelikhan deleted the spdd/ctr-022-023-2026-08-03-c211eade82ec248b branch August 3, 2026 04:31
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

🎉 This pull request is included in a new release.

Release: v0.84.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant