# CVE-2026-82417: qs.stringify throws TypeError on objects with a non-callable constructor.isBuffer property

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 6.3
- **CVSS:** 6.3 (v4.0, CNA) `CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Attack requirements: Present; Privileges required: None; User interaction: None; Confidentiality impact: None; Integrity impact: None; Availability impact: Low; Confidentiality impact on other systems: None; Integrity impact on other systems: None; Availability impact on other systems: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.42% (percentile 28, 2026-11-28)
- **CWE:** CWE-248, CWE-703
- **Aliases:** GHSA-4mjr-xmp4-gh2g
- **Published:** 2026-08-29T23:51:27.634Z
- **Modified:** 2026-09-10T03:51:14.991Z

## Who should check

- Projects that depend on npm package qs (\>= 2.2.5, \< 6.16.0)
- Anyone running ljharb qs \>= 2.2.5, \< 6.16.0

## Description

\#\#\# 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.

## Affected and fixed versions

- npm `qs`: affected \>= 2.2.5, \< 6.16.0; fixed 6.16.0 (osv)
- ljharb qs: \>= 2.2.5, \< 6.16.0 (cvelist)

## Mitigation

- Upgrade qs to 6.16.0 or later.
- Vendor 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\`.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-82417. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-82417.md
Affected: qs >= 2.2.5, < 6.16.0
Fixed in: 6.16.0

Steps:
1. Search this machine and project for qs (npm), ljharb qs: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-82417 being exploited?

There is no confirmed exploitation: CVE-2026-82417 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.42% chance of exploitation in the next 30 days (as of 2026-11-28).

### How serious is CVE-2026-82417?

Medium: CVSS 6.3 (v4.0, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2026-82417?

qs \>= 2.2.5, \< 6.16.0.

### Is there a fix for CVE-2026-82417?

Yes. Fixed in 6.16.0. Upgrade qs to 6.16.0 or later. Vendor 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\`.

### How do I check if I'm affected by CVE-2026-82417?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/ljharb/qs/security/advisories/GHSA-4mjr-xmp4-gh2g>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2026-82417>
- patch: <https://github.com/ljharb/qs/commit/e83d321ffafb38cf210683ac31714fce6ce1c6c6>
- other: <https://github.com/ljharb/qs>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-82417>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-4mjr-xmp4-gh2g> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2026-82417> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-82417>
