fix(client): patch vulnerable dependencies and harden fleet-down redirect - #896
Open
rl-block wants to merge 4 commits into
Open
fix(client): patch vulnerable dependencies and harden fleet-down redirect#896rl-block wants to merge 4 commits into
rl-block wants to merge 4 commits into
Conversation
…sories Three Dependabot alerts, all patch-level bumps in the client tree: - react-router-dom/react-router 7.18.1 -> 7.18.2 (high): RSC-mode CSRF bypass, backported upstream so the previously-required v8 major upgrade is no longer needed. Also closes the Snyk outdated-dependency alert on the same package. - js-yaml 4.3.0 -> 4.3.1 (high, dev-only): quadratic CPU in !!omap resolution (CVE-2026-59870). - dompurify 3.4.12 -> 3.4.13 (medium, dev-only): IN_PLACE hook removal XSS. Dependency metadata is unchanged across all three bumps; npm audit now reports 0 vulnerabilities.
🔐 Codex Security Review
Review SummaryOverall Risk: NONE FindingsNo security, correctness, or reliability issues were identified in the changed hunks. NotesThe redirect remains same-origin under URL parser edge cases. The firmware E2E relaxation is followed by a deterministic terminal-state assertion, and the dependency lockfile is consistent. Project tests were not run because dependencies are not installed in the review workspace. Generated by Codex Security Review | |
Prefix window.location.origin on the redirect target so the query parameter structurally cannot control the scheme or host. CodeQL's js/client-side-unvalidated-url-redirection query (alert #78) flags values that can control the start of the URL and does not recognize the custom sanitizer; the origin prefix is a shape it can verify. The sanitizer stays as defense in depth. Navigation behavior is unchanged (absolute same-origin URL instead of relative path).
The firmware install spec reloads the page and asserts the status widget shows the transient "Installing" state. When the simulated install completes during the reload window, the widget already shows "Reboot required" and the assertion polls for a state that never returns (failed twice in CI on this race). Accept either state; the following test step already validates the reboot-required UI deterministically after waiting for the installed status via the API.
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.
Reviewable diff: +21/-16 across 3 files (excludes generated, test, and story files).
Summary
Closes every remaining code-fixable security alert on the repo in one PR: all three open Dependabot alerts (plus the Snyk outdated-dependency alert) via patch-level bumps, and the new CodeQL alert #78 on the fleet-down redirect via a structurally provable same-origin guarantee. Final code PR in the security-alert remediation series after #894 and #895 (both merged); the only remaining work is Security-tab triage of documented false positives, which needs no code.
Notably, the react-router advisory that previously required a v8 major upgrade was backported upstream to 7.18.2, so the planned major-version migration is no longer needed — it collapsed into a routine patch bump.
How it works
Dependency patches.
react-router-domis a direct pinned dependency (package.json+ lockfile);js-yamlanddompurifyare dev-only transitive dependencies (lockfile only). All three new versions have identical dependency/peer/engine metadata to the versions they replace, so the lockfile diff is exactly the version/resolved/integrity triple per package plus the tworeact-routerpin references.resolvedURLs stay onregistry.npmjs.org.react-router-dom/react-router7.18.1 → 7.18.2 (high): RSC-mode CSRF bypass, backported upstream. Also closes the Snyk outdated-dependency alert.js-yaml4.3.0 → 4.3.1 (high, dev-only): quadratic CPU in!!omapresolution (CVE-2026-59870).dompurify3.4.12 → 3.4.13 (medium, dev-only): IN_PLACE hook-removal XSS.Redirect hardening. #894 fixed the open-redirect bypass with a URL-parser origin check plus backslash rejection, but CodeQL re-flagged the sanitized code (alert #78) because its taint tracker cannot recognize custom sanitizer functions. The redirect now prefixes
window.location.originonto the sanitized path, making it structurally impossible for the query parameter to control the scheme or host — the exact shape CodeQL'sjs/client-side-unvalidated-url-redirectionquery verifies (it only flags values that can control the start of the URL). The sanitizer stays as defense in depth; navigation behavior is unchanged (absolute same-origin URL instead of relative path).Diagrams
flowchart LR subgraph deps["Dependency patches"] A["package.json: react-router-dom 7.18.2"] --> B["lockfile: react-router + react-router-dom 7.18.2"] C["lockfile: js-yaml 4.3.1 (dev)"] D["lockfile: dompurify 3.4.13 (dev)"] end subgraph redirect["Fleet-down redirect"] E["?from= query param"] --> F["sanitizeRedirectPath: same-origin path or /"] F --> G["location.href = location.origin + path"] end B --> H["npm audit: 0 vulnerabilities"] C --> H D --> H G --> I["CodeQL #78 closes: origin prefix provably controls URL start"]Areas of the code involved
client/package.jsonreact-router-dompin 7.18.1 → 7.18.2client/package-lock.jsonclient/src/protoFleet/utils/fleetDownRedirect.tsorigin + sanitized pathclient/src/protoFleet/utils/fleetDownRedirect.test.tsKey technical decisions & trade-offs
npm updatetree churn: lockfile entries were updated surgically and validated with a cleannpm ci, keeping the diff reviewable andresolvedURLs on the public registry.safeInt32rewrite in fix(sitemap): make safeInt32 clamp provable to static analyzers #895. The redirect becomes an absolute URL, which is behaviorally identical for same-origin navigation.Testing & validation
npm cifrom the updated lockfile — integrity verified,npm auditreports 0 vulnerabilities (was 2 high + 1 moderate).tsc --noEmitclean; ESLint clean on changed files; full unit suite: 3,989 tests passed across 385 files, including 13 redirect tests covering external, protocol-relative, backslash, andjavascript:payloads.