{"id":"CVE-2026-110910","revision":null,"records":[{"revision":"dc62150db87a42bc944eeb63d4bf9799","observedAt":"2026-10-27T20:45:55.474+00:00","statement":{"source":"cve-program","id":"CVE-2026-110910","aliases":[],"title":"qs.stringify with allowEmptyArrays does not encode the keys of empty arrays, allowing query string parameter injection","description":"### Summary\n\n\n\n`qs.stringify` with `allowEmptyArrays: true` writes the key of an empty array without encoding it, even though keys are encoded by default. A key that contains `&` (or the configured `delimiter`), `=`, or `#` therefore becomes query string syntax instead of data, so a caller-supplied key name can add parameters to the serialized query string, or cut it short.\n\n\n\n### Details\n\n\n\nIn `lib/stringify.js`, the `allowEmptyArrays` branch returns `adjustedPrefix + '[]'` early, before the code that passes every other key through `encoder` and `formatter`. So `{ \"x&k=v\": [\"1\"] }` serializes as `x%26k%3Dv%5B0%5D=1`, but `{ \"x&k=v\": [] }` serializes as `x&k=v[]`. The early return applies at any depth (`{ \"a\": { \"b&k=v\": [] } }` gives `a[b&k=v][]`), under every `arrayFormat`, with `allowDots`, and with a custom `encoder`, which is never called for that key. With `encode: false` or `encodeValuesOnly: true`, keys are intentionally left unencoded on every path; those configurations are not affected.\n\n\n\n#### PoC\n\n\n\n```js\n\n\n\nvar qs = require(\"qs\");\n\n\n\nvar query = qs.stringify({ q: \"hi\", \"x&apiKey=evil&y\": [] }, { allowEmptyArrays: true });\n\n\n\n// \"q=hi&x&apiKey=evil&y[]\"\n\n\n\nqs.parse(query);\n\n\n\n// { q: \"hi\", x: \"\", apiKey: \"evil\", y: [\"\"] }\n\n\n\nqs.stringify({ \"x#\": [], z: \"1\" }, { allowEmptyArrays: true });\n\n\n\n// \"x#[]&z=1\": in a URL, everything after \"#\" becomes the fragment\n\n\n\n```\n\n\n\n#### Fix\n\n\n\nApplied in 234d505 on `main` and released as v6.17.0, and backported to v6.16.2, v6.15.4, v6.14.3, v6.13.4, and v6.12.6: the key of an empty array goes through `encoder` and `formatter` exactly as the key of any other value does, so `{ \"x&apiKey=evil&y\": [] }` now serializes as `x%26apiKey%3Devil%26y[]`. Keys that need no encoding serialize as before, with two exceptions that match every other path: the brackets of a nested key are now encoded (`a[b][]` becomes `a%5Bb%5D[]`, which `qs.parse` reads identically), and with `encodeDotInKeys`, a dot in the key becomes `%252E` instead of `%2E` (which `decodeDotInKeys` previously misread as nesting).\n\n\n\n### Affected versions\n\n\n\n- `>=6.12.0 <6.12.6`, fixed in v6.12.6\n\n\n\n- `>=6.13.0 <6.13.4`, fixed in v6.13.4\n\n\n\n- `>=6.14.0 <6.14.3`, fixed in v6.14.3\n\n\n\n- `>=6.15.0 <6.15.4`, fixed in v6.15.4\n\n\n\n- `>=6.16.0 <6.16.2`, fixed in v6.16.2\n\n\n\nv6.17.0 and later are not affected.\n\n\n\n`allowEmptyArrays` was introduced in f22b2bc and first shipped in v6.12.0, with this early return. Earlier versions have no `allowEmptyArrays` option and are not affected.\n\n\n\n### Impact\n\n\n\nAn application that passes an object whose key names come from untrusted input to `qs.stringify` with `allowEmptyArrays: true` (for example, to forward a parsed JSON body or user-selected fields to an upstream service) can have parameters injected into the resulting query string. The injected parameters are not keys of the object, so deleting or overwriting a key on the object (such as setting a trusted `apiKey` after copying the user's fields) does not remove them; whether the attacker's value or the application's wins depends on how the receiving side handles a duplicate parameter. A `#` in such a key ends the query string early when the result is placed in a URL. `allowEmptyArrays` is off by default, and only keys whose value (after any `filter`) is an empty array are affected.","state":0,"publishedAt":"2026-10-27T06:42:42.365+00:00","modifiedAt":"2026-10-27T19:32:36.456+00:00","affected":[{"ecosystem":"https://npmjs.com/qs","name":"qs","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"ljharb\",\n                    \"product\": \"qs\",\n                    \"collectionURL\": \"https://npmjs.com/qs\",\n                    \"packageName\": \"qs\",\n                    \"repo\": \"https://github.com/ljharb/qs\",\n                    \"versions\": [\n                        {\n                            \"status\": \"affected\",\n                            \"version\": \"6.12.0\",\n                            \"lessThan\": \"6.12.6\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"status\": \"affected\",\n                            \"version\": \"6.13.0\",\n                            \"lessThan\": \"6.13.4\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"status\": \"affected\",\n                            \"version\": \"6.14.0\",\n                            \"lessThan\": \"6.14.3\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"status\": \"affected\",\n                            \"version\": \"6.15.0\",\n                            \"lessThan\": \"6.15.4\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"status\": \"affected\",\n                            \"version\": \"6.16.0\",\n                            \"lessThan\": \"6.16.2\",\n                            \"versionType\": \"semver\"\n                        }\n                    ],\n                    \"defaultStatus\": \"unaffected\"\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","score":3.7,"severity":"LOW"},{"system":"CVSS 4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N","score":6.3,"severity":"MEDIUM"}],"references":["https://github.com/ljharb/qs/security/advisories/GHSA-w4cr-vjpx-p82q","https://github.com/ljharb/qs/commit/234d5051f5071efaa025a7ca9e4d34a56a460a1b","https://github.com/ljharb/qs/commit/6b8bf1a53d7b0c5e7e434eaae8e2c0cffd5c2492","https://github.com/ljharb/qs/commit/033526fc82f2e80a3d896df2bce9137e34cb5dc5","https://github.com/ljharb/qs/commit/f9dd4830cb922363822cdfdca2cceb3ed9792224","https://github.com/ljharb/qs/commit/ad445aa23e4c3a97394c3b9a5f9d7a7159eb1f17","https://github.com/ljharb/qs/commit/5d3b1b9ec6afd0cfc760c8e12862873789a32fc8","https://github.com/ljharb/qs/pull/561","https://github.com/ljharb/qs/issues/626"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-110910","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-110910","identifiers":["CVE-2026-110910"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-10-31T20:04:57.5651168+00:00","complete":true,"records":1766,"lastAttemptAt":"2026-10-31T20:04:57.5651168+00:00","lastSuccessAt":"2026-10-31T20:04:57.7272342+00:00","error":null,"lastVerifiedAt":"2026-10-31T20:04:57.7272348+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-9266d7b009bf9c4a0ccdcb5cbdea7f905cb3c4d92fd3b41581ece16b2cfdc4e7-23bfd986e9f4762f21aecac69d5fa9ae4654bc3173074abeea03d97bee4337c8","complete":true,"records":417593,"lastAttemptAt":"2026-10-31T20:04:56.4991174+00:00","lastSuccessAt":"2026-10-31T20:04:55.7915905+00:00","error":null,"lastVerifiedAt":"2026-10-31T20:04:56.4991174+00:00","snapshotPublishedAt":"2026-10-31T19:25:28+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-00b549a69b6049088aac1154dd5745fc","complete":false,"records":13567,"lastAttemptAt":"2026-10-31T20:17:14.3321965+00:00","lastSuccessAt":"2026-10-31T20:17:14.325+00:00","error":"11 identifier lookups failed; latest failures include HTTP 403. Other identifiers were checked independently.","lastVerifiedAt":"2026-10-31T20:17:14.325+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13601,"expectedIdentifiers":13637,"failedIdentifiers":11},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-10-31T20:04:57.5651168+00:00","complete":true,"records":1094,"lastAttemptAt":"2026-10-31T20:04:57.5651168+00:00","lastSuccessAt":"2026-10-31T20:04:57.7280158+00:00","error":null,"lastVerifiedAt":"2026-10-31T20:04:57.728016+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-a558c2e000674838b5341fe81ce273de","complete":false,"records":13580,"lastAttemptAt":"2026-10-31T20:05:02.8072159+00:00","lastSuccessAt":"2026-10-31T19:05:21.516+00:00","error":"1 identifier lookups failed; latest failures include HTTP 503. Other identifiers were checked independently.","lastVerifiedAt":"2026-10-31T19:05:21.516+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13636,"expectedIdentifiers":13637,"failedIdentifiers":1},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-21dcd6662970dfea02e4ea60ee637115e8d92664947484d2b9276b3f6568a84f","complete":true,"records":9815,"lastAttemptAt":"2026-10-31T20:04:57.1415361+00:00","lastSuccessAt":"2026-10-30T23:47:34.1817587+00:00","error":null,"lastVerifiedAt":"2026-10-31T20:04:57.1415361+00:00","snapshotPublishedAt":"2026-10-30T23:33:17+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-2de9ccc5290f060c7aa63f89c25dd76f655a64ba1aba7c05c97fa3bee4f09899","complete":true,"records":1967,"lastAttemptAt":"2026-10-31T20:04:56.5733949+00:00","lastSuccessAt":"2026-10-28T20:55:34.2982937+00:00","error":null,"lastVerifiedAt":"2026-10-31T20:04:56.5733949+00:00","snapshotPublishedAt":"2026-10-28T20:03:08+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-f95f76cd406ae5bae3de632ad37fd2d5160b44f5e6b51748ac6f8f0c0c88e72b","complete":true,"records":3028,"lastAttemptAt":"2026-10-31T20:04:57.5289094+00:00","lastSuccessAt":"2026-10-30T23:47:38.4914494+00:00","error":null,"lastVerifiedAt":"2026-10-31T20:04:57.5289094+00:00","snapshotPublishedAt":"2026-10-30T23:18:12+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-712291bb5a0ee4f1ca7325e317f98ff05e9ab8d14f863abf00a323d9e6d8331e","complete":true,"records":230994,"lastAttemptAt":"2026-10-31T20:04:57.037982+00:00","lastSuccessAt":"2026-10-31T17:06:47.8999408+00:00","error":null,"lastVerifiedAt":"2026-10-31T20:04:57.037982+00:00","snapshotPublishedAt":"2026-10-31T16:33:38+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}