openai / openai/codex-security
Bundled workbench resolves Git from inherited PATH instead of the trusted executable boundary
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10.8k
- Forks
- 801
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 257
Description
Summary
The TypeScript target and bulk-scan paths deliberately resolve Git through resolveTrustedExecutable, but bundled Python workbench helpers invoke git by name from their inherited PATH.
Relevant code:
workbench_target.pylines 43-68generate_rank_input.pylines 490-505- workbench environment construction
resolvePluginPython safely resolves the Python interpreter, but returns only the executable path. The sanitized environment produced while resolving it is not retained. Workbench execution later receives the normal scan environment, and Python calls commands beginning with "git".
Why this matters
If the effective PATH contains a repository-controlled directory, such as a checkout-local node_modules/.bin, workbench registration, target inspection, snapshot calculation, or ranking preparation can execute a repository-provided Git shim with the scanning user's permissions.
This bypasses the same trust boundary already enforced and regression-tested in targets.ts and multiscan.ts. A shim can also return fabricated repository metadata, affecting target identity and integrity calculations.
Expected behavior
Every host-side Git invocation should use one trusted, absolute executable selected outside the protected repository root, together with the sanitized environment associated with that selection.
Actual behavior
The workbench and ranking helpers search inherited PATH independently.
Suggested direction
Resolve Git once with resolveTrustedExecutable, pass the absolute path and sanitized Git environment into workbench commands, and make Python helpers require that path. Add regression coverage using a repository-local Git shim and assert it is never executed.
Found by static audit of upstream main at 9c7634b.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with resolveTrustedExecutable usage in targets.ts and multiscan.ts, then inspect workbench_target.py, generate_rank_input.py, and the workbench environment construction in sdk/typescript/src/api.ts. Trace how Git paths and environments reach the Python helpers. Done means host-side workbench Git calls use the trusted selection and regression coverage shows a repository-local Git shim is never executed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, python, typescript
- Domain
- cli, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100