Vulnerabilities in pkg:pypi/python-statemachine

PACKAGE
Advisory Identifier: GHSA-v4jc-pm6r-3vj8
Advisory Summary

CVE-2026-47103 is a CRITICAL (CVSS 9.8) python-statemachine scxml <data expr> eval vulnerability (CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection')) affecting Python statemachine libraries in the PyPI ecosystem. The issue involves python-statemachine scxml <data expr> eval injection. Remediation is available by upgrading affected packages to version 3.2.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/python-statemachine

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/python-statemachine. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-v4jc-pm6r-3vj8 CVE-2026-47103 CRITICAL python-statemachine SCXML <data expr> Eval Injection

CVE-2026-47103 at a Glance

CVE Identifier CVE-2026-47103
GHSA Identifier GHSA-v4jc-pm6r-3vj8
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection')
Affected Product Python statemachine
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-47103

To remediate this vulnerability, upgrade all affected Python statemachine dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

python-statemachine fixed: 3.2.0
pip install python-statemachine>=3.2.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show python-statemachine

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-47103, inspect your installed packages using pip:

pip show python-statemachine

Analyze the terminal output to locate any version of Python statemachine in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.2.0), your application is affected.

Note: The pip show python-statemachine command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection'), where the product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes code syntax before using the input in a dynamic evaluation call (e.g. "eval"). In Python statemachine, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary python-statemachine 3.1.2 evaluates `<data expr="...">` attributes in SCXML documents using Python's `eval()`. Any application that passes attacker-controlled SCXML content to `SCXMLProcessor` is vulnerable to arbitrary code execution in the context of the hosting process. ### Details `SCXMLProcessor.parse_scxml_file()` processes SCXML documents and evaluates `<data>` element `expr` attributes via the following call chain: ``` SCXMLProcessor.parse_scxml_file() SCXMLProcessor.process_definition() create_datamodel_action_callable() _create_dataitem_callable() _eval() eval() ``` `_eval()` calls Python's built-in `eval()` directly on the expression string without sandboxing or restriction. ### PoC ``` 1. Install: pip install python-statemachine==3.1.2 2. Create an SCXML file containing: <data id="x" expr="__import__('pathlib').Path('marker.txt').write_text('pwned')"/> 3. Run: SCXMLProcessor.parse_scxml_file(DATA_EXPR_CHART) SCXMLProcessor.start() 4. During start(), <data expr> reaches _eval(), which calls eval(). 5. Result: data_marker_before_start: False data_marker_after_start: True success: True ``` ### Impact This is an eval injection vulnerability (CWE-95). Remote or local code execution depending on whether the consuming application accepts SCXML content from remote users, uploaded files, configuration, plugins, or other untrusted sources.

CVE-2026-47103 Affected Python statemachine Versions

1 component(s)
Fixed Versions:
3.2.0
Product / Package Ecosystem Affected Versions Fixed Version
python-statemachine
PyPI
≥ 3.0.0
< 3.2.0
3.2.0

References

Frequently Asked Questions

What is CVE-2026-47103?
CVE-2026-47103 is a security vulnerability in Python statemachine involving python-statemachine SCXML <data expr> Eval Injection under CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection').
Which Python statemachine versions are affected?
Affected versions include releases prior to 3.2.0 across affected packages: python-statemachine.
What version fixes CVE-2026-47103?
Upgrading to 3.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is python-statemachine affected?
Yes, python-statemachine is affected in releases prior to 3.2.0. Upgrade your dependency to 3.2.0 or later.
What is the CVSS score of CVE-2026-47103?
CVE-2026-47103 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-47103?
CVE-2026-47103 is classified under CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection') (The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes code syntax before using the input in a dynamic evaluation call (e.g. "eval").).
How can I check PyPI dependencies for CVE-2026-47103?
Run the dependency tree command: 'pip show python-statemachine'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-v4jc-pm6r-3vj8",
  "modified" : "2026-06-18T14:28:02Z",
  "published" : "2026-06-18T14:28:02Z",
  "aliases" : [ "CVE-2026-47103" ],
  "summary" : "python-statemachine SCXML <data expr> Eval Injection",
  "details" : "### Summary\n\npython-statemachine 3.1.2 evaluates `<data expr=\"...\">` attributes in SCXML documents using Python's `eval()`. Any application that passes attacker-controlled SCXML content to `SCXMLProcessor` is vulnerable to arbitrary code execution in the context of the hosting process.\n\n### Details\n\n`SCXMLProcessor.parse_scxml_file()` processes SCXML documents and evaluates `<data>` element `expr` attributes via the following call chain:\n\n```\nSCXMLProcessor.parse_scxml_file()\nSCXMLProcessor.process_definition()\ncreate_datamodel_action_callable()\n_create_dataitem_callable()\n_eval()\neval()\n```\n\n`_eval()` calls Python's built-in `eval()` directly on the expression string without sandboxing or restriction.\n\n### PoC\n\n```\n1. Install:\n   pip install python-statemachine==3.1.2\n\n2. Create an SCXML file containing:\n   <data id=\"x\" expr=\"__import__('pathlib').Path('marker.txt').write_text('pwned')\"/>\n\n3. Run:\n   SCXMLProcessor.parse_scxml_file(DATA_EXPR_CHART)\n   SCXMLProcessor.start()\n\n4. During start(), <data expr> reaches _eval(), which calls eval().\n\n5. Result:\n   data_marker_before_start: False\n   data_marker_after_start: True\n   success: True\n```\n\n### Impact\n\nThis is an eval injection vulnerability (CWE-95). Remote or local code execution depending on whether the consuming application accepts SCXML content from remote users, uploaded files, configuration, plugins, or other untrusted sources.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "python-statemachine"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.2.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/fgmacedo/python-statemachine/security/advisories/GHSA-v4jc-pm6r-3vj8"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-47103"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/fgmacedo/python-statemachine"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fgmacedo/python-statemachine/releases/tag/v3.2.0"
  }, {
    "type" : "WEB",
    "url" : "https://www.vulncheck.com/advisories/python-statemachine-rce-via-scxml-eval-injection"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-95" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-18T14:28:02Z",
    "nvd_published_at" : "2026-06-17T15:16:58Z"
  }
}