🛡️ Sentinel: [HIGH] Fix missing deserialization sinks in taint tracking - #135
🛡️ Sentinel: [HIGH] Fix missing deserialization sinks in taint tracking#135tachyon-beep wants to merge 1 commit into
Conversation
This commit adds missing third-party deserialization functions (`shelve.open`, `dill.load`, `dill.loads`, `jsonpickle.decode`, `joblib.load`, `torch.load`, and `numpy.load`) to the core `_SERIALISATION_SINKS` set. This ensures the static analyzer properly sheds validation provenance when untrusted data passes through these functions, preventing false negatives. Also includes a fix for a rule test that was failing due to this behavior change. Co-authored-by: tachyon-beep <544926+tachyon-beep@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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
This PR updates Wardline’s taint propagation engine to recognize additional third‑party deserialization entry points as serialization/deserialization “boundary” calls, ensuring outputs are conservatively treated as UNKNOWN_RAW to avoid false negatives in downstream taint-based findings.
Changes:
- Extend the core
_SERIALISATION_SINKSset to include third‑party deserialization APIs (e.g.,dill.load(s),jsonpickle.decode,joblib.load,torch.load,numpy.load,shelve.open). - Adjust the
PY-WL-106rule’s clean metadata example to avoid returning the (now boundary-tainted) result ofnumpy.load. - Append a Sentinel journal entry documenting the finding and mitigation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/wardline/scanner/taint/variable_level.py | Adds third‑party deserialization functions to the taint engine’s serialization-sink boundary set so return values shed provenance to UNKNOWN_RAW. |
| src/wardline/scanner/rules/untrusted_to_deserialization.py | Updates the rule metadata clean example to avoid returning a value that is now boundary-tainted by core propagation logic. |
| .jules/sentinel.md | Documents the vulnerability, learning, and prevention guidance for future sink additions. |
đź’ˇ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
🚨 Severity: HIGH
đź’ˇ Vulnerability: The static analyzer's taint tracking was missing third-party deserialization functions in its core
_SERIALISATION_SINKSmapping. This meant untrusted data flowing into these dangerous functions might not properly shed validation provenance (resulting in false negatives in the tool).🎯 Impact: False negatives in the static analysis tool where developers using third-party deserialization sinks wouldn't be alerted to untrusted data flows, leading to potential Remote Code Execution (RCE) vectors.
đź”§ Fix: Added the missing third-party deserialization sinks to the
_SERIALISATION_SINKSfrozenset. Also modified a clean test example fornumpy.loadinuntrusted_to_deserialization.pyto prevent false positive test failures since its output is now correctly tracked asUNKNOWN_RAW.âś… Verification: Verified by running the full test suite (
make test), static type checker (make typecheck), and linters (make format). Appended the journal entry to.jules/sentinel.mddocumenting this finding.PR created automatically by Jules for task 11015560082743165297 started by @tachyon-beep