Repository navigation
fix(cli): probe sends [crawler] user_agent and falls back to the honest UA on resets #2140 - #2142
Merged
Merged
Conversation
…st UA when a site resets browser-like clients #2140 Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
marked this pull request as ready for review
November 19, 2026 22:53
… audit effect <=3.22.0 ReDoS in Schema.TemplateLiteral's compiled regex. squirrel never uses Schema.TemplateLiteral, so it is not exploitable here. Temporary, decided by the maintainer so the CLI fix ships today: #2143 (effect 3.22.5) removes this ignore and its allowlist section when it merges after the v0.0.189 release. Signed-off-by: Nik Cubrilovic <[email protected]>
…-UA attempt is reset (pub#2140 review) A single transient reset that a retry clears no longer switches the whole crawl's agent: the browser UA keeps its transient retries, and the honest SquirrelScan UA gets its one attempt only when all of them ended in a reset or protocol error. New test: a server that resets only its first connection gives no fallback. The reset-every-time case still finishes inside the 20 s probe budget (asserted). Fail-before: on the previous order the new test and the two updated sequence tests fail. Signed-off-by: Nik Cubrilovic <[email protected]>
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 #2140
What changed
[crawler] user_agent(or a customUser-Agentheader) like the crawl;initRequestToolcarries it to the rules' own requests too. Chrome client hints (sec-ch-ua*) are only sent with a Chrome UA.SquirrelScan/2.0 (+https://squirrelscan.com). Decision: one reset already shows the pattern, so the same failing headers are not retried first. If the honest UA answers, the whole crawl runs as it, with one stderr line and a report note (userAgentFallback, JSON schema 1.29, shown as a line in text and markdown). If it also fails, the run stops without more retries.connection reset by the site: it may block browser-like clients. Set \[crawler] user_agent` in squirrel.toml (see https://docs.squirrelscan.com/configuration/crawler)`.Acceptance criteria
the probe > sends the configured UA and does not fall backthe audit > crawls the whole site as the honest UA, says so once, and the report carries it,the probe > falls back once...the audit > with [crawler] user_agent set...the probe > names the cause and the fix...,the audit > a site that resets every client fails with the new wordingdocs/configuration/crawler.mdxuser_agentsection,output.mdxschema 1.29, changelog.d entry;make validatein docs/ passesGates
test-suites.ts --checkok;--run cli4565 pass 0 fail;--run crawler1176 pass 0 fail;--run report1413 pass 0 fail; typecheck cli/report/core-contracts clean; root lint and format:check clean;changelog.ts checkok; docsmake validate71 pass.Notes