Repository navigation
Fix decode-uri-component DoS in Gatsby example (CVE-2026-118664) - #120
Merged
Conversation
gatsby@5.16.1 pins query-string@^6.14.1, which pulls in decode-uri-component@0.2.2 (GHSA-qr28-fpjm-wq7f, GHSA-vcc3-ghjq-m6fr). No gatsby release ships a fixed query-string. Override query-string to ^9.5.1, which depends on decode-uri-component ^0.5.0, and floor decode-uri-component at ^0.5.1. Overriding only decode-uri-component is not enough: 0.5.x is ESM-only, so the CommonJS query-string 6.x gets a namespace object and throws "decodeComponent is not a function". Gatsby's only consumer is the develop-only dev 404 page, which webpack bundles via a default import that query-string 9 provides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
miguelcalderon
approved these changes
Nov 16, 2026
miguelcalderon
left a comment
Contributor
There was a problem hiding this comment.
Thanks, this looks good. I checked Gatsby 5.16.1: the dev 404 page is the only place that uses query-string, it's only created outside production builds, and version 9.5.1 still provides the parse and stringify calls that page relies on. No other package here depends on query-string, so the overrides don't affect anything else. The explanation of why overriding decode-uri-component alone breaks Gatsby is really helpful. Approving. Please remember to remove both overrides once Gatsby releases a fixed version.
miguelcalderon
deleted the
support-agent/linear-b10492e5-679f-4157-ba27-6a54bf18540d-32808992-3eb4-4b3d-893b-7ea84cb6e4cc
branch
November 16, 2026 10:31
8 of 10 tasks
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
Fixes SECSLOP-8 / Dependabot alert #1863. In
examples/gatsbyjs,decode-uri-component@0.2.2came in throughgatsby@5.16.1 → query-string@6.14.1. It is affected by GHSA-qr28-fpjm-wq7f (CVE-2026-118664, high, quadratic replacement) and GHSA-vcc3-ghjq-m6fr (moderate). gatsby 5.16.1 is the latest release, so there is no upstream fix to upgrade to.This PR adds two overrides to
examples/gatsbyjs/package.json:Lockfile changes:
query-string6.14.1 → 9.5.1decode-uri-component0.2.2 → 0.5.1filter-obj1.1.0 → 5.1.0split-on-first1.1.0 → 3.0.0strict-uri-encoderemovedWhy not override only decode-uri-component?
That was the suggested fix, but it breaks Gatsby.
decode-uri-component0.4+ is published as an ES module only (export default).query-string6.x is CommonJS and callsrequire('decode-uri-component')(value). With only that override,queryString.parse('?a=1')throwsTypeError: decodeComponent is not a function, both in Node 24 and in a webpack bundle.Gatsby uses
query-stringin exactly one place: the develop-only dev 404 page (import queryString from "query-string", calling.parseand.stringify).query-string9.5.1 provides that default export and depends ondecode-uri-component ^0.5.0. The second override keepsdecode-uri-componentat 0.5.1 or later.Exposure
The vulnerable code never shipped in production builds: the dev 404 page is only created when
NODE_ENV !== 'production'. Undergatsby developit parses the developer's own URL in their browser. There is no server-side path that feeds request data to it.Verification
npm ciandnpm ls decode-uri-component --all: the only copy is 0.5.1.npm run build: passes, as it did before the change.npm test: 7/7 pass, as before.npm audit: nodecode-uri-componentorquery-stringfindings. Highs went from 5 to 4; the rest are follow-redirects/axios, webpack-dev-middleware and the gatsby entry that rolls them up, all out of scope.pnpm exec biome check .: clean.gatsby developbuilds the development bundle. The dev 404 page code it serves includesquery-string9.5.1 anddecode-uri-component0.5.1, and webpack resolvesquery-string's default export (.parse/.stringify).query-string9.5.1 gives the sameparse/stringifyoutput as 6.14.1 on malformed, UTF-8 and+input.decode-uri-component0.5.1, was published 19 days before this change.The lockfile was generated with npm 11.21.2 so the diff has no unrelated
peerflag changes.Not verified: I couldn't load the dev 404 page in a real browser because the sandbox lacks Chromium's system libraries. gatsbyjs is also excluded from the Playwright e2e suite.
Follow-up
Remove both overrides once Gatsby ships a release with a fixed
query-string.🤖 Generated with Claude Code