CVE-2025-6021:xmlBuildQName: the length math that wrapped
How Lachesis ranked the vulnerable copy path without being told its source, sink, or missing guard.
Two attacker-controlled lengths wrapped during addition. The allocation became smaller, but the following copy kept its full size.
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-6021
- Vulnerable target
- v2.14.1 · vulnerable
- Prior knowledge
- CVE-2025-6021 · v2.14.1 is vulnerable
Independent re-detection
no source/sink/guard fed. SAST candidate sweep across all enumerable families, ranked; then inspected which candidates the ranking floated to the top.
- Seeded inputs
- None
- Run timestamp
- 2026-08-24T12:06:09Z
- Evidence artifact
- ~/.lachesis/graphs/libxml2_cve_2025_6021.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 block reflects the real blind drive of the graph we built for libxml2. We loaded the whole graph, listed every bug family with nothing chosen ahead of time, and the overflowing copy came out ranked first of all the memory copy sinks. The candidate, model tag and rank below are the facts captured on that drive on that drive. No document was seeded; 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. The memory copy family is one row among all of them.
{"move": "load_graph", "graph": "/Users/riyandhiman/.lachesis/graphs/libxml2_cve_2025_6021.kuzu", "profile": "all"}
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: TrueA small line with a large consequence.
Nothing verifies that lenn + lenp + 2 has not wrapped before it is used as the allocation size. The later comparison is also an int and does not catch the wrap.
ret = xmlMalloc(lenn + lenp + 2); /* ... */ memcpy(&ret[lenp + 1], ncname, lenn);
/* upstream fix: promote the size math to size_t and reject the wrap before allocating, so an oversized QName is refused rather than truncated. */
The original record.
Read the historical advisory and vulnerability record behind this reconstruction.