`get <uuid>` overrides socket.yml without the documented `policy_bypassed` warning (purl/CVE/GHSA forms do warn)
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 78/100
Rechercherichtung
Start in crates/socket-patch-cli/src/commands/get.rs:2603-2700, tracing the IdentifierType::Uuid mode branches and compare them with the search path reaching policy_bypass_warnings at lines 2929-2933. Reproduce the hosted, vendored, and agent commands from the issue with socket.yml excluding the package. Done means UUID get reports policy_bypassed in warnings[] and on stderr whenever policy would skip the package.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
[agent] Found by the scheduled Pipenv bug-hunt routine (ledger #313).
Summary
The contract says get ignores socket.yml but has to say so when it does. When the repo's socket.yml would have skipped the package, get must warn policy_bypassed, both in warnings[] and on stderr. The purl, CVE and GHSA forms of get do this. The UUID form doesn't. get <uuid> takes an early-return path straight into the mode dispatch, and that path never calls policy_bypass_warnings. The package gets patched in every mode (agent, hosted, vendored) with exit 0, no stderr line, and no warnings key in the --json envelope.
I found this on a Pipenv project, but the code path doesn't depend on the ecosystem.
Impact
policy_bypassed is the only signal that a run overrode the repository's rollout policy (ignorePackages, ecosystems, includePaths/ignorePaths, minSeverity, enabled: false). A UUID is the identifier that dashboards, bots and the scan table all hand out. So the most common scripted get can push a patch the repo explicitly excluded (for example enabled: false during a freeze) and leave nothing in CI logs or JSON output to flag it.
Repro (Linux, main 2463257, Pipenv 2026.8.0 project, local mock patch API)
git init -q proj && cd proj
# Pipfile + Pipfile.lock pinning six==1.16.0 (pipfile-spec 6)
printf 'version: 2\npatches:\n ignorePackages: ["pkg:pypi/six"]\n' > socket.yml
socket-patch get pkg:pypi/[email protected] --mode hosted --yes --json | jq .warnings
# ["(policy_bypassed) pkg:pypi/[email protected] would be skipped by socket.yml (policy_package_ignored: pkg:pypi/six (patches.ignorePackages)); get patches it anyway"]
git checkout Pipfile.lock 2>/dev/null || cp Pipfile.lock.orig Pipfile.lock
socket-patch get <uuid-of-that-patch> --mode hosted --yes --json | jq .warnings
# null (Pipfile.lock is rewritten, exit 0, nothing on stderr)
Results from two runs, each identical:
| Command | exit | lock patched | warnings[] policy_bypassed |
stderr warning |
|---|---|---|---|---|
get pkg:pypi/[email protected] --mode hosted |
0 | yes | yes | yes |
get pkg:pypi/[email protected] --mode vendored |
0 | yes | yes | yes |
get <uuid> --mode hosted |
0 | yes | missing | missing |
get <uuid> --mode vendored |
0 | yes | missing | missing |
get <uuid> --mode agent |
0 | n/a (in place) | missing | missing |
Expected vs actual
- Expected:
crates/socket-patch-cli/CLI_CONTRACT.md(socket.yml, "Commands") says: "getis explicit intent: it ignores the policy and warnspolicy_bypassed(inwarnings[], and on stderr) when socket.yml would have skipped the package".docs/configuration.mdsays the same: "it bypasses policy and warns when a valid policy would exclude its target". Neither carves out the UUID form. - Actual: only the search-backed forms warn. The UUID form patches silently.
OS × version
| OS | Pipenv | reproduces |
|---|---|---|
| Linux | 2026.8.0 (SOCKET_PIPENV_MAJOR=2026) |
yes (2/2) |
| macOS / Windows | — | not probed. The code path is platform-independent. |
First bad
socket.yml arrived with #277 (2463257) and isn't in any published release (v4.0.0 predates it). So the bug has been there since the feature landed.
Suspect code
crates/socket-patch-cli/src/commands/get.rs:2603-2700: theIdentifierType::Uuidbranch returns from thematch modedispatch (save_and_apply_patch/run_get_hosted(…, &[], &[])/run_get_vendored(…, &[], &[])) with empty warning lists.crates/socket-patch-cli/src/commands/get.rs:2929-2933: the only call site ofsuper::scan::policy::policy_bypass_warnings, which only the search path reaches.
- Vorherrschende Sprache
- Rust
- Sterne
- 8
- Forks
- 0
- Ø Merge
- 19 Std. 56 Min.
- Gemergte PRs (30 T.)
- 51
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus SocketDev/socket-patch
-
agent:triaged bug bughunt pm:npm priority:p1
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
SocketDev/socket-patch#464 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
agent:triaged bug bughunt pm:npm priority:p1
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
SocketDev/socket-patch#433 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
agent:triaged bug bughunt pm:uv priority:p1
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
SocketDev/socket-patch#408 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
agent:triaged bug bughunt pm:yarn-berry priority:p1
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
SocketDev/socket-patch#370 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Hosted Gradle snippet is always Groovy DSL, so pasting it into a build.gradle.kts fails to compileOffenagent:triaged bug bughunt pm:gradle priority:p3
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
SocketDev/socket-patch#348 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in SocketDev/socket-patch
Ähnliche Issues
-
bug CLI exec tool-calls
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
maintainer-needed p2 triaged ui windows
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
Maintainer antworten meist innerhalb von 1 Tag
-
ai_p2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
ClickHouse/ClickHouse#123351 ·
Maintainer antworten meist innerhalb von 1 Tag
-
documentation
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
github/copilot-sdk#2804 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag