Skip to main content

CodeSafe CVE-2026-133467

| EUVDEUVD-2026-135750 CRITICAL
Eval Injection (CWE-95)
2026-11-25 GitHub_M
9.8
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Identify app passing untrusted input to safe_eval
  2. Delivery
    Craft indirect subscript payload __builtins__['exec'](...)
  3. Exploit
    Bypass AST name-check validation
  4. Execution
    Execute arbitrary Python in host process
  5. Impact
    Full code execution at app privileges

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Eval input sanitization
MITRE ATT&CK

1 technique across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that the host application call CodeSafe's safe_eval() on an expression the attacker can control - this is the specific, required precondition. The flaw is that AST validation in versions 0.0.1-0.0.4 blocks only direct calls to dangerous built-ins by name, while indirect subscript lookups (e.g., __builtins__['exec'](...)) are not inspected, so an attacker-supplied expression reaching safe_eval() escapes the sandbox. Limiting factors: the vulnerability is only reachable where untrusted input is actually routed into safe_eval(); applications that pass only trusted developer-authored expressions are not exposed. The advisory states no complete workaround exists for the affected versions when processing untrusted input - upgrading to 0.0.5 (which enforces target inspection on indirect calls and strips dangerous built-ins like exec, eval, compile, and __import__ from the default context) is the only complete fix.

Impact

All severity signals align toward high priority, but real-world exposure is entirely conditional on how the library is used. The CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H = 9.8) reflects that safe_eval() is purpose-built to accept attacker-influenced expressions, so when an application exposes it to untrusted input there is no authentication, no user interaction, and low complexity to achieve full arbitrary code execution (CWE-95 code injection). The vuln.today Decision label is act_now, and the GHSA advisory confirms the mechanism and RCE impact, reinforcing urgency. No EPSS score and no CISA KEV entry are provided in the input, so there is no evidence of active exploitation or a quantified exploitation-probability - the high rating rests on mechanism severity, not observed in-the-wild activity. The critical caveat is deployment-dependency: the CVSS AV:N assumes the host application feeds remote/untrusted input into safe_eval(), which is the library's advertised use case but is not universal; an application that only passes trusted, developer-authored expressions is not meaningfully exposed. Net: a genuine high-priority issue for anyone using CodeSafe 0.0.1-0.0.4 to sandbox untrusted expressions, tempered by the obscurity and small footprint of the product rather than by any weakness in the technical signal.

Exploit ScenarioDerived

An application uses CodeSafe's safe_eval() to evaluate user-supplied expressions (e.g., a calculator endpoint, a rules engine, or a formula field). The attacker submits an expression using indirect subscript lookup such as __builtins__['exec']('...') which bypasses the AST name-based validation that only blocked direct calls, executing arbitrary Python with the host application's privileges. The exact bypass payload is publicly documented in the GHSA advisory, lowering the effort to reproduce; given AV:N/AC:L/PR:N/UI:N, a single crafted request suffices where untrusted input reaches safe_eval().

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Nov 25, 2026

Arbitrary Python code execution in CodeSafe 0.0.1 through 0.0.4 is reachable through safe_eval() when an attacker can control the expression being evaluated, because the AST-based guard only blocks direct calls to dangerous built-ins and misses indirect subscript lookups such as __builtins__['exec'](...). The bypass requires no authentication or user interaction (CVSS 3.1 AV:N/AC:L/PR:N/UI:N, 9.8) and yields code execution with the permissions of the host application, but it is only reachable where untrusted input is actually routed into safe_eval(); applications that evaluate only developer-authored expressions are not exposed. No confirmed public exploit code has been identified at time of analysis, and the vulnerability is not listed as actively exploited, though the fixed 0.0.5 release ships a regression suite (test_poc.py) that documents the bypass patterns.

RemediationAI

Vendor-released patch: CodeSafe 0.0.5. Upgrade with 'pip install --upgrade codesafe' to 0.0.5 or later; the release enforces whitelisted call targets so indirect ast.Subscript and ast.Attribute calls are rejected, and it strips exec, eval, compile and __import__ from the default evaluation built-ins. The vendor states that no complete workaround exists for versions 0.0.1 through 0.0.4 when processing untrusted input, so upgrading is the only complete fix - patching the AST check locally or monkey-patching the built-ins namespace is not endorsed and leaves the deny-list weakness in place. Because exploitation is conditional on an attacker-controlled expression reaching safe_eval(), reduce the attack surface in the meantime by auditing call sites and ensuring only trusted, developer-authored expressions are passed in; note that this is a scoping measure for deployments that already avoid untrusted expressions, not a substitute for the upgrade. See the advisory at https://github.com/Infinitode/CodeSafe/security/advisories/GHSA-7gp8-3j6q-v4h8 and the fix commit 27f19e220432c9d83f1c463f382d2807b31fe6fd.

Affected VersionsENISA

CodeSafe 0.0.1, < 0.0.5

Affected Packages

euvd codesafe fix: 0.0.5

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

CodeSafe is an open-source Python library for code encryption, decryption and 'safe' expression evaluation built on Python's ast module. The safe_eval() design walks the parsed AST and rejects dangerous constructs before compiling, but in versions 0.0.1 through 0.0.4 the name check only inspects direct ast.Call targets that are ast.Name nodes - so a call whose target is an ast.Subscript (for example __builtins__['exec'](...)) or another indirect target is never validated. This is CWE-95 (improper neutralization of directives in dynamically evaluated code, i.e. eval injection) compounded by CWE-693 (protection mechanism failure): the sandbox is a deny-list of names rather than an allow-list of call targets, and the default evaluation context still contained the real __builtins__ mapping, so an attacker could fetch exec, eval, compile or __import__ by subscript and execute arbitrary Python in the host process. Because the vulnerable path is a library function called by the application, there is no network-facing protocol of its own; the AV:N/C:H/I:H metrics describe the consequence of a reachable injection point rather than an intrinsic remote service. The 0.0.5 fix rejects every ast.Call whose exact target is not explicitly whitelisted (covering subscript, attribute and other indirect targets) and replaces the built-in namespace with a minimal allow-list that excludes exec, eval, compile and __import__.

Know when Codesafe gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 9.8 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
vuln.today AI 9.8 CRITICAL

safe_eval() is designed to accept untrusted expressions remotely with no auth or interaction, and the bypass yields full arbitrary code execution, so PR:N/UI:N/AC:L and C:H/I:H/A:H.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

2
Patch available
Nov 25, 2026 - 21:03 EUVD
CVE Published
Nov 25, 2026 - 19:21 cve.org
CRITICAL 9.8

DescriptionCVE.org

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 safe_eval() 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 safe_eval() can execute arbitrary Python code with the permissions of the host application. This issue is fixed in version 0.0.5.

Technical POC Analysis

The bug is CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code, with a secondary CWE-693 protection-mechanism failure.

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

The CodeSafe Python library (versions 0.0.1-0.0.4) contains a critical vulnerability that allows unauthenticated attackers to execute arbitrary Python code when untrusted input is evaluated. Organizations using CodeSafe to evaluate user-supplied expressions are exposed to full application compromise with severe consequences, including data breach, system takeover, and reputational harm.

Business Impact: Severe
Compensating Controls

No vendor-released patch identified at time of analysis; interim mitigations include avoiding passing untrusted input to safe_eval, using strict allowlists for expressions, or disabling the feature until version 0.0.5 can be deployed.

Threat Intelligence Overview

EPSS Score
0.4%
Top 72% exploitable
Prevalence
Rare
obscure open-source PyPI library, tiny real-world deployment footprint
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
Very High

Priority Score

49
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +49
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy