🛡️ Sentinel: [CRITICAL] Fix YAML injection in yaml_safe - #69
Conversation
- Update yaml_safe to explicitly escape backslashes, double quotes, newlines, and carriage returns in that order to prevent structural YAML injection. - Add security test to tests/test_escriba.py. - Update Sentinel journal with vulnerability learnings. Co-authored-by: Jandir <3695656+Jandir@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. |
🚨 Severity: CRITICAL
💡 Vulnerability: YAML Injection via unescaped characters in PEP-750
yaml_safetag function. Attackers could break out of double-quoted contexts and manipulate YAML structure by injecting backslashes, newlines, or carriage returns.🎯 Impact: Attackers could inject arbitrary keys or corrupt the generated metadata header, potentially leading to downstream parsing failures or data corruption.
🔧 Fix: Updated
escriba.py:yaml_safeto explicitly escape\,",\n, and\r(in that order).✅ Verification:
test_yaml_safe_injection_preventionadded totests/test_escriba.pyand the fix was manually verified via a scratchpad script. The full test suite has been run to ensure no regressions.PR created automatically by Jules for task 7854859371893512479 started by @Jandir