π‘οΈ Sentinel: [CRITICAL] Fix command injection in autograd#154
π‘οΈ Sentinel: [CRITICAL] Fix command injection in autograd#154
Conversation
Co-authored-by: docxology <6911384+docxology@users.noreply.github.com>
|
π 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
π€ 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. |
|
π€ I'm sorry @docxology, but I was unable to process your request. Please see the logs for more details. |
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>
π¨ Severity: CRITICAL
π‘ Vulnerability: Arbitrary Code Execution (ACE) / Command Injection via Python's built-in
eval()function in theautograd_computeMCP tool insrc/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_evalfunction based onast.parsethat restricts evaluation to allowed binary/unary mathematical operations and numeric constants.β Verification: Verified via
uv run pytest src/codomyrmex/tests/unit/autograd/anduv 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