CVE-2026-82417qs.stringify throws TypeError on objects with a non-callable constructor.isBuffer property
### Summary `qs.stringify` throws a `TypeError` when it serializes an object whose own `constructor` property has a truthy, non-callable `isBuffer` member. `utils.isBuffer` duck-types buffers by calling `obj.constructor.isBuffer(obj)` after checking only that the property is truthy, so a value such as `{ constructor: { isBuffer: "x" } }` makes the call throw `TypeError: obj.constructor.isBuffer is not a function`. ### Details `lib/stringify.js:127` calls `utils.isBuffer` on every non-primitive value it serializes. `utils.isBuffer` (`lib/utils.js:332`) reads `obj.constructor.isBuffer` and invokes it without verifying that it is a function. `constructor` and `isBuffer` are ordinary property names, so any object carrying them as own properties reaches the unchecked call. Such an object can be built from untrusted input. `qs.parse("x[constructor][isBuffer]=y", { plainObjects: true })` or `{ allowPrototypes: true }` keeps the `constructor` key as an own property (the default parse options drop it), and `JSON.parse("{\"a\":{\"constructor\":{\"isBuffer\":\"x\"}}}")` produces the same shape with no qs option involved. Express 4 with its default `query parser` setting and body-parser with `extended: true` both call `qs.parse` with `allowPrototypes: true`, so on those stacks `req.query` and `req.body` can carry the shape directly. #### PoC ```js var qs = require("qs"); qs.stringify(qs.parse("x[constructor][isBuffer]=y", { plainObjects: true })); qs.stringify(JSON.parse("{\"a\":{\"constructor\":{\"isBuffer\":\"x\"}}}")); // TypeError: obj.constructor.isBuffer is not a function // at Object.isBuffer (lib/utils.js:332:78) // at stringify (lib/stringify.js:127:45) ``` #### Fix `lib/utils.js`, applied in e83d321 on `main` and released as v6.16.0: ```diff - return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); + return !!(obj.constructor && typeof obj.constructor.isBuffer === "function" && obj.constructor.isBuffer(obj)); ``` Real `Buffer`, `safer-buffer`, and browserify `buffer` polyfill instances serialize exactly as before; only the throw is removed. ### Affected versions `>=2.2.5 <6.16.0`, fixed in v6.16.0. The unguarded duck-type was introduced in 3768a75 and first shipped in v2.2.5 (September 2014). v2.2.4 and earlier used `Buffer.isBuffer` and are not affected. Every release from v2.2.5 through v6.15.3 contains the unguarded call. ### Impact An unauthenticated request can make any code path that re-serializes attacker-influenced data with `qs.stringify` (for example, rebuilding a query string from `req.query` for a redirect or an upstream request, or serializing a parsed JSON body) throw synchronously. In a typical Node.js HTTP framework the throw is caught by the framework error boundary and the affected request returns a 500; the process survives and other requests are unaffected. Where the call runs outside an error boundary, such as an `async` Express 4 handler (where the throw becomes an unhandled promise rejection) or a background job, the process exits, so the impact in that case depends on the application error handling rather than on qs.
What to do
Fixed builds are available from Debian, npm: see the table below for the fixed version per release.
Debian, Red Hat, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | node-qs | Fix pending | UBUNTU-CVE-2026-82417 | |
| Ubuntu 26.04 | node-qs | Under investigation | UBUNTU-CVE-2026-82417 | |
| Ubuntu 24.04 | node-qs | Under investigation | UBUNTU-CVE-2026-82417 | |
| Ubuntu 22.04 | node-qs | Under investigation | UBUNTU-CVE-2026-82417 | |
| Ubuntu 20.04 | node-qs | Fix pending | UBUNTU-CVE-2026-82417 | |
| Ubuntu 18.04 | node-qs | Fix pending | UBUNTU-CVE-2026-82417 | |
| Ubuntu 16.04 | node-qs | Fix pending | UBUNTU-CVE-2026-82417 | |
| Ubuntu 14.04 | node-qs | Fix pending | UBUNTU-CVE-2026-82417 | |
| Debian 14 | node-qs | Fixed | 6.16.0+ds+~6.15.1-1 | DEBIAN-CVE-2026-82417 |
| Debian 13 | node-qs | Fix pending | DEBIAN-CVE-2026-82417 | |
| Debian 12 | node-qs | Fix pending | DEBIAN-CVE-2026-82417 | |
| Red Hat Enterprise Linux 10 | cockpit-ha-cluster | Not affected | ||
| Red Hat Enterprise Linux 10 | grafana | Not affected | ||
| Red Hat Enterprise Linux 10 | grafana-pcp | Not affected | ||
| Red Hat Enterprise Linux 10 | grafana-selinux | Not affected | ||
| Red Hat Enterprise Linux 10 | librados-devel | Fix pending Affected | ||
| Red Hat Enterprise Linux 10 | librados2 | Fix pending Affected | ||
| Red Hat Enterprise Linux 10 | libradospp-devel | Fix pending Affected | ||
| Red Hat Enterprise Linux 10 | librbd-devel | Fix pending Affected | ||
| Red Hat Enterprise Linux 10 | librbd1 | Fix pending Affected | ||
| Red Hat Enterprise Linux 10 | linux-sgx | Not affected | ||
| Red Hat Enterprise Linux 10 | nodejs | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 10 | nodejs-devel | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 10 | nodejs-docs | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 10 | nodejs-full-i18n | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 10 | nodejs-libs | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 10 | nodejs-npm | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 10 | nodejs22 | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 10 | nodejs24 | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 10 | nodejs24-devel | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 10 | nodejs24-docs | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 10 | nodejs24-full-i18n | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 10 | nodejs24-libs | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 10 | nodejs24-npm | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 10 | nodejs26 | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 10 | nodejs26-devel | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 10 | nodejs26-docs | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 10 | nodejs26-full-i18n | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 10 | nodejs26-libs | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 10 | nodejs26-npm | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 10 | pcs | Not affected | ||
| Red Hat Enterprise Linux 10 | pcs-snmp | Not affected | ||
| Red Hat Enterprise Linux 10 | sgx-common | Not affected | ||
| Red Hat Enterprise Linux 10 | sgx-libs | Not affected | ||
| Red Hat Enterprise Linux 10 | sgx-mpa | Not affected | ||
| Red Hat Enterprise Linux 10 | sgx-pccs | Not affected | ||
| Red Hat Enterprise Linux 10 | sgx-pccs-admin | Not affected | ||
| Red Hat Enterprise Linux 10 | sgx-pckid-tool | Not affected | ||
| Red Hat Enterprise Linux 10 | tdx-qgs | Not affected | ||
| Red Hat Enterprise Linux 9 | aspnetcore-runtime-6.0 | Not affected | ||
| Red Hat Enterprise Linux 9 | aspnetcore-runtime-7.0 | Not affected | ||
| Red Hat Enterprise Linux 9 | aspnetcore-targeting-pack-6.0 | Not affected | ||
| Red Hat Enterprise Linux 9 | aspnetcore-targeting-pack-7.0 | Not affected | ||
| Red Hat Enterprise Linux 9 | dotnet-apphost-pack-6.0 | Not affected | ||
| Red Hat Enterprise Linux 9 | dotnet-apphost-pack-7.0 | Not affected | ||
| Red Hat Enterprise Linux 9 | dotnet-host | Not affected | ||
| Red Hat Enterprise Linux 9 | dotnet-hostfxr-6.0 | Not affected | ||
| Red Hat Enterprise Linux 9 | dotnet-hostfxr-7.0 | Not affected | ||
| Red Hat Enterprise Linux 9 | dotnet-runtime-6.0 | Not affected | ||
| Red Hat Enterprise Linux 9 | dotnet-runtime-7.0 | Not affected | ||
| Red Hat Enterprise Linux 9 | dotnet-sdk-6.0 | Not affected | ||
| Red Hat Enterprise Linux 9 | dotnet-sdk-6.0-source-built-artifacts | Not affected | ||
| Red Hat Enterprise Linux 9 | dotnet-sdk-7.0 | Not affected | ||
| Red Hat Enterprise Linux 9 | dotnet-sdk-7.0-source-built-artifacts | Not affected | ||
| Red Hat Enterprise Linux 9 | dotnet-targeting-pack-6.0 | Not affected | ||
| Red Hat Enterprise Linux 9 | dotnet-targeting-pack-7.0 | Not affected | ||
| Red Hat Enterprise Linux 9 | dotnet-templates-6.0 | Not affected | ||
| Red Hat Enterprise Linux 9 | dotnet-templates-7.0 | Not affected | ||
| Red Hat Enterprise Linux 9 | dotnet6.0 | Not affected | ||
| Red Hat Enterprise Linux 9 | dotnet7.0 | Not affected | ||
| Red Hat Enterprise Linux 9 | grafana | Not affected | ||
| Red Hat Enterprise Linux 9 | grafana-pcp | Not affected | ||
| Red Hat Enterprise Linux 9 | grafana-selinux | Not affected | ||
| Red Hat Enterprise Linux 9 | linux-sgx | Not affected | ||
| Red Hat Enterprise Linux 9 | netstandard-targeting-pack-2.1 | Not affected | ||
| Red Hat Enterprise Linux 9 | nodejs | Not affected | ||
| Red Hat Enterprise Linux 9 | nodejs-docs | Not affected | ||
| Red Hat Enterprise Linux 9 | nodejs-full-i18n | Not affected | ||
| Red Hat Enterprise Linux 9 | nodejs-libs | Not affected | ||
| Red Hat Enterprise Linux 9 | npm | Not affected | ||
| Red Hat Enterprise Linux 9 | pcs | Not affected | ||
| Red Hat Enterprise Linux 9 | pcs-snmp | Not affected | ||
| Red Hat Enterprise Linux 9 | sgx-common | Not affected | ||
| Red Hat Enterprise Linux 9 | sgx-libs | Not affected | ||
| Red Hat Enterprise Linux 9 | sgx-mpa | Not affected | ||
| Red Hat Enterprise Linux 9 | sgx-pccs | Not affected | ||
| Red Hat Enterprise Linux 9 | sgx-pccs-admin | Not affected | ||
| Red Hat Enterprise Linux 9 | sgx-pckid-tool | Not affected | ||
| Red Hat Enterprise Linux 9 | tdx-qgs | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-azure-monitor | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-cloudwatch | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-elasticsearch | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-graphite | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-influxdb | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-loki | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-mssql | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-mysql | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-opentsdb | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-pcp | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-postgres | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-prometheus | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-selinux | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-stackdriver | Not affected | ||
| Red Hat Enterprise Linux 8 | mozjs60 | Not affected | ||
| Red Hat Enterprise Linux 8 | mozjs60-devel | Not affected | ||
| Red Hat Enterprise Linux 8 | pcs | Not affected | ||
| Red Hat Enterprise Linux 8 | pcs-snmp | Not affected | ||
| Red Hat Enterprise Linux 7 | python-syspurpose | Not affected | ||
| Red Hat Enterprise Linux 7 | rhsm-gtk | Not affected | ||
| Red Hat Enterprise Linux 7 | subscription-manager | Not affected | ||
| Red Hat Enterprise Linux 7 | subscription-manager-cockpit | Not affected | ||
| Red Hat Enterprise Linux 7 | subscription-manager-gui | Not affected | ||
| Red Hat Enterprise Linux 7 | subscription-manager-initial-setup-addon | Not affected | ||
| Red Hat Enterprise Linux 7 | subscription-manager-migration | Not affected | ||
| Red Hat Enterprise Linux 7 | subscription-manager-plugin-container | Not affected | ||
| Red Hat Enterprise Linux 7 | subscription-manager-plugin-ostree | Not affected | ||
| Red Hat Enterprise Linux 7 | subscription-manager-rhsm | Not affected | ||
| Red Hat Enterprise Linux 7 | subscription-manager-rhsm-certificates | Not affected | ||
| npm library | qs | Fixed | 6.16.0 | GHSA-4mjr-xmp4-gh2g |
What the vendor says
As published in the CVE record by harborist, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- ljharb qs: affected: 2.2.5 to before 6.16.0; fixed in
6.16.0
Solution: Upgrade to qs 6.16.0 or later.
Workaround: Pass a `filter` function to `qs.stringify` that drops values carrying an own `constructor` property; it runs before the `isBuffer` check. Alternatively, wrap `qs.stringify` calls on externally influenced objects in try/catch, and avoid `allowPrototypes: true` / `plainObjects: true` when parsed untrusted input is fed back into `qs.stringify`.
Vendor advisories:
- https://github.com/ljharb/qs/security/advisories/GHSA-4mjr-xmp4-gh2g (vendor-advisory)
- https://github.com/ljharb/qs/commit/e83d321ffafb38cf210683ac31714fce6ce1c6c6 (patch)
References
- https://github.com/ljharb/qs/security/advisories/GHSA-4mjr-xmp4-gh2g
- https://github.com/ljharb/qs/commit/e83d321ffafb38cf210683ac31714fce6ce1c6c6
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.