CVE-2026-133467: CodeSafe: safe_eval Sandbox Escape via Indirect Subscript Call
CodeSafe is an open-source Python library for code encryption, decryption, and safe evaluation using Python's AST module. From versions 0.0.1 through 0.0.4, the safeeval() function can be bypassed with indirect subscript calls such as builtins'exec', because AST validation blocks only direct calls to dangerous built-ins. An attacker who controls an expression passed to safeeval() can execute arbitrary Python code with the permissions of the host application. This issue is fixed in version 0.0.5.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
CodeSafeto a version that resolves this vulnerability.Fixed in 0.0.5
Event History
Frequently Asked Questions
Who is exposed to this vulnerability?
Applications using CodeSafe versions 0.0.1 through 0.0.4 are exposed if they pass attacker-controlled expressions to safe_eval(). The attacker can execute Python code with the permissions of the host application.
Does exploitation require authentication or user interaction?
No. The supplied severity vector indicates network-reachable exploitation with low attack complexity, no privileges required, and no user interaction.
What should be done to remediate the issue?
Upgrade CodeSafe to version 0.0.5, which fixes the safe_eval() bypass.
How can I determine whether my application is affected?
Check whether it uses CodeSafe 0.0.1 through 0.0.4 and whether untrusted input can reach safe_eval(). The vulnerable validation can be bypassed through indirect subscript calls to dangerous built-ins, such as builtins' exec'.