{"answers":{"affected":"2 open source packages ship an affected version, including qs. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-2391 exists.","fix":"Upgrade qs to 6.14.2 or later.","what":"CVE-2026-2391 is a medium-severity denial of service vulnerability in qs_project:qs, published on 12 Feb 2026. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2026-2391 and fix it if it is affected.\n\nWhat it is: CVE-2026-2391 is a medium-severity denial of service vulnerability in qs_project:qs, published on 12 Feb 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-2391 exists.\n\nAffected packages and fixed versions:\n- qs (npm): affected from 6.7.0; fixed in 6.14.2\n- qs (npm): affected from 6.7.0; fixed in 6.14.2\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2026-2391/ (Markdown: https://insights.sbomify.com/CVE-2026-2391/index.md)","id":"CVE-2026-2391","markdown":"https://insights.sbomify.com/CVE-2026-2391/index.md","name":"CVE-2026-2391","record":{"aliases":["AZL-77594","AZL-77597","AZL-77601","AZL-77616","CLEANSTART-2026-BV94239","CLEANSTART-2026-FY63723","CLSA-2026-1791374489","CLSA-2026-1793098678","DEBIAN-CVE-2026-2391","ECHO-3167-7a3b-863d","GHSA-w7fw-mjwx-w883","MINI-328j-w6pw-p8vv","MINI-3x2m-w9jg-3p65","MINI-455c-7f3j-r6jq","MINI-45g4-3jj6-967c","MINI-59hw-w574-3cwq","MINI-5pqp-mvfc-fmhh","MINI-66cp-jv38-h2wm","MINI-73j9-q3f7-wx3m","MINI-7m5m-c7w3-hm3q","MINI-8v5m-49mj-6j9j","MINI-gmv8-pmjx-4x6f","MINI-hpqw-72x2-g6jv","MINI-j45g-8hf7-hrv8","MINI-j5hm-qmmq-p58m","MINI-j65h-9mw7-778r","MINI-j6hw-hmg9-wm6h","MINI-jhqp-q5rh-3vgw","MINI-r352-xwwv-7w5h","MINI-rc9g-46wh-49ff","MINI-w649-pj67-v4mf","MINI-wmrq-5gh2-vf66","MINI-x9h4-xwhm-98rj","ROOT-APP-NPM-CVE-2026-2391","UBUNTU-CVE-2026-2391"],"analysis":{"component_type":"library","fix_type":"patch","impacts":["denial_of_service"],"network_reachable":"yes","non_default_config":true,"product_category":"JavaScript query string parser","requires_auth":"none","summary":"Attackers can cause denial of service via memory exhaustion by bypassing array limits in comma-separated parsing when the comma option is enabled.","user_interaction":"not_required","vuln_class":"denial_of_service"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"harborist","cpe":[{"product":"qs","vendor":"qs_project"}],"cvss":{"score":6.3,"severity":"medium","source":"cna","vector":"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","version":"4.0"},"cwes":[{"id":"CWE-20","name":"Improper Input Validation"}],"description":"### Summary\nThe `arrayLimit` option in qs does not enforce limits for comma-separated values when `comma: true` is enabled, allowing attackers to cause denial-of-service via memory exhaustion. This is a bypass of the array limit enforcement, similar to the bracket notation bypass addressed in GHSA-6rw7-vpxm-498p (CVE-2025-15284).\n\n### Details\nWhen the `comma` option is set to `true` (not the default, but configurable in applications), qs allows parsing comma-separated strings as arrays (e.g., `?param=a,b,c` becomes `['a', 'b', 'c']`). However, the limit check for `arrayLimit` (default: 20) and the optional throwOnLimitExceeded occur after the comma-handling logic in `parseArrayValue`, enabling a bypass. This permits creation of arbitrarily large arrays from a single parameter, leading to excessive memory allocation.\n\n**Vulnerable code** (lib/parse.js: lines ~40-50):\n```js\nif (val \u0026\u0026 typeof val === 'string' \u0026\u0026 options.comma \u0026\u0026 val.indexOf(',') \u003e -1) {\n    return val.split(',');\n}\n\nif (options.throwOnLimitExceeded \u0026\u0026 currentArrayLength \u003e= options.arrayLimit) {\n    throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');\n}\n\nreturn val;\n```\nThe `split(',')` returns the array immediately, skipping the subsequent limit check. Downstream merging via `utils.combine` does not prevent allocation, even if it marks overflows for sparse arrays.This discrepancy allows attackers to send a single parameter with millions of commas (e.g., `?param=,,,,,,,,...`), allocating massive arrays in memory without triggering limits. It bypasses the intent of `arrayLimit`, which is enforced correctly for indexed (`a[0]=`) and bracket (`a[]=`) notations (the latter fixed in v6.14.1 per GHSA-6rw7-vpxm-498p).\n\n### PoC\n**Test 1 - Basic bypass:**\n```\nnpm install qs\n```\n\n```js\nconst qs = require('qs');\n\nconst payload = 'a=' + ','.repeat(25);  // 26 elements after split (bypasses arrayLimit: 5)\nconst options = { comma: true, arrayLimit: 5, throwOnLimitExceeded: true };\n\ntry {\n  const result = qs.parse(payload, options);\n  console.log(result.a.length);  // Outputs: 26 (bypass successful)\n} catch (e) {\n  console.log('Limit enforced:', e.message);  // Not thrown\n}\n```\n**Configuration:**\n- `comma: true`\n- `arrayLimit: 5`\n- `throwOnLimitExceeded: true`\n\nExpected: Throws \"Array limit exceeded\" error.\nActual: Parses successfully, creating an array of length 26.\n\n### Impact\nDenial of Service (DoS) via memory exhaustion.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"qs's arrayLimit bypass in comma parsing allows denial of service","id":"CVE-2026-2391","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"denial_of_service","year":"2026"},"n_packages":2,"n_references":2,"next":{"headline":"Server-Side Request Forgery (SSRF) in mlflow/mlflow","id":"CVE-2026-2393"},"packages":[{"ecosystem":"npm","fixed":["6.14.2"],"introduced":["6.7.0"],"last_affected":[],"package":"qs","purl":null,"source":"GHSA-w7fw-mjwx-w883"},{"ecosystem":"npm","fixed":["6.14.2"],"introduced":["6.7.0"],"last_affected":[],"package":"qs","purl":"pkg:npm/qs","source":"GHSA-w7fw-mjwx-w883"}],"prev":{"headline":"Powerkit \u003c= 3.0.4 - Authenticated (Contributor+) Stored Cross-Site Scripting via Lazy Load Image Processing","id":"CVE-2026-2390"},"products":["qs_project:qs"],"published":"2026-02-12","related":[{"cvss_score":7.5,"headline":"Denial-of-Service Extended Event Loop Blocking in qs","id":"CVE-2014-10064","kev_date_added":null,"published":"2018-05-31"},{"cvss_score":7.5,"headline":"Prototype Pollution Protection Bypass in qs","id":"CVE-2017-1000048","kev_date_added":null,"published":"2017-07-13"},{"cvss_score":6.3,"headline":"arrayLimit bypass in bracket notation allows DoS via memory exhaustion","id":"CVE-2025-15284","kev_date_added":null,"published":"2025-12-29"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"yes","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2026-02-12","vendors":["qs_project"]},"summary":"Attackers can cause denial of service via memory exhaustion by bypassing array limits in comma-separated parsing when the comma option is enabled.","url":"https://insights.sbomify.com/CVE-2026-2391/"}