The archive/CVE-2026-5295
wolfSSL/wolfsslDisclosed 2026

CVE-2026-5295:wolfssl: Stack-based buffer overflow

A historical CVE, retraced through the questions Lachesis asks of vulnerable code.

Historical recordv5.9.0-stable (affected: <= 5.9.0)
WeaknessCWE-787 → CWE-120 → CWE-121 · Stack-based buffer overflow
ImpactA stack-based buffer overflow in wolfssl, reachable from attacker-controlled input.
Read the reconstruction
01What happened

An oversized identifier from a PKCS7 message was copied into a fixed stack buffer without a matching size check.

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-2026-5295
Vulnerable target
v5.9.0-stable (affected: <= 5.9.0) · vulnerable
Prior knowledge
CVE-2026-5295 · v5.9.0-stable (affected: <= 5.9.0) is vulnerable
then
02Lachesis run
Verified captured run

Independent re-detection

The experiment graph was built around the vulnerable wc_PKCS7_DecryptOri() (release v5.9.0-stable, wolfcrypt/src/pkcs7.c), rather than starting from arbitrary wolfSSL source. We did not point the tool at the CVE. Enumeration ran over the whole candidate registry (every family); the memory.copy sink came out of it on its own, and Lachesis carried the attacker-controlled OID length into the fixed-size buffer copy. Every field under sast_output is the enumerator's own emission; the mechanism under adjudication is my reading of the source and fix.

Seeded inputs
None
Run timestamp
2026-08-24T12:06:09Z
Evidence artifact
~/.lachesis/graphs/wolfssl_decryptori.kuzu

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-2026-5295
An oversized PKCS7 identifier reached a stack buffer with no size check.
01Sourceif (GetASNObjectId(pkiMsg, idx, &oriOIDSz, pkiMsgSz) != 0) return ASN_PARSE_E;
02SinkXMEMCPY(oriOID, pkiMsg + *idx, (word32)oriOIDSz); // -> stack overflow of oriOID[MAX_OID_SZ]
03Missing guardXMEMCPY(oriOID, pkiMsg + *idx, (word32)oriOIDSz);
$ lachesis sources_of → reaches → guard_dominance
wolfSSL/wolfssl · v5.9.0-stable (affected: <= 5.9.0) · 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.

RepositorywolfSSL/wolfssl
Revisionv5.9.0-stable (affected: <= 5.9.0) · vulnerable
EngineLachesis

Captured runThis is a real replay of Lachesis over the graph we built for this case. Every command below was run against the wolfssl DecryptOri graph and every result is the output captured on that drive. We did not name a family. The hunt listed the whole taxonomy first and the memory copy sink came out of it. No PKCS7 message was seeded; the graph was built from the source alone and the finding was rediscovered from graph structure, so the mode is independent-redetection.

01 · load_graph01 / 05
Lachesis ran
load_graph --path ~/.lachesis/graphs/wolfssl_decryptori.kuzu --profile all && candidate_census

Load the graph and list every bug family

First we load the graph and ask the tool to list every bug family, with nothing chosen 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.

Captured resultCaptured · load_graph
raw captured outputload_graph
[lachesis-mcp] loaded the graph; overlay: 0 derived edges; dataflow tier: on demand, per cone

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: 2}
wolfcrypt/src/pkcs7.cline 0
Code location returned for this evidence step.
The repair

A small line with a large consequence.

No bounds check compares the copy size with the destination buffer size.

Before
XMEMCPY(oriOID, pkiMsg + *idx, (word32)oriOIDSz);
After the patch
// if (oriOIDSz <= 0 || (word32)oriOIDSz > MAX_OID_SZ) return ASN_PARSE_E;  (fixed in 5.9.1)
Sources & further reading

The original record.

Read the historical advisory and vulnerability record behind this reconstruction.

Open the Lachesis quickstart