π‘οΈ Sentinel: [security improvement]#110
Conversation
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. |
There was a problem hiding this comment.
Pull request overview
This PR updates Wardlineβs taint propagation to treat additional deserialization/representation-boundary functions as _SERIALISATION_SINKS, ensuring their outputs are conservatively modeled as UNKNOWN_RAW to avoid false negatives when validated inputs flow into these loaders.
Changes:
- Added several third-party and stdlib deserialization entry points (
shelve.open,dill.load(s),jsonpickle.decode,joblib.load,torch.load,numpy.load) to_SERIALISATION_SINKS. - Updated the
PY-WL-106ruleβs clean example to stay clean under the stricter taint propagation. - Documented the incident and learning in
.jules/sentinel.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/wardline/scanner/taint/variable_level.py | Extends the core taint βrepresentation boundaryβ sink set so these calls return UNKNOWN_RAW. |
| src/wardline/scanner/rules/untrusted_to_deserialization.py | Adjusts a clean example snippet to remain defect-free with updated taint behavior. |
| .jules/sentinel.md | Records the vulnerability/learning/prevention note for the added sinks. |
π‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ## 2025-10-09 - [Add Missing Deserialization Sinks to Core Taint Propagation] | ||
| **Vulnerability:** The static analyzer was missing `shelve.open`, `dill.load`, `dill.loads`, `jsonpickle.decode`, `joblib.load`, `torch.load`, and `numpy.load` in its `_SERIALISATION_SINKS` mapping, potentially leading to false negatives when tracking untrusted data flowing into these dangerous deserialization functions. |
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 19b6d6f2e7
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "torch.load", | ||
| "numpy.load", |
There was a problem hiding this comment.
Preserve safe load gates during taint propagation
Adding torch.load and numpy.load to this ungated serialization set makes _resolve_call return UNKNOWN_RAW for every call before the deserialization rule's gates can matter. In code that uses the documented safe forms (numpy.load(path)/allow_pickle=False or torch.load(..., weights_only=True)) and then returns or forwards the loaded value from a trusted function, this now triggers downstream taint defects such as PY-WL-101 even though UntrustedToDeserialization._accept_call explicitly suppresses those same calls as non-sinks at lines 153-155. These two entries need the same keyword gating in the propagation path rather than being treated as unconditional representation-boundary sinks.
Useful? React with πΒ / π.
π¨ Severity: HIGH
π‘ Vulnerability: Missing deserialization functions in taint propagation
_SERIALISATION_SINKS, meaningUNKNOWN_RAWwouldn't correctly replace validated inputs for these sinks.π― Impact: Could result in false negatives where malicious inputs bypass detection in these serialization functions.
π§ Fix: Added
shelve.open,dill.load,dill.loads,jsonpickle.decode,joblib.load,torch.load, andnumpy.loadto_SERIALISATION_SINKSinsrc/wardline/scanner/taint/variable_level.py. Updated a rule clean example, regenerated golden corpus, and confirmed tests pass.β Verification:
make test,make lint, andmake typecheckall successfully pass.PR created automatically by Jules for task 12971695048007482136 started by @tachyon-beep