CVE-2026-133467 Security Alert: CRITICAL Vulnerability
Urgent: CVE-2026-133467 requires immediate attention.
· 6 min read
Executive Summary
CVE-2026-133467 is a critical remote code execution flaw in CodeSafe, an open-source Python library used for code encryption, decryption, and “safe” evaluation via Python’s AST module. Versions 0.0.1 through 0.0.4 are vulnerable. An attacker who can control the expression passed into safe_eval() can bypass the AST checks using indirect subscript-based calls such as builtins['exec'], leading to arbitrary Python code execution with the permissions of the host application.
This is especially dangerous for solo developers and small teams because the vulnerable pattern is often used in API endpoints, admin tools, plugins, and internal automation where user input is assumed to be constrained. The issue is fixed in CodeSafe 0.0.5.
Immediate Action
- Upgrade immediately to
codesafe==0.0.5or later. If you cannot patch right away, disable any feature that passes user-controlled expressions intosafe_eval(). - Rollback or isolate exposed services if you cannot confirm the input path is trusted. Put the service behind auth, restrict network access, or take it offline until patched.
- Search your codebase for
safe_evalusage and any custom wrappers around AST validation. Treat all externally supplied expressions as hostile. - Rotate secrets if the vulnerable function was reachable from a public or semi-public interface. Assume environment variables, API keys, and tokens may have been exposed.
- Review logs for suspicious expression payloads, unexpected subprocess activity, file access, or outbound connections from the application host.
- Check vendor/project guidance if available: Vendor advisory / release notes.
Affected Versions
codesafe>=0.0.1andcodesafe<=0.0.4vulnerablecodesafe==0.0.5fixedcodesafe>=0.0.5safe, assuming no downstream fork reintroduced the bug
Resolution Guide
Python / pip
python -m pip install --upgrade codesafe==0.0.5
python -m pip show codesafe
python -m pip freeze | grep -i codesafe
Python / pipx
pipx upgrade codesafe
pipx list
JavaScript package managers (only if CodeSafe is vendored or wrapped in a JS build pipeline)
npm i codesafe@0.0.5
yarn add codesafe@0.0.5
pnpm add codesafe@0.0.5
Java / Maven / Gradle (for transitive or bundled usage in mixed stacks)
mvn dependency:tree | grep -i codesafe
./gradlew dependencies | grep -i codesafe
Linux package managers (if your distro packages the library)
apt-cache policy python3-codesafe
yum info codesafe
dnf info codesafe
Docker
docker pull your-registry/your-app:TODO_SAFE_TAG
docker run --rm your-registry/your-app:TODO_SAFE_TAG python -c "import codesafe; print(codesafe.__version__)"
Hardening options
# Example: disable expression evaluation until patched
SAFE_EVAL_ENABLED=false
# Example: require a strict allowlist of non-user-controlled expressions
ALLOWED_EXPRESSIONS_ONLY=true
Minimal code fix pattern — reject any expression source that is not fully trusted, and do not rely on AST checks alone:
def safe_eval_disabled(expr):
raise RuntimeError("safe_eval is disabled until CodeSafe 0.0.5 is deployed")
# Temporary mitigation: route all callers here
safe_eval = safe_eval_disabled
Detection & Verification
Check installed version
python -c "import codesafe; print(codesafe.__version__)"
Find vulnerable usage
grep -RIn "safe_eval(" .
grep -RIn "codesafe" .
grep -RIn "ast\.parse\|eval(" .
Dependency audit
python -m pip audit
python -m pip show codesafe
Verify the fix
python -m pip install --upgrade codesafe==0.0.5
python -c "import codesafe; print(codesafe.__version__)"
python -m pip freeze | grep -i '^codesafe==0.0.5$'
Behavioral test — confirm that hostile expressions are rejected, not executed. If your app exposes an evaluation endpoint, submit a harmless probe that previously would have been accepted and verify it now fails closed. Ensure logs show a denial, not execution.
Risk and Impact
If exploited, this flaw can give an attacker full code execution inside your Python process. That can mean reading source code, stealing credentials, modifying data, spawning shells, or pivoting into internal services reachable from the host. For small teams, the blast radius is often the entire application server, CI runner, or container cluster if the service runs with broad permissions.
Because the bug is triggered by attacker-controlled input to safe_eval(), any public API, webhook, plugin, or admin feature that evaluates expressions should be treated as high risk until patched and verified.