Skip to content

fix(findings): 500-as-no-auth-gate + sink CWE mislabel (2 precision fixes)#2

Merged
raccioly merged 1 commit into
mainfrom
claude/recon-precision-fixes
Jun 10, 2026
Merged

fix(findings): 500-as-no-auth-gate + sink CWE mislabel (2 precision fixes)#2
raccioly merged 1 commit into
mainfrom
claude/recon-precision-fixes

Conversation

@raccioly

Copy link
Copy Markdown
Owner

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:

  • escalated to a HIGH-confidence missing-auth finding, and
  • got recorded by calibration.samples_from_dynamic as 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-500 verdict, consistent with the forged-token engine (which already excludes 500 from "reached handler").

2. Sinks cite the wrong CWE (findings.py §3)
surface.py emits the sink key sql-injection, but STANDARDS keys it sqli, so SQLi sinks fell back to attack_class sastCWE-710 (generic) instead of CWE-89. Added a _SINK_ATTACK alias (sql-injection → sqli) plus STANDARDS + REMEDIATION entries for nosql-injection (CWE-943), redos (CWE-1333), eval-injection (CWE-95). Each sink class now cites its specific CWE with a concrete fix.

Tests

  • 500 → http-500, no_auth_gate == [], oracle records nothing; + a 400 still no-auth-gate regression guard.
  • Sink classes map to their specific CWE + a non-default remediation.

🤖 Generated with Claude Code

…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 raccioly merged commit b5f5477 into main Jun 10, 2026
3 checks passed
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>
@raccioly raccioly deleted the claude/recon-precision-fixes branch June 10, 2026 21:06
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.

1 participant