fix(findings): 500-as-no-auth-gate + sink CWE mislabel (2 precision fixes)#2
Merged
Merged
Conversation
…k CWE mislabel Follow-up to PR #1 (audit items deliberately deferred from the first batch). 1. dynamic.write_auth_enforcement treated HTTP 500 as "no-auth-gate (reached handler/validation)". A 500 is ambiguous — it can be the AUTH layer itself throwing, not the handler running unauthenticated — so it must NOT escalate to a HIGH missing-auth finding, and (worse) it was being recorded by calibration.samples_from_dynamic as a CONFIRMED-real missing-auth sample, poisoning the self-improving oracle. 500 now falls to the inconclusive `http-500` verdict, matching the forged-token engine which already excludes 500 from "reached handler". 2. Attack-surface sinks cited the wrong CWE. surface.py emits the key `sql-injection` but STANDARDS keys it `sqli`, so SQLi sinks fell back to attack_class `sast` (CWE-710 generic) instead of `sqli` (CWE-89). Added a `_SINK_ATTACK` alias (sql-injection -> sqli) and STANDARDS + REMEDIATION entries for nosql-injection (CWE-943), redos (CWE-1333), and eval-injection (CWE-95) so every sink class cites its specific CWE with a concrete fix. Tests: 500-inconclusive (+ oracle records nothing) with a 400-still-no-auth-gate regression guard; sink classes map to their specific CWE + a non-default remediation. 88 -> 91 tests, all green; end-to-end pipeline verified. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
raccioly
added a commit
that referenced
this pull request
Jun 10, 2026
…ative) that 0.4.0 missed 0.4.0 was tagged from a STALE local main and published to PyPI WITHOUT the two fixes already merged to origin/main (#1, #2) — most importantly #1's CRITICAL fix where a repo living under a skip-named ANCESTOR dir had every route + finding silently dropped (the tool reported a vulnerable app as clean). This rebases the 0.4.0 retest work onto #1 + #2 and ships the complete set to PyPI. - #1: skip-dir matched relative to the scan root (no silent empty-scan), full ranked static set into the ledger, walk-truncation disclosure, webhook-forgery -> ledger; +8 regressions. - #2: HTTP 500 no longer escalated to missing-auth (nor recorded as a confirmed oracle sample); sink classes cite their specific CWE (sqli / nosql / redos / eval), not generic sast. - 0.4.0 retest work (15 extractors, the two FP corrections, four new classes) — carried forward. - .websec-ignore: skip the maintainer's gitignored base-research/ on self-scan. 103 tests green on the integrated tree; wheel builds + installs + smoke-runs (reports 0.4.1, calibration + bundled rules ship); self-scan dogfoods clean (1 Dockerfile LOW, 36 suppressed). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #1 — two precision bugs flagged during the audit and deliberately deferred from the first batch. Both produce wrong output today, so worth correcting. 88 → 91 tests, end-to-end verified.
Fixes
1. HTTP 500 misclassified as "no-auth-gate" (
dynamic.write_auth_enforcement)A 500 to an unauthenticated write was labeled
no-auth-gate (reached handler/validation), which:calibration.samples_from_dynamicas a confirmed-real missing-auth sample — poisoning the self-improving oracle.But a 500 is ambiguous — it can be the auth layer itself throwing. It now falls to the inconclusive
http-500verdict, consistent with the forged-token engine (which already excludes 500 from "reached handler").2. Sinks cite the wrong CWE (
findings.py§3)surface.pyemits the sink keysql-injection, butSTANDARDSkeys itsqli, so SQLi sinks fell back to attack_classsast→ CWE-710 (generic) instead of CWE-89. Added a_SINK_ATTACKalias (sql-injection → sqli) plusSTANDARDS+REMEDIATIONentries fornosql-injection(CWE-943),redos(CWE-1333),eval-injection(CWE-95). Each sink class now cites its specific CWE with a concrete fix.Tests
http-500,no_auth_gate == [], oracle records nothing; + a400 still no-auth-gateregression guard.🤖 Generated with Claude Code