Skip to content

Widen bypass closures: destructuring, alias imports, PR head clone_url and merge ref#22

Merged
Conalh merged 2 commits into
mainfrom
widen-bypass-closures
May 22, 2026
Merged

Widen bypass closures: destructuring, alias imports, PR head clone_url and merge ref#22
Conalh merged 2 commits into
mainfrom
widen-bypass-closures

Conversation

@Conalh
Copy link
Copy Markdown
Owner

@Conalh Conalh commented May 22, 2026

Summary

Re-opening the #21 work after the stacked merge of #19 and #20 closed it automatically. Same scope, now based directly on main (rebased clean). No source-level changes vs. the original PR.

Extends the bypass closures from #20 with the next wave of evasions:

  • JS destructuringconst { API_TOKEN } = process.env and the renamed form const { API_TOKEN: t } = process.env now track the secret variable (or alias).
  • Python aliased env importsfrom os import getenv as g / environ as e build a per-file alias map, then the secret-variable regex is generated from the alias union. Closes token = g("API_TOKEN") bypass.
  • Workflow PR-head extensionshead.repo.clone_url and refs/pull/<n>/merge now flag under pull_request_target.
  • test/fixtures/bypasses/ corpus — bypass fixtures are first-class, one per closure plus a CLI integration test.
  • README "Detection limits" — honest disclosure of same-line URL gating, no cross-file taint, no Python dep manifests yet.
  • agent-gov-core 0.5.0 → 0.7.0 — pre-positioned by a09c714; bundle rebuilt against the new library.

Deferred (tracked as follow-up issues)

agent-gov-core 0.7.0 added several integration surfaces that aren't wired up here. Four follow-up issues filed to track those separately.

Test plan

  • npm test — 89 passing (79 from main + 10 new for this PR)
  • npm run build — clean tsc + ncc bundle (73kB on agent-gov-core 0.7.0)
  • Reviewer: skim test/fixtures/bypasses/README.md — comfortable with the convention?

🤖 Generated with Claude Code

Conalh and others added 2 commits May 22, 2026 16:57
v0.7.0 adds report envelope, mergeFindings, OTel
gen_ai.conversation.id interop, matchSecret, applyExceptions.
Lockfile only on this branch — leaving the action-bundle rebuild
for when the widen-bypass-closures feature work lands.
…l and merge ref

Extends #20's bypass closures with the next wave of evasions surfaced
by external inspection.

- JS destructuring (`const { API_TOKEN } = process.env`) and renamed
  destructuring (`const { API_TOKEN: t } = process.env`) now track the
  secret variable. addSecretVariable handles both direct and
  destructured forms.
- Python aliased env imports: `from os import getenv as g` /
  `environ as e` (and the unaliased `from os import getenv` form
  already supported in #20) build a per-file alias map, then the
  secret-variable regex is generated dynamically from the alias union.
  Closes `token = g("API_TOKEN")` bypass.
- Workflow referencesPullRequestHead now covers
  github.event.pull_request.head.repo.clone_url and standalone
  refs/pull/<n>/merge references — the two custom-shell patterns
  agents use when actions/checkout would attract review attention.
- README: new "Detection limits" section documenting same-line URL
  requirement, no cross-file taint, no Python dep manifests yet, with
  a pointer to test/fixtures/bypasses/.
- test/fixtures/bypasses/ established as the bypass-corpus pattern,
  with one fixture per closure and a CLI integration test per fixture.

Adds 10 tests (80 total on this branch).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@Conalh Conalh merged commit 9723be9 into main May 22, 2026
4 checks passed
@Conalh Conalh deleted the widen-bypass-closures branch May 22, 2026 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant