Skip to content

πŸ›‘οΈ Sentinel: [security improvement]#110

Open
tachyon-beep wants to merge 1 commit into
mainfrom
sentinel-add-deserialization-sinks-12971695048007482136
Open

πŸ›‘οΈ Sentinel: [security improvement]#110
tachyon-beep wants to merge 1 commit into
mainfrom
sentinel-add-deserialization-sinks-12971695048007482136

Conversation

@tachyon-beep

Copy link
Copy Markdown
Collaborator

🚨 Severity: HIGH
πŸ’‘ Vulnerability: Missing deserialization functions in taint propagation _SERIALISATION_SINKS, meaning UNKNOWN_RAW wouldn'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, and numpy.load to _SERIALISATION_SINKS in src/wardline/scanner/taint/variable_level.py. Updated a rule clean example, regenerated golden corpus, and confirmed tests pass.
βœ… Verification: make test, make lint, and make typecheck all successfully pass.


PR created automatically by Jules for task 12971695048007482136 started by @tachyon-beep

Co-authored-by: tachyon-beep <544926+tachyon-beep@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 14, 2026 16:56
@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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-106 rule’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.

Comment thread .jules/sentinel.md
Comment on lines +11 to +12
## 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ’‘ 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".

Comment on lines +75 to +76
"torch.load",
"numpy.load",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 πŸ‘Β / πŸ‘Ž.

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.

2 participants