GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — In a PDM `__pypackages__` (PEP 582) project, hosted mode gives no stale-install warning and `vex` attests not_affected while the copy `pdm run` imports is still unpatched · Issue #528 · SocketDev/socket-patch Closed Labels agent:triagedbugSomething isn't workingSomething isn't workingbughuntFound by a scheduled package-manager bug-hunt agentFound by a scheduled package-manager bug-hunt agentpm:pdmPDMPDMpriority:p1 Description[agent] Found by the scheduled PDM bug-hunt routine (ledger #312). Summarydocs/testing/pdm-compatibility.md:72-76 says The in-project The opposite direction also goes wrong. If the PATH interpreter happens to have the same release installed (here ImpactA CI gate on Repro (Linux, real PDM, local mock of the patch API serving a real patched urllib3 wheel)cat > pyproject.toml <<'EOF' [project] name = "demo" version = "0.1.0" requires-python = ">=3.9" dependencies = ["urllib3==1.26.17"] EOF pdm config -l python.use_venv false mkdir __pypackages__ pdm use -f /usr/bin/python3.11 # .pdm-python -> /usr/bin/python3.11 (has no urllib3 1.26.17) pdm lock && pdm sync # upstream urllib3 -> __pypackages__/3.11/lib socket-patch scan --mode hosted --yes # pdm.lock -> hosted url + patched sha256; NO "still differ" warning socket-patch vex -O vex.json # exit 0, 1 statement: not_affected / inline_mitigations_already_exist pdm run python -c "import urllib3; print(urllib3.__file__, getattr(urllib3, 'SOCKET_PATCHED', 'UPSTREAM'))" # .../__pypackages__/3.11/lib/urllib3/__init__.py UPSTREAM Control: the same steps without Expected vs actual
Matrix (Linux; 2 of 2 fresh runs per cell, main
|
| PDM | layout | stale-install warning | vex |
installed copy |
|---|---|---|---|---|
| 2.29.2 | __pypackages__ |
none | exit 0, not_affected | upstream |
| 2.29.2 | .venv (control) |
yes | exit 1, omitted not_applied |
upstream |
| 2.12.4 | __pypackages__ |
none | exit 0, not_affected | upstream |
| 2.12.4 | .venv (control) |
yes | exit 1, omitted not_applied |
upstream |
| 2.29.2 | __pypackages__, after pdm sync (patched), PATH python has upstream 1.26.18 |
— | exit 1, not_applied (false negative) |
patched |
macOS and Windows weren't run. The discovery code has no OS-specific branch for this. Not bisected: v4.0.0 hosted VEX has different (ledger-based) semantics, so it isn't a like-for-like comparison.
crates/socket-patch-core/src/crawlers/python_crawler.rs:329 (find_local_venv_site_packages) and :1709 (get_site_packages_paths): there's no __pypackages__/<X.Y>/lib probe, so a PDM PEP 582 project falls through to is_python_project → the global / PATH interpreter.crates/socket-patch-cli/src/commands/scan/hosted/python.rs:136: the stale-install warning uses the same discovery..pdm-python / .pdm.toml is ignored). Its fix wouldn't cover this, because in PEP 582 mode .pdm-python names the base interpreter (/usr/bin/python3.11), while packages live in __pypackages__. Same symptom family as Poetry with virtualenvs.in-project = true but no ./.venv keeps using its out-of-tree env, which socket-patch never probes: agent patches the global interpreter and hosted VEX falsely attests #476 / Hosted Hatch rewrite leaves an existing Hatch environment unpatched with no stale-install warning, and vex still attests not_affected #335 / In a --system-site-packages venv, pip keeps the base interpreter's unpatched copy after a hosted rewrite, no stale-install warning fires, and vex attests it as patched #409.pdm: 2026-10-02 bug-hunt run (#528, #502/#451 comments)
[agent] Triaged as priority:p1 (PDM). I checked this on main 61cfb9b. crates/socket-patch-core/src/crawlers/python_crawler.rs never probes __pypackages__/<X.Y>/lib: there's no match for __pypackages__ anywhere in the crawler. So a PEP 582 project falls through to the PATH interpreter, and that discovery path also feeds the hosted stale-install check and vex. Not a duplicate. Related to #502 (the .pdm-python interpreter is ignored) but a separate fix, as the report notes. No open fix PR.
Generated by Claude Code
[agent] Claiming this issue (with #502, #525; shared root cause: find_local_venv_site_packages never resolves the env the project's package manager records (PDM .pdm-python / __pypackages__, uv UV_PROJECT_ENVIRONMENT), so discovery falls through to ./.venv or the PATH interpreter). Branch: agent/fix-python-manager-project-env. Claim-ID: 2026-10-02T07:21:09Z-11e135
Generated by Claude Code
[agent] PDM bug-hunt re-triage: I tested PR #540 (head 60dfb81) with real PDM against a local mock of the patch API, and it fixes this issue. Main 61cfb9b still reproduces it.
Setup: PEP 582 project (python.use_venv false, pdm use -f /usr/bin/python3.12, pdm lock && pdm sync), so upstream urllib3 1.26.18 sits in __pypackages__/3.12/lib. Then scan --mode hosted -y, vex, pdm sync, vex again.
| PDM | build | stale-install warning | vex before reinstall |
vex after pdm sync (patched) |
|---|---|---|---|---|
| 2.29.2 | main 61cfb9b |
none | exit 0, not_affected (wrong) |
exit 0, not_affected |
| 2.29.2 | PR #540 | printed | exit 1, omitted | exit 0, not_affected |
| 2.12.4 | main 61cfb9b |
none | exit 0, not_affected (wrong) |
exit 0, not_affected |
| 2.12.4 | PR #540 | printed | exit 1, omitted | exit 0, not_affected |
The PATH interpreter (/usr/local/bin/python3) has no urllib3 1.26.18 in this container, so I couldn't re-check the false-negative variant from the report here. Leaving this open until #540 merges.
Generated by Claude Code