Skip to content

πŸ›‘οΈ Sentinel: [CRITICAL] Fix command injection in autograd#154

Open
docxology wants to merge 5 commits intomainfrom
sentinel-fix-autograd-rce-9394786231584366663
Open

πŸ›‘οΈ Sentinel: [CRITICAL] Fix command injection in autograd#154
docxology wants to merge 5 commits intomainfrom
sentinel-fix-autograd-rce-9394786231584366663

Conversation

@docxology
Copy link
Copy Markdown
Owner

🚨 Severity: CRITICAL
πŸ’‘ Vulnerability: Arbitrary Code Execution (ACE) / Command Injection via Python's built-in eval() function in the autograd_compute MCP tool in src/codomyrmex/autograd/mcp_tools.py. The expression parameter was unsanitized.
🎯 Impact: Allowed AI agents or downstream callers to submit arbitrary Python code strings disguised as math expressions, executing arbitrary instructions with the privileges of the host process.
πŸ”§ Fix: Removed the eval(code, namespace) call and implemented a robust, explicit _safe_eval function based on ast.parse that restricts evaluation to allowed binary/unary mathematical operations and numeric constants.
βœ… Verification: Verified via uv run pytest src/codomyrmex/tests/unit/autograd/ and uv run ruff check. Evaluator correctly parses negative exponents cleanly and restricts execution to safe operations.


PR created automatically by Jules for task 9394786231584366663 started by @docxology

Co-authored-by: docxology <6911384+docxology@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

πŸ‘‹ Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a πŸ‘€ emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions
Copy link
Copy Markdown

πŸ€– Hi @docxology, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

@github-actions
Copy link
Copy Markdown

πŸ€– I'm sorry @docxology, but I was unable to process your request. Please see the logs for more details.

google-labs-jules bot and others added 4 commits March 10, 2026 01:39
Co-authored-by: docxology <6911384+docxology@users.noreply.github.com>
Co-authored-by: docxology <6911384+docxology@users.noreply.github.com>
Co-authored-by: docxology <6911384+docxology@users.noreply.github.com>
Co-authored-by: docxology <6911384+docxology@users.noreply.github.com>
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