fix(NO_AUTH): treat auth.type "none"/"disabled" as unauthenticated#24
Merged
Conversation
The NO_AUTH rule counted any non-empty transport.auth.type as authentication, so a config explicitly declaring `auth.type: "none"` (or "disabled"/"off"/"false"/"anonymous") satisfied the check and an unauthenticated server passed the CRITICAL gate — a false negative for a tool sold as a CI/CD security gate. An auth `type` now only counts when it names a real mechanism; a real credential (apiKey/token) always counts regardless of type. Adds regression tests and a CHANGELOG entry. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QQgkZGTBue6Yo27iS8bPSf
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
A CRITICAL-severity false negative in the flagship
NO_AUTHrule: a server that explicitly declares no authentication viatransport.auth.type: "none"passes the gate cleanly. For a tool sold as a CI/CD security gate, this is the worst kind of bug — an unauthenticated server reportsPASSED.Repro (before this PR)
Root cause
NO_AUTHinsrc/rules/auth-rules.tscounted any non-emptyauth.typeas authentication:So
auth: { type: "none" }— the canonical way to declare no auth — madehasAuthtruthy and suppressed the finding. The same held for"disabled","off","false","anonymous".Fix
An auth
typenow only counts as authentication when it names a real mechanism; a set of placeholder/disabled values (none,disabled,off,false,anonymous, case-insensitive, trimmed) is treated as no auth. A real credential (apiKey/token) still always counts, regardless oftype. The finding now also carriesevidencedistinguishing the "explicitly disabled" case from "auth block absent".Verification
npx tsc --noEmit— clean ·npm run lint(0 warnings) — cleannpm test— 99 passed (10 new NO_AUTH cases: disabled-type variants, case-insensitivity, meaningful type, and credential-present-with-type-none)examples/secure-config.json→ 0 findings / PASSED (no false positive);examples/vulnerable-config.json→ still FAILEDThis is independent of the open PR backlog — no other open PR touches the
NO_AUTHlogic (#18 isMISSING_TLSonly). CI on this branch is green.🤖 Generated with Claude Code
https://claude.ai/code/session_01QQgkZGTBue6Yo27iS8bPSf
Generated by Claude Code