CVE-2025-59682:django: Partial directory traversal in archive.extract
A historical CVE, retraced through the questions Lachesis asks of vulnerable code.
A crafted archive path passed Django's text-based prefix check and wrote a file into a neighboring directory.
That is the shape of the failure. The rest of this case file follows the evidence behind it.
What was known.
What Lachesis established.
Known before Lachesis ran
The CVE and vulnerable release were selected from public history. We are not claiming novel discovery.
- CVE
- CVE-2025-59682
- Vulnerable target
- 5.2.6 (git 75c4403) · vulnerable
- Prior knowledge
- CVE-2025-59682 · 5.2.6 (git 75c4403) is vulnerable
Independent re-detection
No source/sink/guard fed from memory; the diff (startswith -> commonpath) defined the guard, the file defined source/sink.
- Seeded inputs
- None
- Run timestamp
- 2026-08-24T12:06:09Z
- Evidence artifact
- ~/.lachesis/graphs/django_cve_2025_59682.kuzu
The commands and outputs below come from this recorded Lachesis run.
What Lachesis reconstructed.
One historical repository. Four captured queries. A complete source-to-sink argument.
Lachesis follows the same evidence path through unfamiliar repositories.
Here is how the path becomes visible.
These are the recorded questions Lachesis asked of the historical vulnerable code, followed by the raw result and source location each query returned.
Captured runThis is a real replay of Lachesis over the graph we built for this case. Every command below was run against the django archive graph and every result is the output captured on that drive. We did not choose a file or a family. The hunt listed the whole taxonomy first and the archive extraction sink fell out of it. No archive payload was seeded; the graph was built from the source alone and the finding was rediscovered from graph structure, so the mode is independent-redetection.
Load the graph and list every bug family
First we load the graph and ask the tool to list every bug family, with nothing picked ahead of time. It reports all 8 domains and 31 sink constructors and says the census is complete for what the graph can observe. Path containment is one row among all of them.
[lachesis-mcp] loaded the graph; overlay: 1236 derived edges; dataflow tier: present
CANDIDATE_CENSUS
move: candidate_census
taxonomy (8):
domain=lifecycle title=Resource lifecycle enumerable=True
domain=memory title=Memory safety enumerable=True
domain=injection title=Injection enumerable=True
domain=navigation title=Request forgery & redirection enumerable=True
domain=object-integrity title=Object integrity enumerable=True
domain=filesystem title=Filesystem enumerable=True
domain=crypto-config title=Cryptography & transport config enumerable=True
domain=resource title=Resource exhaustion enumerable=True
constructors (31): complete_for_observable_graph=True
applied: True
role_nodes: {sink: 30, source: 6}A small line with a large consequence.
startswith is a lexical prefix test. A sibling directory whose name extends the target basename, such as foo and foobar, shares the prefix and passes, so the path escapes containment.
if not filename.startswith(target_path):
// os.path.commonpath([target_path, filename]) != target_path (Django 5.2.7).
The original record.
Read the historical advisory and vulnerability record behind this reconstruction.