← VULNERABILITIES

DHI-iuqm-fs2t-5bag-vpb3

### Summary

UnscoredFix available
CVSS
—
EPSS
—
Published
2026-11-20
Age
14d old
Modified
2026-12-03
Product
Docker Hardened Images:Debian:13 argocd-3.3-dev

Description

### 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": [{ "t

Fixed in

1.7.21-5 · 1.7.22-2

Affected packages

EcosystemPackageRangeFixed
Docker Hardened Images:Debian:13grist>=0, <1.7.21-51.7.21-5
Docker Hardened Images:Debian:13grist>=1.7.21-9, <1.7.22-21.7.22-2

Sources

  • OSV · first seen 14d ago · CC-BY 4.0

References

JSON