Skip to content
DayZeroHub
Critical CVSS 9.8CVE-2026-133467

CodeSafe: safe_eval() Sandbox Escape via Indirect Subscript Calls

Infinitode CodeSafe

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

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

Information taken from the source or the vendor. Verify it at the original link before acting.

Sources and references

Weaknesses (CWE): CWE-95, CWE-693

Relevant change history

  1. Advisory correction

    The preliminary version was replaced by the full write-up.

  2. Published

    Preliminary advisory published.

Summary written with AI assistance from the source data. See the sources and references for complete information. View sources