[compiler-threat-spec] spec: add CTR-022 (git argument injection) and CTR-023 (bash allowlist illusion) - #49895
Merged
Conversation
…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>
Contributor
Author
|
🎉 This pull request is included in a new release. Release: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Adds two new threat-detection rules to
specs/compiler-threat-detection-spec.md, bumping the spec version from1.0.19to1.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.ymlschema changes.What changed
ref/pathvalues (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 agitsubprocess (git archive --remote,git ls-remote,git show). Implementation already exists inpkg/gitutil/gitutil.go(ValidateGitRef,ValidateGitPath), invoked frompkg/cli/download_workflow.go,pkg/parser/remote_resolve_sha.go,pkg/parser/remote_workflow_spec.go,pkg/parser/remote_download_file.go, andpkg/parser/import_remote.go.tools.bashrestriction (bash: false,bash: [], or a non-wildcard command list) for an engine whoseEngineCapabilities.BashCommandAllowlistisfalse(e.g.codex), since such engines silently ignore the restriction at runtime — creating a false sense of security. Implementation already exists inpkg/workflow/agent_validation.go(validateBashCommandAllowlistSupport,hasBashExplicitRestriction) andpkg/workflow/agentic_engine.go(EngineCapabilities.BashCommandAllowlist).T-CTR-022andT-CTR-023(Section 8.1), extended the rule-to-implementation mapping table (Section 7.1), updated the version compatibility table (Section 2) to map spec1.0.20to minimum binaryv0.83.6, and appended a1.0.20Change Log entry (Section 10).Why
Both behaviors were already implemented in the compiler (CTR-022 fixed upstream in commit
85d757b6as CWE-88 remediation; CTR-023 implemented in commit34035eee5) 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
pkg/gitutil/gitutil_test.go(TestValidateGitRef,TestValidateGitPath),pkg/cli/download_workflow_test.go, andpkg/workflow/bash_command_allowlist_validation_test.go(TestValidateBashCommandAllowlistSupport,TestEngineBashCommandAllowlistCapability)..lock.ymlschema impact.