fix: MISSING_TLS false positive on secure wss:// transports#18
Open
dmchaledev wants to merge 1 commit into
Open
fix: MISSING_TLS false positive on secure wss:// transports#18dmchaledev wants to merge 1 commit into
dmchaledev wants to merge 1 commit into
Conversation
The MISSING_TLS rule flagged any URL that neither started with https:// nor set transport.tls. parseConfig leaves transport.tls=false for non-https schemes, so a fully secure wss:// WebSocket endpoint was reported as HIGH 'Missing TLS - Server Uses Plain HTTP' - a factually wrong false positive that fails the CI gate on a properly-secured server (and double-counts ws:// alongside INSECURE_TRANSPORT). Scope the rule to the HTTP family by excluding ws:// and wss:// URLs. ws:// remains covered by INSECURE_TRANSPORT; wss:// is already encrypted. Plain http:// and scheme-less-without-tls cases still fire. Adds regression tests for the wss:// and ws:// cases.
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 HIGH-severity false positive: a fully secure
wss://MCP server is flagged asMISSING_TLS— "Missing TLS — Server Uses Plain HTTP" — claiming it "uses plain HTTP (not HTTPS)", which is factually wrong.wss://is a TLS-encrypted WebSocket. For a tool sold as a CI/CD security gate, this fails the gate on a properly-secured server and erodes trust in the scanner's output.Repro (before this PR)
Root cause
src/rules/auth-rules.ts(MISSING_TLS) fires for any URL that neither starts withhttps://nor setstransport.tls:parseConfigsetstransport.tls = serverUrl.startsWith('https://'), so for awss://URLtlsisfalse. The(!isTls && !startsWith('https://'))clause then matcheswss://(andws://), even though this rule is specifically about the HTTP family ("Server Uses Plain HTTP"). WebSocket security is already owned byINSECURE_TRANSPORT(which correctly flags onlyws://), sows://was also being double-counted.Fix
Scope
MISSING_TLSto the HTTP family by excludingws://andwss://.ws://remains covered byINSECURE_TRANSPORT;wss://is already encrypted. Plainhttp://and scheme-less-without-tlscases still fire, so no real finding is lost.Verification
npm run typecheck✓ ·npm run lint(0 warnings) ✓MISSING_TLSblock (scanner.test.ts) for thewss://andws://cases. Verified passing in isolation (5/5, including a check that scheme-less-without-tls still fires).Note on CI
CI on
mainis currently red for a pre-existing, unrelated reason — thesrc/sarif.tsimport.meta/createRequirecompile error under ts-jest's CommonJS transform (introduced in #9, fixed by open PR #12). That breaks thescannerandsarifsuites' compilation regardless of this change. This PR adds no new failures; the new tests pass once #12 lands. Typecheck and lint are green here.https://claude.ai/code/session_01AS5hiMB3scrZaMFfRZhiHp
Generated by Claude Code