litellm/tests/claude_code/_pr_gate_unit_tests
mateo-berri 16f2eba313
fix(ci): veria — shell-quote PR-gate resolver output written to $BASH_ENV
The version-resolver step echoes the resolved CLAUDE_CODE_VERSION into
$BASH_ENV unquoted; CircleCI sources $BASH_ENV at the start of every
subsequent step *before* any env -i wrapper can run, so the job env
(with provider credentials in scope) is live at that moment. A
malicious PR could make the resolver — which lives under
tests/claude_code/ and is therefore PR-controlled — print a value
containing a newline + shell snippet to exfiltrate ANTHROPIC_API_KEY
/ AWS_* / VERTEXAI_* / AZURE_FOUNDRY_* / GITHUB_TOKEN.

Two defenses:
- Reject anything that isn't a strict `N.N.N` semver via
  `[[ ... =~ ^N.N.N$ ]]` (whole-string match, not per-line grep).
- shell-quote on write via `printf 'export ...=%q\n'` so a bypass
  of the regex still cannot break out of the export assignment.

Pin both with a structural unit test alongside the existing scrub
pins.
2026-05-19 03:07:04 +00:00
..
__init__.py RALPH: compat matrix slice 3 - wire PR gate in CircleCI (#26479, PRD #26476) 2026-05-06 23:27:05 +00:00
test_bash_tool_restrictions.py fix(claude_code): bugbot — make bare-Bash security pin actually fail on residual 2026-05-18 05:07:49 +00:00
test_circleci_pr_gate_wiring.py fix(ci): veria — shell-quote PR-gate resolver output written to $BASH_ENV 2026-05-19 03:07:04 +00:00
test_pr_gate_version_resolver.py fix(pr-gate): greptile — exclude npm pre-release tags from version resolver 2026-05-19 01:58:23 +00:00