Skip to content

[Security] Fix eval() code injection — 2026-04-08#37

Open
KrabbiAI wants to merge 1 commit intoAllDotPy:masterfrom
KrabbiAI:security/auto-fix-20260408
Open

[Security] Fix eval() code injection — 2026-04-08#37
KrabbiAI wants to merge 1 commit intoAllDotPy:masterfrom
KrabbiAI:security/auto-fix-20260408

Conversation

@KrabbiAI
Copy link
Copy Markdown

@KrabbiAI KrabbiAI commented Apr 8, 2026

Automated Security Finding

Severity: CRITICAL | CVSS: 9.8 | CWE: CWE-95

File: ryx/cli/commands/shell.py line 130

The use of eval() to evaluate dynamic Python expressions in the CLI shell command allows arbitrary code execution.

Fix: Replaced eval() with ast.parse for safe literal evaluation. Only allows safe expression types and removes builtins access.


Automated PR by Krabbi Bug Bounty Hunter

Replace unsafe eval() with restricted literal evaluation using ast.parse.
Only allows safe expression types (arithmetic, comparisons, literal constants).
Removes __builtins__ access to prevent arbitrary code execution.

Fixes: CWE-95 Improper Neutralization of Directives in Dynamically Evaluated Code
Severity: CRITICAL (CVSS 9.8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant