python-statemachine
CVE-2026-100414 · GHSA-fj3w-533r-fvf6
Untrusted SCXML external-source local-file disclosure
High, 7.1 · Public source snapshot: November 12, 2026
Original portfolio report · Source reference · Public advisory · CVE record
Shared credits and the scope of my investigation are documented below.
CVE-2026-100414 · GHSA-fj3w-533r-fvf6 · python-statemachine · High
Public security research by Charles Vosburgh (
the-vibe-dev). The public advisory credits three reporters; this write-up preserves that shared attribution.
| Field | Value |
|---|---|
| Package | python-statemachine |
| Ecosystem | PyPI / Python |
| Severity | High |
| CVSS | 7.1 — CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:L |
| Affected | >= 3.2.0, < 3.2.1 |
| Fixed | 3.2.1 |
| Weakness | CWE-200 — Exposure of Sensitive Information to an Unauthorized Actor |
| Public PoC | Yes |
| Credit | the-vibe-dev, Pig-Tail, and manus-use are publicly credited reporters |
python-statemachine 3.2.0 introduced a declarative statechart loader with trusted=False as the documented secure default for untrusted or externally produced SCXML. Despite that restriction, an SCXML <data src> element using the file: scheme was resolved during parsing before the restricted evaluator was selected.
As a result, an attacker-controlled statechart could cause the Python process to read a local file that the process itself was permitted to access. The file contents were then placed into the statechart datamodel and could be referenced by the document.
This is a local file disclosure primitive in a consuming application that accepts attacker-controlled SCXML. It is not command execution, arbitrary file modification, or an operating-system permission bypass.
Security invariant: All external resource resolution requested by an untrusted statechart must be authorized before any file, network, or URI handler performs I/O.
The public loader API defaults to restricted mode:
def load(
source: "str | Path",
*,
format: "str | None" = None,
trusted: bool = False,
validate: bool = False,
name: "str | None" = None,
) -> "type[StateChart]":
That API gives users a reasonable expectation that external documents loaded with the default settings will not automatically receive ambient Python-process authority.
The problem was ordering.
In 3.2.0, loader.py::_build() first asked the format reader to parse the document and only afterward created the interpreter using evaluator_for(trusted):
definition = reader.read(text, source_name=name or location_hint)
location = name or definition.name or location_hint or "statechart"
interpreter = Interpreter(reader=reader, evaluator=evaluator_for(trusted))
interpreter.process_definition(definition, location=location)
The sensitive I/O happened inside the SCXML reader during that first step.
A document-controlled <data src> value was parsed as a URI. If the scheme was file and the element had no inline content, 3.2.0 opened the path immediately:
src = data_elem.attrib.get("src")
src_parsed = urlparse(src) if src else None
if src_parsed and src_parsed.scheme == "file" and content is None:
with open(src_parsed.path) as f:
content = f.read()
By the time RestrictedEvaluator existed, the file had already been read and its bytes had entered the statechart definition.
The later action-building code then turned that data item into a model value. The document could reference or log the value using the ordinary statechart expression facilities.
The loader treated external source resolution as parser setup rather than as a privileged operation subject to the trust model.
The restricted evaluator controlled expression evaluation but did not own the earlier file-open step. Security policy was therefore applied too late in the pipeline.
This is a general loader-design hazard: parsing, normalization, include resolution, schema imports, templates, and external resources can all perform privileged work before the system reaches the component that is thought of as “the sandbox.”
flowchart TD
A[Application accepts attacker-controlled SCXML]
B[load defaults to trusted=False]
C[SCXML reader parses data src=file:...]
D[Reader opens local path before restricted evaluator exists]
E[File contents enter statechart datamodel]
F[Document references/logs the loaded value]
A --> B --> C --> D --> E --> F
The maximum disclosure is bounded by the operating-system permissions of the Python process. The vulnerability does not bypass Unix/Windows filesystem ACLs; it gives the untrusted statechart access to the process's ambient read authority.
The PoC is public in GHSA-fj3w-533r-fvf6 and is not duplicated as a separate artifact in this repository.
The published reproduction creates a benign local sentinel file, loads SCXML containing a file: data source under the default trusted=False configuration, and observes the sentinel through the statechart datamodel.
The public PoC was executed against exact PyPI wheels for 3.2.0 and 3.2.1:
- 3.2.0: the sentinel content was read and made available to the statechart;
- 3.2.1: the external source was rejected before the file-open operation.
That fixed-version control is the key result: the corrected implementation makes the trust decision before I/O rather than merely filtering the value after it has been read.
The public fix commit is:
f7159a8549c5c26de0babb7b67c882804037a24e
released in 3.2.1.
The corrected SCXML reader retains the external source reference instead of opening it during parsing. Resolution is deferred until the action layer can ask the active evaluator whether external sources are permitted.
The fixed flow calls an authorization method equivalent to:
evaluator.ensure_external_src_allowed(...)
before resolving the resource. The restricted evaluator raises an invalid-definition error, while the trusted evaluator continues to support the documented external-resource feature.
The same trust boundary was applied to related external source surfaces such as <invoke src> and srcexpr, preventing the fix from protecting only one syntax form.
The underlying SCXML external-source handling entered public history in commit:
08dd542b28f895688f877e037a5a3d52f16b0215
The security-relevant public release boundary is 3.2.0, where commit:
9492f3f7d543da52368fe2e1416ba7f0f0d67730
introduced the format-neutral loader and its trusted=False secure-default model while still carrying the ungated external read.
The prior 3.1.2 release does not contain the same public loader surface. The published affected range is therefore:
>= 3.2.0, < 3.2.1
The v3.2.0 and v3.2.1 tags and PyPI wheel contents were inspected and matched at the relevant source files.
A consuming application that accepts attacker-controlled SCXML can unintentionally expose local text files readable by its Python process. Depending on deployment, that may include application configuration, credentials stored in readable files, source material, tokens, or other local data.
The public advisory rates the issue High, CVSS 7.1.
The demonstrated primitive is disclosure only. This write-up does not claim command execution or file writes through the <data src> path. Related availability effects or other external-source actions should be evaluated separately rather than folded into the proven result.
Upgrade to python-statemachine 3.2.1 or later.
If an application intentionally needs external SCXML resources, use an explicit trusted mode only for documents from a source the application is willing to grant that authority. For untrusted documents, keep external resolution disabled regardless of URI scheme.
Regression coverage should include:
file:references under restricted mode;- equivalent relative/absolute source forms;
- trusted-mode positive controls;
<invoke src>andsrcexpr;- assertions that the sensitive file is never opened when policy denies the source;
- network URI handlers if supported in the future.
| Date | Event |
|---|---|
| 2026-06-17 | python-statemachine 3.2.0 published. |
| 2026-08-01 | 3.2.1 and GHSA-fj3w-533r-fvf6 published with the public PoC. |
| 2026-08-26 | Exact public tags, PyPI wheels, vulnerable and fixed PoC controls reviewed. |
GHSA-fj3w-533r-fvf6 is a trust-boundary ordering flaw. python-statemachine exposed a restricted loader but performed external file I/O during parsing before that restriction existed in the execution pipeline. Version 3.2.1 moves authorization in front of resource resolution and applies the same rule across related external-source paths.
Broader lesson: “Untrusted mode” must cover preprocessing as well as evaluation. If parsing can read files or fetch resources first, a later sandbox cannot undo the disclosure.
- CVE-2026-100414
- https://github.com/fgmacedo/python-statemachine/security/advisories/GHSA-fj3w-533r-fvf6
- https://github.com/fgmacedo/python-statemachine/releases/tag/v3.2.1
The public advisory credits me (the-vibe-dev), Pig-Tail, and manus-use as reporters. This write-up does not claim sole discovery.
Research was AI-assisted for source mapping, hypothesis generation, release comparison, and evidence organization. I performed the final validation, disclosure coordination, severity calibration, and publication review.
This write-up documents a publicly disclosed vulnerability for defensive research, remediation, regression testing, and authorized assessment. Test only with synthetic files in environments you own or are explicitly authorized to assess.