Summary
CodeSafe, a Python library by Infinitode, allows safe_eval() validation to be bypassed and arbitrary Python code to be executed. It affects versions from 0.0.1 up to but not including 0.0.5, with a CVSS 3.1 score of 9.8 (critical).
What happened
The safe_eval() function in CodeSafe, an open-source library for code encryption, decryption, and safe evaluation using Python's AST module, can be bypassed with indirect subscript calls such as builtins['exec']. AST validation blocks only direct calls to dangerous built-ins. An attacker who controls the expression passed to safe_eval() can execute arbitrary Python code with the permissions of the host application. Identifier: CVE-2026-133467. Associated weaknesses: CWE-95 and CWE-693.
Why it matters
The CVSS 3.1 score is 9.8 (critical), with vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H, assigned by CNA:GitHub_M. Applications that pass third-party-controlled expressions to safe_eval() may allow code execution with their own permissions. CISA's KEV catalog does not list active exploitation, and the source does not state any other evidence of exploitation.
Affected products and versions
CodeSafe, by Infinitode: versions >= 0.0.1, < 0.0.5 (0.0.1 through 0.0.4).
| Product | Versions | Fixed in |
|---|---|---|
| Infinitode CodeSafe | >= 0.0.1, < 0.0.5 | — |
Action recommended by the source
The vendor states the issue is fixed in version 0.0.5. References: vendor advisory at https://github.com/Infinitode/CodeSafe/security/advisories/GHSA-7gp8-3j6q-v4h8 and fix commit at https://github.com/Infinitode/CodeSafe/commit/27f19e220432c9d83f1c463f382d2807b31fe6fd. The source does not state other mitigations.
Sources and references
- https://github.com/Infinitode/CodeSafe/security/advisories/GHSA-7gp8-3j6q-v4h8 — CVE Program
- https://github.com/Infinitode/CodeSafe/commit/27f19e220432c9d83f1c463f382d2807b31fe6fd#diff-5e1c6bb51538bc170a88f3fb84b50c7df79ad57a1780a2a5b67450503e96c173 — CVE Program
Weaknesses (CWE): CWE-95, CWE-693
Relevant change history
Advisory correction
The preliminary version was replaced by the full write-up.
Published
Preliminary advisory published.