Skip to content

🛡️ Sentinel: [CRITICAL] Fix parameter default expression taint leakage#121

Open
tachyon-beep wants to merge 1 commit into
mainfrom
sentinel/fix-param-default-taint-8917005708061533068
Open

🛡️ Sentinel: [CRITICAL] Fix parameter default expression taint leakage#121
tachyon-beep wants to merge 1 commit into
mainfrom
sentinel/fix-param-default-taint-8917005708061533068

Conversation

@tachyon-beep

Copy link
Copy Markdown
Collaborator

🚨 Severity: CRITICAL
💡 Vulnerability: Parameter default expressions (e.g., def fn(x=untrusted())) were evaluated using the function_taint instead of a neutral base state. For @trusted(level="ASSURED") functions, this seeded the untrusted argument as ASSURED, allowing untrusted data to leak without triggering PY-WL-101.
🎯 Impact: Untrusted data injected via parameter defaults in trusted functions could bypass static analysis and execute malicious payloads or access protected resources, defeating the analyzer's security guarantees.
🔧 Fix: Modifies _seed_parameters in variable_level.py to evaluate default parameter expressions using TaintState.INTEGRAL rather than inheriting the function_taint.
✅ Verification: Regenerated golden identity tests and confirmed all tests, type checks, and linting pass successfully.


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

Co-authored-by: tachyon-beep <544926+tachyon-beep@users.noreply.github.com>
@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 review requested due to automatic review settings July 21, 2026 16:48
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

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 addresses a critical taint-tracking vulnerability where parameter default expressions were being resolved using the ambient function_taint (e.g., ASSURED under @trusted), allowing untrusted data introduced via defaults to be incorrectly treated as trusted and bypass PY-WL-101.

Changes:

  • Resolve positional and keyword-only parameter default expressions using TaintState.INTEGRAL rather than inheriting function_taint (including in lambda call-site seeding logic).
  • Update golden identity corpus metadata to reflect the new taint-resolution behavior.
  • Document the incident and prevention guidance 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 Changes default-argument taint evaluation to use a neutral baseline (INTEGRAL) to prevent trusted-context taint laundering.
tests/golden/identity/corpus/META.json Updates golden corpus metadata reason string to match the new behavior.
.jules/sentinel.md Adds a Sentinel entry describing the vulnerability and the intended prevention pattern.

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

Comment thread .jules/sentinel.md

## 2026-06-28 - Parameter Default Expression Taint Resolution Leak
**Vulnerability:** Untrusted data could leak into `@trusted` functions without triggering `PY-WL-101` because parameter default value expressions were defaulting to the `function_taint` (which is `ASSURED` for trusted functions), masking their true taint in L2 analysis.
**Learning:** Default parameter expressions are evaluated at runtime in the caller's scope when an argument is omitted, not as part of the function body itself. Inheriting the `function_taint` for defaults creates a blind spot where `EXTERNAL_RAW` expressions inside parameter defaults bypass taint checks.
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