The archive/CVE-2025-12060
KerasDisclosed 2025

CVE-2025-12060:Keras: Arbitrary file write via archive extraction

A reconstruction of the flaw, and the evidence path Lachesis follows to make it visible.

Historical recordv3.11.3 (last-vulnerable; range <= 3.11.3)
WeaknessCWE-22 → CWE-59 · arbitrary file write via archive extraction
ImpactA arbitrary file write via archive extraction in Keras, reachable from attacker-controlled input.
Read the reconstruction
01What happened

With no family and no line seeded, the whole-taxonomy enumerator put 10 of its filesystem.path.containment leads inside keras/src/utils/file_utils.py (lines 123-522).

That is the shape of the failure. The rest of this case file follows the evidence behind it.

Separate the record from the run

What was known.
What Lachesis established.

01Historical record

Known before Lachesis ran

The CVE and vulnerable release were selected from public history. We are not claiming novel discovery.

CVE
CVE-2025-12060
Vulnerable target
v3.11.3 (last-vulnerable; range <= 3.11.3) · vulnerable
Prior knowledge
CVE-2025-12060 · v3.11.3 (last-vulnerable; range <= 3.11.3) is vulnerable
then
02Lachesis run
Verified captured run

Independent re-detection

The experiment graph was built around the last-vulnerable release (v3.11.3), scoped to keras/src/utils so the file-utils translation unit builds under the pass budget (build 11s, enrich 21499 nodes / 57470 edges), then enumerated BLIND over the whole constructor registry (no family hard-coded, no target line seeded). The census and candidate ids below are the enumerator's own verbatim output; prose in `adjudication`/`trace` is MY reading of the advisory + fix, clearly separated from tool output.

Seeded inputs
None
Run timestamp
2026-09-03T00:00:00Z
Evidence artifact
cve-2025-12060.kuzu (built from Keras v3.11.3, scoped to keras/src/utils; graph + sidecars deleted after capture)

The commands and outputs below come from this recorded Lachesis run.

The reconstruction, in one frame

What Lachesis reconstructed.

One historical repository. Four captured queries. A complete source-to-sink argument.

Lachesis Casefiles · Unbound ComputeVerified runCVE-2025-12060
With no family and no line seeded, the whole-taxonomy enumerator put 10 of its filesystem.path.containment leads.
01Sourceattacker-controlled input
02Sink# extract_archive: member extracted to a destination path not robustly contained
03Missing guard# extract_archive extracts members without a containment guard that survives symlink resolution
$ lachesis sources_of → reaches → guard_dominance
Keras · v3.11.3 (last-vulnerable; range <= 3.11.3) · vulnerableunboundcompute.com
This was known history. Your code is not.

Lachesis follows the same evidence path through unfamiliar repositories.

The Lachesis reconstruction

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.

RepositoryKeras
Revisionv3.11.3 (last-vulnerable; range <= 3.11.3) · vulnerable
EngineLachesis

Captured runA real replay of Lachesis over the graph we built for this case (build 11s under the pass cap, bounded memory). Every value below is verbatim captured tool output; the graph was released immediately after capture, so nothing accumulates.

01 · lachesis01 / 03
Lachesis ran
lachesis build (scoped keras/src/utils) && enrich

Investigate the candidate

The narrowed scope builds the file-utils TU under the pass cap.

Captured resultCaptured · lachesis
raw captured outputlachesis
build rc=0 11s
enrich rc=0 :: pass2 published 21499 nodes and 57470 edges
keras/src/utils/file_utils.pyline 0
Code location returned for this evidence step.
The repair

A small line with a large consequence.

the extraction trusts tarfile's filter / filter_safe_paths() allowlist, which a long symlink chain bypasses, so an extracted member's final path can escape the destination directory.

Before
# extract_archive extracts members without a containment guard that survives symlink resolution
After the patch
// 3.12.0 extracts with filter="data" and robust per-member containment, closing the symlink-chain bypass.
Sources & further reading

The original record.

Read the historical advisory and vulnerability record behind this reconstruction.

Open the Lachesis quickstart