🛡️ Sentinel: [CRITICAL] Fix parameter default expression taint leakage#121
🛡️ Sentinel: [CRITICAL] Fix parameter default expression taint leakage#121tachyon-beep wants to merge 1 commit into
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. |
|
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 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.INTEGRALrather than inheritingfunction_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.
|
|
||
| ## 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. |
🚨 Severity: CRITICAL
💡 Vulnerability: Parameter default expressions (e.g.,
def fn(x=untrusted())) were evaluated using thefunction_taintinstead of a neutral base state. For@trusted(level="ASSURED")functions, this seeded the untrusted argument asASSURED, allowing untrusted data to leak without triggeringPY-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_parametersinvariable_level.pyto evaluate default parameter expressions usingTaintState.INTEGRALrather than inheriting thefunction_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