Detect dependency source redirection - #383
Conversation
013a79b to
b4b4f31
Compare
9e3e58d to
5040229
Compare
5040229 to
e7bad7a
Compare
a89cac0 to
ab60bb8
Compare
e7bad7a to
5a17cc3
Compare
|
Review comments taken up offline with Nir Paz and addressed in the PR. |
b523d10 to
be57557
Compare
|
Implemented the remaining findings from Nir's review
Validation: 85 dependency-source tests, 224 focused dependency/report/meta tests, 8 terminal/JSON/Markdown/SARIF end-to-end cases, and 2,316 repository tests passed; Ruff, focused mypy, and |
ab60bb8 to
4f1ecd7
Compare
6f490e2 to
66bc706
Compare
Signed-off-by: Narendran Raghavan <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
66bc706 to
6b84b11
Compare
|
Powered by Codex: PR council review result. This is a triage signal, not a maintainer approval.
|
水位修正(tools/upstream_baseline.json): reviewed_pr_through 483 → 462、reviewed_issue_through 482 → 0。原本那組數字等於 宣稱「上游 PR 與 issue 都審過了」,但沒有人看過那 8 個仍開啟的 PR,一個上游 issue 也還沒對本 fork 分診過。462 是誠實的:本 fork 的 HEAD 就是 PR NVIDIA#462 的合併點, 合併到 NVIDIA#462 為止的每個 PR 都字面存在於這棵樹裡,不需要移植;NVIDIA#462 以上的都是未合併、 未審。issue 那一軸據實寫 0。 判定記錄(docs/UPSTREAM.md,新增): fork 繼承的 36 個分支全部給出書面判定——「刪掉」不等於「處理過」,判定要寫下來 才算。分四組: - A(22 個):commits 已 patch-id 相同地在 main 裡,內容已在樹上。 - B(4 個):上游 PR 已定案。NVIDIA#332/NVIDIA#306 已合併=已在樹上;NVIDIA#155/NVIDIA#235 關閉未合併, 由同期的 -2 後續分支取代(此為依命名慣例與關閉時間的推論,檔內已標明不是上游明說)。 - C(8 個):上游 PR 仍開啟,逐筆四點評估(缺陷是什麼/本樹是否有這段程式/判定/ 回頭再看的觸發點)。本樹與上游逐字元相同,所以這些缺陷在這裡全部存在——問題是 「現在移植」還是「等上游合併」,不是「適不適用」。八筆全部判「等上游合併」, 但各有各的理由與觸發點:NVIDIA#470 的 letter-spaced P3/P4 是純靜態路徑就能繞過的真實 安全缺口,優先序最高;NVIDIA#383/NVIDIA#430/NVIDIA#442 是同一個 dependency-source redirection 能力的 三個疊加嘗試,提前選邊會造成合併衝突白工。 - D(2 個):從未成為 PR,任何水位都追不到。已從上游 fetch 回來評估後判「不適用」 (NIM provider 是功能擴充非缺陷修正、且無使用情境;revert-306 是上游自己開了又 放棄的提案),判定寫入後才刪除。 驗證:pwsh -NoProfile -File tools/dev_check.ps1 → WINDOWS DEV CHECK GREEN、exit 0 (3953 passed、39 skipped、4 xfailed)。python 驗過 baseline JSON 可解析。 Co-Authored-By: Claude Opus 5 <[email protected]>
rng1995
left a comment
There was a problem hiding this comment.
[SkillSpector Review]
Manual Review Needed at 6b84b11. The authenticated reviewer (rng1995) is also this PR's author, so an independent approval or changes-requested decision cannot be supplied reliably or accepted as the required review. The security-sensitive parser is also a large change (more than 4,000 added lines including tests) and currently conflicts with main. Please rebase it and obtain an independent maintainer/security review of the resulting current-head diff.
Summary
Add deterministic HIGH SC10 findings when package-manager configuration adds or replaces a dependency source, or when a dynamic destination cannot be resolved safely from simple local assignments.
The analyzer covers npm, Yarn, pip, Poetry, Maven, and Cargo across direct config files, commands/environment variables, generated heredoc configs, and actionable shell fences. It never executes configuration or contacts a registry.
Root cause
Existing generic patterns could notice credential/configuration-adjacent text but did not model package-source changes as dependency trust-boundary changes. A non-default registry or index could therefore affect dependency resolution without a dedicated rule, operation, scope, destination status, or package-manager evidence.
BEFORE behavior
For a published regression case that generates npm and Yarn configuration through a shell script:
AFTER behavior
The same case now emits two deterministic SC10 HIGH findings:
.npmrc.yarnrcThe destination is resolved through a same-file literal assignment and carried as structured, credential-safe evidence. The resulting combined assessment is 95 / CRITICAL / DO_NOT_INSTALL.
Supported surfaces
.npmrc, including scoped registriesnpm config set,NPM_CONFIG_REGISTRY.npmrcheredoc.yarnrc,.yarnrc.ymlyarn config setpip.conf,pip.inipip config set, index environment variablespyproject.tomlsourcespyproject.tomlheredocCommands in executable scripts and shell-language Markdown fences are actionable. Explanatory prose, comments, unrelated uses of the word “registry,” and non-shell fences do not create SC10 findings.
Deterministic decision model
unresolved.Evidence and credential safety
Each finding includes:
URL userinfo and sensitive query values are removed from SC10 findings. Report-level defense in depth applies the same redaction to every finding field and evidence string in terminal, JSON, Markdown, and SARIF output.
Validation
git diff --checkpassed.Review order
This PR is intentionally stacked on the nested-artifact PR so each change remains reviewable. After the first PR merges, this PR can be retargeted to
main; its own commit contains only SC10, credential redaction, tests, and documentation.Out of scope