CVE-2026-110816
ŚrednieCVSS 5.3Prawdopodobieństwo exploitacji (EPSS)
Niskie ryzykoPercentyl 22 - wyżej niż 22% wszystkich znanych CVE
Streszczenie
Podatność w bibliotece qs dotyczy funkcji qs.stringify z opcją arrayFormat: 'comma', która zgłasza wyjątek TypeError, gdy element tablicy nie może zostać przekonwertowany na string (np. obiekt z własnym niecallowalnym toString lub obiekt z prototypem null). Problem występuje w wersjach od 6.7.0 do 6.16.0 i został naprawiony w wersji 6.16.1. Wejście może pochodzić z niezaufanych źródeł, m.in. przez JSON.parse lub qs.parse z allowPrototypes: true.
Ocena ryzyka
Atakujący może wysłać żądanie, które spowoduje wyjątek w kodzie aplikacji przetwarzającym dane przez qs.stringify z arrayFormat: 'comma', co w typowym frameworku Node.js skutkuje odpowiedzią 500, a w niektórych konfiguracjach (np. async handler w Express 4) może doprowadzić do zakończenia procesu. Domyślny format arrayFormat (indices) nie jest podatny.
Rekomendacja
Zaktualizuj bibliotekę qs do wersji 6.16.1 lub nowszej. Przejrzyj kod aplikacji pod kątem użycia qs.stringify z arrayFormat: 'comma' na danych pochodzących z niezaufanych źródeł i rozważ dodanie obsługi błędów.
Inne podatności w qs
Zobacz wszystkie- CVE-2026-110910Niskie
Podatność w bibliotece qs polega na tym, że przy opcji allowEmptyArrays: true klucz pustej tablicy jest zapisywany bez kodowania, mimo że domyślnie klucze są kodowane. Klucz zawierający znaki &, = lub # może wtedy wstrzyknąć dodatkowe parametry do serializowanego query stringa lub przedwcześnie go zakończyć. Problem dotyczy wersji od 6.12.0 do 6.12.5, od 6.13.0 do 6.13.3, od 6.14.0 do 6.14.2, od 6.15.0 do 6.15.3 oraz od 6.16.0 do 6.16.1.
- CVE-2026-82562Niskie
Podatność w bibliotece qs pozwala ominąć limit rozmiaru tablicy (arrayLimit) dla wartości rozdzielanych przecinkami, gdy używane są opcje comma: true i throwOnLimitExceeded: true. Dotyczy to kluczy w formie a[]=, gdzie wartość jest dzielona na tablicę bez sprawdzania limitu, co umożliwia alokację dowolnie dużej tablicy. Problem występuje w wersjach od 6.14.2 do 6.15.3 i został naprawiony w wersji 6.16.0.
- CVE-2026-82417Średnie
Funkcja `qs.stringify` w bibliotece qs rzuca wyjątek `TypeError`, gdy serializuje obiekt, którego własna właściwość `constructor` ma prawdziwą, ale niebędącą funkcją właściwość `isBuffer`. Sprawdzenie typu w `utils.isBuffer` wywołuje `obj.constructor.isBuffer(obj)` bez weryfikacji, czy jest to funkcja, co prowadzi do błędu. Podatność dotyczy wersji od 2.2.5 do 6.15.3, naprawiona w 6.16.0.
- CVE-2026-8723Średnie
Biblioteka qs w wersjach od 6.11.1 do 6.15.2 zawiera błąd, który powoduje synchroniczny wyjątek TypeError podczas wywołania qs.stringify z opcjami arrayFormat: 'comma' i encodeValuesOnly: true, gdy tablica zawiera element null lub undefined. Opcje skipNulls i strictNullHandling nie są wtedy respektowane, ponieważ błąd występuje przed ich sprawdzeniem. Podatność została naprawiona w wersji 6.15.2.
- CVE-2025-15284Niskie
Podatność w bibliotece qs (moduł parse) polega na nieprawidłowej walidacji danych wejściowych — opcja arrayLimit nie była egzekwowana dla notacji nawiasowej (a[]=1&a[]=2), a jedynie dla notacji indeksowanej (a[0]=1). Pozwala to na tworzenie tablic większych niż zdefiniowany limit. Domyślna wartość parameterLimit (1000) w praktyce ogranicza skalę problemu.
Oryginalny opis (angielski, źródło NVD)
### 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.
Dane podatności pochodzą z NVD (NIST) · CISA KEV · EPSS

