Skip to content

🛡️ Sentinel: [MEDIUM] Add missing deserialization sinks to _SERIALISATION_SINKS#102

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

🛡️ Sentinel: [MEDIUM] Add missing deserialization sinks to _SERIALISATION_SINKS#102
tachyon-beep wants to merge 1 commit into
mainfrom
sentinel/add-deserialization-sinks-7465837750491915562

Conversation

@tachyon-beep

Copy link
Copy Markdown
Collaborator

🚨 Severity: MEDIUM
💡 Vulnerability: Several deserialization sinks (like dill.load, shelve.open, torch.load, etc.) recently added to the PY-WL-106 rule specifications in _SINK_SPECS were missing from the core taint propagation logic _SERIALISATION_SINKS. This causes the analyzer to incorrectly retain validation provenance for these functions, leading to false negatives (the analyzer doesn't know their output should become UNKNOWN_RAW).
🎯 Impact: If dill.load or other similar sinks returned data that was later used in another dangerous sink, the analyzer might consider it safe, creating blind spots for potential downstream injections or RCEs.
🔧 Fix: Added dill.load, dill.loads, jsonpickle.decode, joblib.load, torch.load, shelve.open, and pickle.Unpickler.load to _SERIALISATION_SINKS. We explicitly excluded numpy.load from this list because it is safe by default (requires allow_pickle=True to unpickle objects) and adding it unconditionally to _SERIALISATION_SINKS creates false positives (e.g. failing the PY-WL-101 clean test cases).
Verification: Verified by ensuring the make test, make lint, and make typecheck all complete successfully with the missing sinks correctly shedding provenance.


PR created automatically by Jules for task 7465837750491915562 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 10, 2026 16:54
@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 level-2 taint propagation so that additional deserialization APIs are treated as representation-boundary sinks whose results should shed validation provenance (i.e., become UNKNOWN_RAW). This aligns the core propagation behavior with the PY-WL-106 rule’s sink specs and reduces false negatives where deserialized outputs could be incorrectly considered safe downstream.

Changes:

  • Added several missing deserialization function FQNs to _SERIALISATION_SINKS so their return values become UNKNOWN_RAW.
  • Recorded the security learning/update in .jules/sentinel.md for traceability.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/wardline/scanner/taint/variable_level.py Extends _SERIALISATION_SINKS with additional deserialization sinks to ensure provenance is shed on return values.
.jules/sentinel.md Documents the incident/learning entry related to the added sinks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +45 to +46
"dill.load",
"dill.loads",
Comment thread .jules/sentinel.md
Comment on lines +12 to +13
**Vulnerability:** The static analyzer was missing several unsafe deserialization functions (`dill.load`, `jsonpickle.decode`, `torch.load`, `shelve.open`, `joblib.load`, `pickle.Unpickler.load`) in its `_SERIALISATION_SINKS` mapping.
**Learning:** Functions that are conditionally safe like `numpy.load` (safe without `allow_pickle=True`) shouldn't be added to universal static block lists without context if it would create false positives, but functions that represent deserialization flows still need inclusion to shed provenance.
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