Skip to content
Heist/ feed
Back to feed
Medium

node-qs — security advisory

Type: advisorySources: OSVAdvisory ID: UBUNTU-CVE-2026-8723

### Summary `qs.stringify` throws `TypeError` when called with `arrayFormat: 'comma'` and `encodeValuesOnly: true` on an array containing `null` or `undefined`. The throw is synchronous and not handled by any of qs's null-related options (`skipNulls`, `strictNullHandling`). ### Details In the comma + `encodeValuesOnly` branch, `lib/stringify.js:145` mapped the array through the raw encoder before joining: ```js obj = utils.maybeMap(obj, encoder); ``` `utils.encode` (`lib/utils.js:195`) reads `str.length` with no null guard, so a `null` or `undefined` element throws `TypeError`. `skipNulls` and `strictNullHandling` are both checked in the per-element loop below this line and never get a chance to run. Same class of bug as the filter-array path fixed in 0c180a4. The vulnerable shape of the comma + `encodeValuesOnly` branch was introduced in 4c4b23d ("encode comma values more consistently", PR #463, 2023-01-19), first released in v6.11.1. #### PoC ```js const qs = require('qs'); qs.stringify({ a: [null, 'b'] }, { arrayFormat: 'comma', encodeValuesOnly: true }); qs.stringify({ a: [undefined, 'b'] }, { arrayFormat: 'comma', encodeValuesOnly: true }); qs.stringify({ a: [null] }, { arrayFormat: 'comma', encodeValuesOnly: true }); // TypeError: Cannot read properties of null (reading 'length') // at encode (lib/utils.js:195:13) // at Object.maybeMap (lib/utils.js:322:37) // at stringify (lib/stringify.js:145:25) ``` #### Fix `lib/stringify.js:145`, applied in 21f80b3 on `main` and re

Products
node-qs
Affected versions
0.4.2-1, 0.6.5-1, 0.6.5-1ubuntu0.1~esm1, 2.2.4-1, 2.2.4-1ubuntu1, 6.10.1+ds-1, 6.10.2+ds+~6.9.7-1, 6.10.3+ds+~6.9.7-1, 6.11.0+ds+~6.9.7-3, 6.11.0+ds+~6.9.7-4, 6.13.0+ds+~6.9.16-1, 6.14.1+ds+~6.14.0-1, 6.15.2+ds+~6.15.1-1, 6.5.2-1, 6.9.0+ds-1, 6.9.1+ds-1, 6.9.1+ds-1ubuntu0.1~esm1, 6.9.4+ds-1
Fixed versions
Not specified
CVEs
CVE-2026-8723
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 03:24 UTC · Revision 1

Source evidence

UBUNTU-CVE-2026-8723

core-osv · Original source

Published 17 May 2026, 00:16 UTC

### Summary `qs.stringify` throws `TypeError` when called with `arrayFormat: 'comma'` and `encodeValuesOnly: true` on an array containing `null` or `undefined`. The throw is synchronous and not handled by any of qs's null-related options (`skipNulls`, `strictNullHandling`). ### Details In the comma + `encodeValuesOnly` branch, `lib/stringify.js:145` mapped the array through the raw encoder before joining: ```js obj = utils.maybeMap(obj, encoder); ``` `utils.encode` (`lib/utils.js:195`) reads `str.length` with no null guard, so a `null` or `undefined` element throws `TypeError`. `skipNulls` and `strictNullHandling` are both checked in the per-element loop below this line and never get a chance to run. Same class of bug as the filter-array path fixed in 0c180a4. The vulnerable shape of the comma + `encodeValuesOnly` branch was introduced in 4c4b23d ("encode comma values more consistently", PR #463, 2023-01-19), first released in v6.11.1. #### PoC ```js const qs = require('qs'); qs.stringify({ a: [null, 'b'] }, { arrayFormat: 'comma', encodeValuesOnly: true }); qs.stringify({ a: [undefined, 'b'] }, { arrayFormat: 'comma', encodeValuesOnly: true }); qs.stringify({ a: [null] }, { arrayFormat: 'comma', encodeValuesOnly: true }); // TypeError: Cannot read properties of null (reading 'length') // at encode (lib/utils.js:195:13) // at Object.maybeMap (lib/utils.js:322:37) // at stringify (lib/stringify.js:145:25) ``` #### Fix `lib/stringify.js:145`, applied in 21f80b3 on `main` and re

osv:UBUNTU-CVE-2026-8723

node-qs

Fixed versions: Not specified

node-qs

Fixed versions: Not specified

node-qs

Fixed versions: Not specified

node-qs

Fixed versions: Not specified

node-qs

Fixed versions: Not specified

node-qs

Fixed versions: Not specified

node-qs

Fixed versions: Not specified

node-qs

Fixed versions: Not specified

node-qs

Fixed versions: Not specified

Complete source record
{
  "id": "fc6eb2c58d52344835afe2b7d4b793b00d7dfc113b8523f81750fea8a70b31c6",
  "url": "https://osv.dev/vulnerability/UBUNTU-CVE-2026-8723",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "UBUNTU-CVE-2026-8723",
    "summary": "### Summary `qs.stringify` throws `TypeError` when called with `arrayFormat: 'comma'` and `encodeValuesOnly: true` on an array containing `null` or `undefined`. The throw is synchronous and not handled by any of qs's null-related options (`skipNulls`, `strictNullHandling`). ### Details In the comma + `encodeValuesOnly` branch, `lib/stringify.js:145` mapped the array through the raw encoder before joining: ```js obj = utils.maybeMap(obj, encoder); ``` `utils.encode` (`lib/utils.js:195`) reads `str.length` with no null guard, so a `null` or `undefined` element throws `TypeError`. `skipNulls` and `strictNullHandling` are both checked in the per-element loop below this line and never get a chance to run. Same class of bug as the filter-array path fixed in 0c180a4. The vulnerable shape of the comma + `encodeValuesOnly` branch was introduced in 4c4b23d (\"encode comma values more consistently\", PR #463, 2023-01-19), first released in v6.11.1. #### PoC ```js const qs = require('qs'); qs.stringify({ a: [null, 'b'] }, { arrayFormat: 'comma', encodeValuesOnly: true }); qs.stringify({ a: [undefined, 'b'] }, { arrayFormat: 'comma', encodeValuesOnly: true }); qs.stringify({ a: [null] }, { arrayFormat: 'comma', encodeValuesOnly: true }); // TypeError: Cannot read properties of null (reading 'length') // at encode (lib/utils.js:195:13) // at Object.maybeMap (lib/utils.js:322:37) // at stringify (lib/stringify.js:145:25) ``` #### Fix `lib/stringify.js:145`, applied in 21f80b3 on `main` and re",
    "evidence": "osv:UBUNTU-CVE-2026-8723",
    "products": [
      {
        "name": {
          "value": "node-qs",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "0.4.2-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "0.6.5-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "0.6.5-1ubuntu0.1~esm1",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "node-qs",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.2.4-1",
            "evidence": "/affected/1/versions"
          }
        ]
      },
      {
        "name": {
          "value": "node-qs",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.2.4-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "2.2.4-1ubuntu1",
            "evidence": "/affected/2/versions"
          }
        ]
      },
      {
        "name": {
          "value": "node-qs",
          "evidence": "/affected/3/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "6.5.2-1",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "6.9.0+ds-1",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "6.9.1+ds-1",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "6.9.1+ds-1ubuntu0.1~esm1",
            "evidence": "/affected/3/versions"
          }
        ]
      },
      {
        "name": {
          "value": "node-qs",
          "evidence": "/affected/4/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "6.9.4+ds-1",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "6.10.1+ds-1",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "6.10.2+ds+~6.9.7-1",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "6.10.3+ds+~6.9.7-1",
            "evidence": "/affected/4/versions"
          }
        ]
      },
      {
        "name": {
          "value": "node-qs",
          "evidence": "/affected/5/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "6.11.0+ds+~6.9.7-3",
            "evidence": "/affected/5/versions"
          },
          {
            "value": "6.11.0+ds+~6.9.7-4",
            "evidence": "/affected/5/versions"
          }
        ]
      },
      {
        "name": {
          "value": "node-qs",
          "evidence": "/affected/6/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "6.13.0+ds+~6.9.16-1",
            "evidence": "/affected/6/versions"
          }
        ]
      },
      {
        "name": {
          "value": "node-qs",
          "evidence": "/affected/7/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "6.14.1+ds+~6.14.0-1",
            "evidence": "/affected/7/versions"
          },
          {
            "value": "6.15.2+ds+~6.15.1-1",
            "evidence": "/affected/7/versions"
          }
        ]
      },
      {
        "name": {
          "value": "node-qs",
          "evidence": "/affected/8/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "6.13.0+ds+~6.9.16-1",
            "evidence": "/affected/8/versions"
          },
          {
            "value": "6.14.1+ds+~6.14.0-1",
            "evidence": "/affected/8/versions"
          }
        ]
      }
    ],
    "severity": "medium",
    "structured": {
      "id": "UBUNTU-CVE-2026-8723",
      "aliases": [
        "UBUNTU-CVE-2026-8723"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
        },
        {
          "type": "CVSS_V4",
          "score": "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"
        },
        {
          "type": "Ubuntu",
          "score": "medium"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "node-qs",
            "purl": "pkg:deb/ubuntu/node-qs?arch=source&distro=esm-infra-legacy%2Ftrusty",
            "ecosystem": "Ubuntu:Pro:14.04:LTS"
          },
          "versions": [
            "0.4.2-1",
            "0.6.5-1",
            "0.6.5-1ubuntu0.1~esm1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-8723.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "node-qs",
                "binary_version": "0.6.5-1ubuntu0.1~esm1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "node-qs",
            "purl": "pkg:deb/ubuntu/node-qs?arch=source&distro=xenial",
            "ecosystem": "Ubuntu:16.04:LTS"
          },
          "versions": [
            "2.2.4-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-8723.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "node-qs",
                "binary_version": "2.2.4-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "node-qs",
            "purl": "pkg:deb/ubuntu/node-qs?arch=source&distro=bionic",
            "ecosystem": "Ubuntu:18.04:LTS"
          },
          "versions": [
            "2.2.4-1",
            "2.2.4-1ubuntu1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-8723.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "node-qs",
                "binary_version": "2.2.4-1ubuntu1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "node-qs",
            "purl": "pkg:deb/ubuntu/node-qs?arch=source&distro=esm-apps%2Ffocal",
            "ecosystem": "Ubuntu:Pro:20.04:LTS"
          },
          "versions": [
            "6.5.2-1",
            "6.9.0+ds-1",
            "6.9.1+ds-1",
            "6.9.1+ds-1ubuntu0.1~esm1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-8723.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "node-qs",
                "binary_version": "6.9.1+ds-1ubuntu0.1~esm1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "node-qs",
            "purl": "pkg:deb/ubuntu/node-qs?arch=source&distro=jammy",
            "ecosystem": "Ubuntu:22.04:LTS"
          },
          "versions": [
            "6.9.4+ds-1",
            "6.10.1+ds-1",
            "6.10.2+ds+~6.9.7-1",
            "6.10.3+ds+~6.9.7-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-8723.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "node-qs",
                "binary_version": "6.10.3+ds+~6.9.7-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "node-qs",
            "purl": "pkg:deb/ubuntu/node-qs?arch=source&distro=noble",
            "ecosystem": "Ubuntu:24.04:LTS"
          },
          "versions": [
            "6.11.0+ds+~6.9.7-3",
            "6.11.0+ds+~6.9.7-4"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-8723.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "node-qs",
                "binary_version": "6.11.0+ds+~6.9.7-4"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "node-qs",
            "purl": "pkg:deb/ubuntu/node-qs?arch=source&distro=questing",
            "ecosystem": "Ubuntu:25.10"
          },
          "versions": [
            "6.13.0+ds+~6.9.16-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-8723.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "node-qs",
                "binary_version": "6.13.0+ds+~6.9.16-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "node-qs",
            "purl": "pkg:deb/ubuntu/node-qs?arch=source&distro=stonking",
            "ecosystem": "Ubuntu:26.10"
          },
          "versions": [
            "6.14.1+ds+~6.14.0-1",
            "6.15.2+ds+~6.15.1-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-8723.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "node-qs",
                "binary_version": "6.15.2+ds+~6.15.1-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "node-qs",
            "purl": "pkg:deb/ubuntu/node-qs?arch=source&distro=resolute",
            "ecosystem": "Ubuntu:26.04:LTS"
          },
          "versions": [
            "6.13.0+ds+~6.9.16-1",
            "6.14.1+ds+~6.14.0-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-8723.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "node-qs",
                "binary_version": "6.14.1+ds+~6.14.0-1"
              }
            ]
          }
        }
      ],
      "modified": "2026-10-17T13:01:14.264945332Z",
      "provider": "osv",
      "upstream": [
        "CVE-2026-8723"
      ],
      "references": [
        "https://ubuntu.com/security/CVE-2026-8723",
        "https://www.cve.org/CVERecord?id=CVE-2026-8723",
        "https://github.com/ljharb/qs/security/advisories/GHSA-q8mj-m7cp-5q26",
        "https://github.com/ljharb/qs/commit/21f80b33e5c8b3f7eba1034fff0da4a4a37a1d41"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2026-8723",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/1/score"
  },
  "source_id": "core-osv",
  "document_id": 361342,
  "published_at": "2026-05-17T00:16:00+00:00"
}