# CVE-2026-110816: qs.stringify with arrayFormat comma throws TypeError on array elements that cannot be coerced to a string

- Priority: **Routine**
- Reason: Not severe (CVSS 6.3, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2026-10-14 · Modified: 2026-10-16
- Aliases: DEBIAN-CVE-2026-110816, UBUNTU-CVE-2026-110816, GHSA-6pq8-jhm2-2vcw, CGA-jfg4-pp4c-896r, CGA-24pp-7wmc-hw4h, CGA-293q-g29f-2rjv, CGA-62pj-6898-mc33, CGA-6652-2cvf-72r3, CGA-73xx-wg55-qvh8, CGA-75g8-x3r3-9m45, CGA-7cm4-6jw8-p27c, CGA-f4pj-ghfj-5w5h, CGA-hjrx-m696-23mg, CGA-j64q-g749-6f89, CGA-p848-vf8j-2hj7, CGA-qfqm-6pxr-grr7, CGA-r259-qjmh-3594, CGA-v7mh-g3jf-p77m, CGA-24m4-4343-h98m, CGA-2ph8-3jr8-c6q4, CGA-2r9h-5f7j-3pwv, CGA-337h-wxcm-fg83, CGA-3xq9-rxch-fpqh, CGA-434v-66c2-pc34, CGA-468h-wr4c-pc32, CGA-4cww-2fph-cf7j, CGA-4r7p-78r9-2m3c, CGA-54rq-c3vh-f3ff, CGA-65jr-585p-v6jv, CGA-668h-f98v-x3c3, CGA-66h7-hv5g-9m6p, CGA-6r96-f546-xhpr, CGA-6vpg-pjjc-8pxr, CGA-6w4g-f6xc-28gj, CGA-7527-xx58-8pf7, CGA-7q5g-9f2c-rr56, CGA-7wm7-9xgc-vmfh, CGA-85hq-796f-99gh, CGA-8g49-qm6c-q9wm, CGA-8h5f-69ch-cxfc, CGA-926p-cvr6-4h56, CGA-96mw-7p8j-p9gx, CGA-9whv-8397-6f2h, CGA-c2jp-j5fj-r3j3, CGA-c9cv-jf94-29c6, CGA-f8gp-jjfx-hm7h, CGA-ff75-2pcg-r5gm, CGA-fxfr-vp6q-868c, CGA-g62g-6r2m-8c2x, CGA-ggqw-28cp-jmx6, CGA-gq5f-43pw-r9j5, CGA-hpvj-hhgx-6chq, CGA-jr3v-pxj9-j9vr, CGA-m55h-3mp5-f4m6, CGA-mfrg-932v-j57v, CGA-q9wg-phj4-8rr6, CGA-qff6-xh57-w7p4, CGA-qv9f-4gfh-qgw8, CGA-v5m9-h872-jmr2, CGA-v5xx-69xx-fc5m, CGA-vcw7-93x5-h4ww, CGA-vrww-82jp-h9vf, CGA-w8wc-mr8h-c2vp, CGA-x9m7-mpfp-8w73, CGA-xp88-vq4r-f2wh, CGA-xpw3-vcxm-xc22, CGA-xvgc-pm7j-fr5c, CGA-2cw3-ff84-q3j9, CGA-3vm2-v959-r33v, CGA-74jh-hpgm-mjqc, CGA-8h68-8jrh-7wh8, CGA-97vf-q7rx-5vgq, CGA-9jg4-j63w-h94r, CGA-9q48-w62j-xwjf, CGA-f95x-9hpw-6x7p, CGA-fggv-cpf3-8m6j, CGA-fq4g-xfmp-6g7x, CGA-fv62-fffv-9652, CGA-fx59-5p34-24wc, CGA-gh3w-gc45-vg97, CGA-gvrm-6gqr-qcq9, CGA-h8gp-2pww-2qjg, CGA-j859-h2wg-xmj4, CGA-jgq7-p7v3-h3p9, CGA-m5fr-cfm8-vcw8, CGA-mr35-23f5-pprw, CGA-p9jr-gj27-qh3j, CGA-q3cc-78hg-f8q4, CGA-rgrf-c53h-286p, CGA-vp22-r4v4-v42m, CGA-xfmj-7cm5-c2gx, CGA-xr8c-vxq7-fw84, CGA-6rx7-g5gw-h29v, CGA-r279-57v5-m9q5, CGA-7g9q-v8jr-mmqf, CGA-5qh8-4hvf-8mfw, CGA-3828-q5q7-cf85, CGA-3hpx-6r77-hh5x, CGA-4hhx-66vp-3r3q, CGA-34fx-6mr5-r994, CGA-54r8-3rgg-vcfw, CGA-68rw-85gr-hv7w, CGA-5h4f-wr2q-jq87
- Record: https://cvemate.com/vulnerability/CVE-2026-110816 · JSON: https://cvemate.com/vulnerability/CVE-2026-110816/json

## Description

````text
### Summary



`qs.stringify` with `arrayFormat: 'comma'` throws `TypeError: Cannot convert object to primitive value` when an array element cannot be coerced to a string, such as an object with an own non-callable `toString` (`{ "toString": "x" }`) or a null-prototype object. The comma format joins array elements with `Array.prototype.join` and, under `encodeValuesOnly`, first passes each element through `String()` in `utils.encode`; neither guards against an element whose string coercion fails.



### Details



In `lib/stringify.js`, the comma branch collapses the array with `obj.join(',')`. For an element whose own `toString` is not callable, `ToPrimitive` skips it, falls through to `Object.prototype.valueOf` (which returns the object itself), and throws. Under `encodeValuesOnly: true`, the same element first reaches `String(str)` in `utils.encode` (`lib/utils.js`) and throws there. Nested arrays (`{ "a": [[{ "toString": "x" }]] }`) throw the same way, through `Array.prototype.toString`. The `indices`, `brackets`, and `repeat` formats walk into object elements instead of coercing them, and are not affected.



Such elements can come from untrusted input. `JSON.parse` produces `{ "a": [{ "toString": "x" }] }` with no qs option involved. `qs.parse("a[0][toString]=x", { allowPrototypes: true })` keeps the `toString` key, and `qs.parse("a[][b]=c", { plainObjects: true })` produces a null-prototype element; the default parse options drop `toString` and produce ordinary objects, which do not throw. Express 4's default `query parser`, Express 5's `extended` query parser, and body-parser's `urlencoded({ extended: true })` all call `qs.parse` with `allowPrototypes: true`.



#### PoC



```js



var qs = require("qs");



qs.stringify(JSON.parse("{\"a\":[{\"toString\":\"x\"}]}"), { arrayFormat: "comma" });



qs.stringify(qs.parse("a[0][toString]=x", { allowPrototypes: true }), { arrayFormat: "comma" });



qs.stringify(qs.parse("a[][b]=c", { plainObjects: true }), { arrayFormat: "comma", encodeValuesOnly: true });



// TypeError: Cannot convert object to primitive value



```



#### Fix



Applied in a952e75 on `main` and released as v6.16.1: an element whose string coercion would fail is coerced to its primitive `valueOf`, if any, or else to `Object.prototype.toString`, so it renders as `[object Object]`, the same as any other object element already does under the comma format. Nested arrays are walked the way `join` walks them. Every input that did not previously throw serializes exactly as before, and a `toString` or `valueOf` that itself throws still propagates.



### Affected versions



`>=6.7.0 <6.16.1`, fixed in v6.16.1.



The `join` path was introduced with the comma format in b84acba and first shipped in v6.7.0; v6.6.x and earlier ignore `arrayFormat: 'comma'` and are not affected. The `encodeValuesOnly` `String()` site was introduced in 4c4b23d (v6.11.1); before that, the same input throws at `join`. Every release from v6.7.0 through v6.16.0 is affected.



### Impact



An unauthenticated request can make any code path that re-serializes attacker-influenced data with `qs.stringify` and `arrayFormat: 'comma'` (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 bare `http` request handler, the process exits, so the impact in that case depends on the application error handling rather than on qs. The default `arrayFormat` (`indices`) is not affected.
````

## Signals

- CVSS: 6.3 medium (v4.0, CVE.org) 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
- EPSS: 0.423%, percentile 38.603%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 55)

- chainguard arangodb-3.12 (Chainguard): All versions (No fix recorded) \| \< 3.12.12.1-r13
- chainguard azurite (Chainguard): All versions (No fix recorded) \| \< 3.37.0-r10
- chainguard dotstatsuite-supercore (Chainguard): All versions (No fix recorded) \| \< 3.1.0\_git20261022-r3
- chainguard eco-jess (Chainguard): All versions (No fix recorded) \| \< 2026.10.28.40754326399001-r0
- chainguard gitlab-rails-ce-18.10 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-18.8 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-18.9 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-19.2 (Chainguard): All versions (No fix recorded) \| \< 19.2.9-r3
- chainguard gitlab-rails-ce-19.4 (Chainguard): All versions (No fix recorded) \| \< 19.4.3-r13
- chainguard gitlab-rails-ce-19.5 (Chainguard): All versions (No fix recorded) \| \< 19.5.1-r7
- chainguard gitlab-rails-ce-fips-18.8 (Chainguard): All versions (No fix recorded)
- chainguard http-https-echo (Chainguard): All versions (No fix recorded) \| \< 43-r1
- chainguard http-https-echo-fips (Chainguard): All versions (No fix recorded) \| \< 43-r1
- chainguard json-server (Chainguard): All versions (No fix recorded) \| \< 0.17.4-r16
- chainguard kibana-9.2 (Chainguard): All versions (No fix recorded)
- chainguard kibana-9.3 (Chainguard): All versions (No fix recorded)
- chainguard opensearch-dashboards-3 (Chainguard): All versions (No fix recorded) \| \< 3.9.0-r6
- chainguard opensearch-dashboards-3-dashboards-query-workbench (Chainguard): All versions (No fix recorded) \| \< 3.9.0-r6
- chainguard opensearch-dashboards-3-index-management-dashboards-plugin (Chainguard): All versions (No fix recorded) \| \< 3.9.0-r6
- chainguard opensearch-dashboards-3-security-dashboards-plugin (Chainguard): All versions (No fix recorded) \| \< 3.9.0-r6

## References

- <https://github.com/ljharb/qs/security/advisories/GHSA-6pq8-jhm2-2vcw>
- <https://github.com/ljharb/qs/commit/a952e7519338ef0cfb25694a2988848f93333727>
- <https://security-tracker.debian.org/tracker/CVE-2026-110816>
- <https://ubuntu.com/security/CVE-2026-110816>
- <https://www.cve.org/CVERecord?id=CVE-2026-110816>
- <https://nvd.nist.gov/vuln/detail/CVE-2026-110816>
- <https://github.com/ljharb/qs>
- <https://github.com/ljharb/qs/releases/tag/v6.16.1>
- <https://npmjs.com/qs>
- <https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/110xxx/CVE-2026-110816.json>

---

Data as of 2026-12-05T09:09:15.399Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
