Repository navigation
fix(rules): a 401 or app 403 is protected; a challenge, WAF 403, 429 or 5xx is never a clean pass (#1920) - #1921
Merged
Merged
Conversation
nc9
force-pushed
the
boat/inline-fetch-endpoints-1920
branch
from
November 15, 2026 09:04
fdcf944 to
396dd2f
Compare
nc9
marked this pull request as ready for review
November 15, 2026 09:10
… end to end (#1920) Crawls a local fixture with a plain HTTP crawl, builds the endpoint surface and runs security/unauthenticated-api and security/json-sensitive-fields at aggressive through both engine paths. /about calls /api/users and /api/account from an inline script only, matching the nut-shop probe faults. Asserts the call sites become same-origin, probe-eligible static-html candidates, both rules flag the endpoints, json-sensitive-fields names $.password and counts PII without values, and no response value appears in any finding, detail or log. The false negative from the smoke run does not reproduce on main: the source CLI and a compiled binary both report the endpoints against the real nut-shop app (dev server and production build) with --aggressive --offline --max-pages 40. Refs #1920 Signed-off-by: Nik Cubrilovic <[email protected]>
…or 5xx is never a clean pass (#1920) The probing rules (exposed-files, unauthenticated-api, json-sensitive-fields) share one classifier in probe-http and one WAF marker list, WAF_CHALLENGE_MARKERS in @squirrelscan/utils/waf-markers (mirrors the cloud link checker's WAF_403_MARKERS). A 401, or a 403 the app sent itself with no WAF marker, is a real answer: the endpoint is protected. A 429, a challenge page, a 403 carrying WAF markers, a 5xx, or a timeout leaves the endpoint unverified. Zero candidates is not checked. A partial run reports the findings for the verified endpoints plus a not-checked note naming how many were not verified, never a clean pass. Docs updated. Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
boat/inline-fetch-endpoints-1920
branch
from
November 15, 2026 12:16
396dd2f to
3eca40d
Compare
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.
Closes #1920 (round 3).
Summary
packages/rules/src/security/probe-http.tsis shared bysecurity/exposed-files,security/unauthenticated-apiandsecurity/json-sensitive-fields. A 401, or a 403 the app sent itself (JSON or plain, with no WAF marker), means the endpoint is protected and counts as a pass. A 429, a challenge page, a 403 carrying WAF markers, a 5xx, or a timeout or network error leaves the endpoint unverified.WAF_CHALLENGE_MARKERSin@squirrelscan/utils/waf-markershas the same entries as the private link checker'sWAF_403_MARKERS: cloudflare, akamai, datadome, perimeterx, imperva, sucuri and aws-waf. Markers are only read on a 403, because several of them appear on every answer from a protected site.Tests
packages/rules/tests/probe-unverified-1920.test.ts: 33 pass. Covers the marker list, the classifier, and these cases for both API rules: 403 JSON passes, 401 passes, 404 passes, 403 Cloudflare challenge is not checked, 429, 5xx, zero candidates, partial with a 5xx, and partial with a challenge.exposed-files.test.ts: new cases for a 403 JSON pass, a WAF-marked 403 that is not checked, and a partial hit plus 5xx paths.Gates
bun run typecheckpasses in rules (src and tests), audit-engine and utils.scripts/test-suites.ts --checkpasses, andmake validatein docs passes.Agent skill: no change needed.