CVE-2026-47103 Overview
CVE-2026-47103 is a remote code execution vulnerability in the Python StateMachine library, affecting versions 3.0.0 through versions prior to 3.2.0. The flaw resides in the SCXMLProcessor, which evaluates attacker-controlled expressions from State Chart XML (SCXML) documents using Python's built-in eval() without sandboxing. An attacker who supplies a malicious SCXML document containing crafted <data expr="..."> attributes can execute arbitrary Python code in the context of the hosting process. The issue is classified under [CWE-95] (Improper Neutralization of Directives in Dynamically Evaluated Code, also known as Eval Injection).
Critical Impact
Unauthenticated attackers can achieve arbitrary code execution on any process that parses untrusted SCXML input using vulnerable versions of python-statemachine.
Affected Products
- python-statemachine 3.0.0 through 3.1.x (all versions prior to 3.2.0)
- Applications and services that load untrusted SCXML documents through SCXMLProcessor
- Downstream Python packages embedding vulnerable versions of the library
Discovery Timeline
- 2026-06-17 - CVE-2026-47103 published to NVD
- 2026-06-17 - Last updated in NVD database
- 2026-06-17 - GitHub Security Advisory GHSA-v4jc-pm6r-3vj8 published
- 2026-06-17 - python-statemachine v3.2.0 released with the fix
Technical Details for CVE-2026-47103
Vulnerability Analysis
The Python StateMachine library exposes an SCXMLProcessor class that parses State Chart XML documents and executes embedded expressions to populate state machine data. SCXML elements such as <data id="x" expr="...">, <assign>, <if cond="...">, and <send> carry expression strings that must be evaluated against a runtime data model. In affected releases, these expressions are passed unchanged through an internal call chain that ultimately invokes Python's built-in eval(). Because no allowlist, abstract syntax tree (AST) filtering, or restricted globals are applied, any Python expression provided by the document author runs with the privileges of the host process. The VulnCheck advisory documents the call path from the SCXML parser to the unsafe eval() sink.
Root Cause
The root cause is the direct use of eval() on untrusted input. SCXML treats expression attributes as a scripting surface, and the library treated the document as trusted by design. No separation exists between the data model parser and the Python interpreter, so XML attribute values become executable code.
Attack Vector
Exploitation requires only that the application load an attacker-controlled SCXML document. An attacker crafts a document containing a <data> element whose expr attribute encodes a Python payload, for example invoking __import__('os').system(...) or subprocess.Popen(...). When the application calls SCXMLProcessor to parse and start the state machine, the expression is passed to eval() and the payload executes. No authentication or user interaction is required if the SCXML input reaches the processor over a network endpoint, file upload, or message queue.
No verified proof-of-concept code has been published in the enriched data. See the GitHub Security Advisory GHSA-v4jc-pm6r-3vj8 for technical details.
Detection Methods for CVE-2026-47103
Indicators of Compromise
- SCXML documents containing <data>, <assign>, <if>, or <send> elements with expr/cond attributes referencing Python builtins such as __import__, eval, exec, compile, open, or subprocess.
- Unexpected child processes (for example sh, bash, cmd.exe, powershell.exe) spawned by Python interpreters that host the application.
- Outbound network connections initiated by Python processes immediately after SCXML ingestion.
Detection Strategies
- Inventory Python environments for python-statemachine versions >=3.0.0,<3.2.0 using pip list or software bill of materials (SBOM) tooling.
- Inspect application code paths that call SCXMLProcessor and log the source, size, and origin of every SCXML document parsed.
- Apply static analysis or YARA rules to SCXML payloads to flag dangerous tokens inside expr and cond attributes before the document reaches the processor.
Monitoring Recommendations
- Alert on process lineage where a Python process spawns shells, scripting engines, or remote administration tools.
- Monitor file integrity and credential stores for read access from Python worker processes that handle SCXML input.
- Capture and retain SCXML inputs at the edge to support retrospective hunting once new exploitation patterns are published.
How to Mitigate CVE-2026-47103
Immediate Actions Required
- Upgrade python-statemachine to version 3.2.0 or later in every affected service, container image, and CI pipeline.
- Disable or remove any endpoint that accepts SCXML documents from untrusted sources until the upgrade is complete.
- Audit recent logs of SCXML processing for suspicious expr content and unexpected child process activity.
Patch Information
The maintainers fixed the vulnerability in python-statemachine v3.2.0. Refer to GHSA-v4jc-pm6r-3vj8 for the full advisory and remediation guidance.
Workarounds
- Reject SCXML input from untrusted sources at the application boundary until patching is complete.
- Strip or validate expr and cond attributes from incoming SCXML documents using an XML parser before invoking SCXMLProcessor.
- Run services that must process SCXML inside a minimally privileged sandbox, container, or seccomp profile to limit the blast radius of any successful exploitation.
# Upgrade python-statemachine to the patched release
pip install --upgrade "python-statemachine>=3.2.0"
# Verify the installed version
python -c "import statemachine; print(statemachine.__version__)"
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

