-
Notifications
You must be signed in to change notification settings - Fork 0
fix(pip-audit): keep index-url locks hashed and reject symlink parents #1051
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
cursor
wants to merge
5
commits into
main
Choose a base branch
from
cursor/bc-9e735bff-0cbd-4bb6-abcc-b5dad2b94830-fc67
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
bb73242
fix(pip-audit): keep hashed locks off the pip resolver
seonghobae c6ef6af
fix(pip-audit): parse exact PEP 508 lock pins
seonghobae e56ff97
Merge branch 'main' into cursor/bc-9e735bff-0cbd-4bb6-abcc-b5dad2b948…
opencode-agent[bot] 4f4dd0a
Reconcile current main for pip-audit fix
seonghobae 401cfc6
fix(changelog): remove duplicate materialization entry
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| # Strix hashed-lock install and pip-audit without pip re-resolution | ||
|
|
||
| 검토 기준일: **2026-08-16** | ||
|
|
||
| ## Incident | ||
|
|
||
| The required Strix workflow is `pull_request_target`: GitHub runs the **base | ||
| branch** copy of `.github/workflows/strix.yml` against the pull-request head | ||
| tree. ContextualWisdomLab/.github#961 therefore compiled a complete lock of | ||
| `strix-agent==1.5.3` plus `cryptography==50.0.0` (override for CVE-2026-39892 | ||
| and CVE-2026-69247) and added `--no-deps` to the PR copy of the installer, but | ||
| the live required job still executed main's installer: | ||
|
|
||
| ```text | ||
| pip install --require-hashes -r requirements-strix-ci-hashes.txt | ||
| ``` | ||
|
|
||
| pip re-applied `strix-agent 1.5.3 depends on cryptography<49 and >=48.0.1` | ||
| and exited `ResolutionImpossible`. The same resolver path is what | ||
| `python-security.yml` used for every `requirements*.txt` file. pip-audit then | ||
| printed `::error::pip-audit reported known-vulnerable Python dependencies` | ||
| even though no advisory was returned. A buyer watching the required security | ||
| dashboard saw two red X marks on an honest lock. | ||
|
|
||
| ## Decision | ||
|
|
||
| 1. Land `--require-hashes --no-deps` on **main's** Strix installer first, with | ||
| no lock change. The current main lock (`strix-agent==1.0.4` + | ||
| `cryptography==50.0.0`) is already a complete hashed set, so `--no-deps` | ||
| does not widen the install. After this lands, a later 1.5.3 lock can | ||
| install under the required base-branch workflow. | ||
| 2. Audit hashed locks with `pip-audit --disable-pip` via | ||
| `scripts/ci/pip_audit_requirements.py`. Compile-time `*-overrides.txt` | ||
| files and unhashed inputs that already have a `*-hashes.txt` sibling are | ||
| not separate install sets. | ||
| 3. Do not drop `cryptography==50.0.0` to satisfy the stale `<49` metadata | ||
| bound. Do not treat `ResolutionImpossible` as a vulnerability. | ||
|
|
||
| `python-security.yml` is `pull_request` (not `_target`), so the helper takes | ||
| effect on the same head that introduces it. Strix still needs this installer | ||
| line on the protected base before #961 can go green. | ||
|
|
||
| ## Trust boundary | ||
|
|
||
| - `--no-deps` is not an unhashed install: every wheel remains hash-pinned. | ||
| - `--disable-pip` still queries the advisory database for every pinned name | ||
| and version; it only skips pip's metadata resolver. | ||
| - NVIDIA NIM / OpenCode review-agent credentials are untouched. | ||
| - No operational PII is masked. | ||
|
|
||
| ## Verification contract | ||
|
|
||
| `tests/test_pip_audit_requirements.py` reconstructs the #961 lock shape and | ||
| requires `--disable-pip` for that file, a skip for the override/input pair, | ||
| and the `--no-deps` installer line on `strix.yml`. A `*-hashes.txt` name | ||
| or a lone `--require-hashes` directive without `--hash=` is not treated | ||
| as a complete lock. A mixed file with one hashed line beside unhashed | ||
| packages, a filename-only wheel path, a `-r`/`-c`/`-e` include, or a pip | ||
| option carrying hash-shaped text also stays on the resolver path. A | ||
| complete lock that only adds resolver configuration such as `--index-url` | ||
| still receives `--disable-pip`. An unhashed compile input is skipped | ||
| only when its regular, non-symlink sibling is itself a valid complete lock. | ||
| Invalid UTF-8 and symlink/special-file requirement inputs fail before any | ||
| audit command. Discovery does not descend directory symbolic links, and a | ||
| presented path whose intermediate parent is a symlink or whose resolved | ||
| target leaves the audit root fails closed (CWE-22 / CWE-59). | ||
| Repository-controlled filenames are JSON-escaped before GitHub Actions | ||
| group titles. Discovery skips `.venv` trees. | ||
|
|
||
| ## References (APA 7th) | ||
|
|
||
| GitHub. (2026). *Cryptography vulnerable to buffer overflow if | ||
| non-contiguous buffers were passed to APIs (CVE-2026-39892, | ||
| GHSA-p423-j2cm-9vmq)*. GitHub Advisory Database. | ||
| https://github.com/advisories/GHSA-p423-j2cm-9vmq | ||
|
|
||
| GitHub. (2026). *PKCS#7 decryption timing oracle in pyca/cryptography | ||
| (CVE-2026-69247, GHSA-g6cj-pr64-35w5)*. GitHub Advisory Database. | ||
| https://github.com/advisories/GHSA-g6cj-pr64-35w5 | ||
|
|
||
| National Institute of Standards and Technology. (2026). | ||
| *CVE-2026-69247*. National Vulnerability Database. | ||
| https://nvd.nist.gov/vuln/detail/CVE-2026-69247 | ||
|
|
||
| pypa. (2025). *pip-audit: ``--disable-pip`` (hashed requirements / ``--no-deps`` | ||
| only)*. https://github.com/pypa/pip-audit | ||
|
|
||
| MITRE. (2026). *CWE-22: Improper limitation of a pathname to a restricted | ||
| directory ('Path Traversal')*. https://cwe.mitre.org/data/definitions/22.html | ||
|
|
||
| MITRE. (2026). *CWE-59: Improper link resolution before file access | ||
| ('Link Following')*. https://cwe.mitre.org/data/definitions/59.html | ||
|
|
||
| Python Packaging Authority. (n.d.). *Hash-checking mode*. pip documentation. | ||
| https://pip.pypa.io/en/stable/topics/secure-installs/#hash-checking-mode |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.