← Back to Pull requests

fix(analyzer): stop E4 matching session tokens and split words #1237

Closed
unknown closed this pull request without merging on Nov 29, 2026 10:35 UTC
View on GitHub
unknown unknown commented on Nov 29, 2026 06:50 UTC
Author

Fixes #1236.

Two E4 (Context Leakage, HIGH) patterns in static_patterns_data_exfiltration.py matched text that is not conversation context:

  • The send/transmit/upload/log/record pattern made history|context|log optional, so session on its own matched: "send the session token", "upload the session cookie", "record the session ID". It also had no leading \b, so status.log followed by a session entry in a directory tree matched as log\n session, and "backlog chat" matched as log chat.

  • The session/memory/state transfer pattern had no \b after to, so "send the session token" matched as send the session to.
  • Change

  • session now needs history, context or log after it. The noun stays optional after conversation, chat and dialog, which only ever mean a conversation.

  • Both patterns get the missing word boundaries.
  • "send the session to https://...", "transmit the session data to ...", "upload the session log to ..." and "send the full conversation to ..." are still reported.

    Testing

  • New tests in tests/nodes/analyzers/test_static_patterns.py: five false positives from the issue (all fail on main) and six real leaks that must still be detected.

  • ruff check and ruff format --check on both files pass.

  • pytest -m "not integration and not provider" tests/: the branch passes the 11 new tests and has the same set of failing tests as main on my machine (Windows; 568 failures and errors that also fail without this change, none in the data-exfiltration analyzer).

  • Rescanned the two installed skills where I first saw this (a bootstrap script that refuses to send a session token over plain HTTP, and a skill whose docs show a status.log / session directory tree). Both now have no E4 findings.
  • AI assistance was used to find and write this. I reproduced the false positives and checked the fix and test results myself.

    Diff: 237 lines (+177 / -60) across 2 files Reviewer: rng1995 Review duration: 225m
    All Vouch review confidence checks passed
    Residual risk 0.25 = Change Risk (0.60) × (1 − Review Confidence (0.58)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.60 · 237 lines diff across 2 files
    0.60
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    57%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.327
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.060
    Real PR Conversation Timeline
    1 comments
    "Review active on #1237"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 58.0% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 60.4% (MEDIUM) · Higher = larger blast radius
    60.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 58.0% · Lower = rushed or shallow review
    58.0%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 25.4% · Safe to merge
    25.4%