Skip to content

CVE-2026-110910 qs.stringify with allowEmptyArrays does not encode the keys of empty arrays, allowing query string parameter injection

MediumCVSS 6.3 EPSS 0.29%
Published
Updated
Exploit status
No public exploit known

Description

Summary

qs.stringify with allowEmptyArrays: true writes the key of an empty array without encoding it, even though keys are encoded by default. A key that contains & (or the configured delimiter), =, or # therefore becomes query string syntax instead of data, so a caller-supplied key name can add parameters to the serialized query string, or cut it short.

Details

In lib/stringify.js, the allowEmptyArrays branch returns adjustedPrefix + '[]' early, before the code that passes every other key through encoder and formatter. So { "x&k=v": ["1"] } serializes as x%26k%3Dv%5B0%5D=1, but { "x&k=v": [] } serializes as x&k=v[]. The early return applies at any depth ({ "a": { "b&k=v": [] } } gives a[b&k=v][]), under every arrayFormat, with allowDots, and with a custom encoder, which is never called for that key. With encode: false or encodeValuesOnly: true, keys are intentionally left unencoded on every path; those configurations are not affected.

PoC




var qs = require("qs");



var query = qs.stringify({ q: "hi", "x&apiKey=evil&y": [] }, { allowEmptyArrays: true });



// "q=hi&x&apiKey=evil&y[]"



qs.parse(query);



// { q: "hi", x: "", apiKey: "evil", y: [""] }



qs.stringify({ "x#": [], z: "1" }, { allowEmptyArrays: true });



// "x#[]&z=1": in a URL, everything after "#" becomes the fragment



Fix

Applied in 234d505 on main and released as v6.17.0, and backported to v6.16.2, v6.15.4, v6.14.3, v6.13.4, and v6.12.6: the key of an empty array goes through encoder and formatter exactly as the key of any other value does, so { "x&apiKey=evil&y": [] } now serializes as x%26apiKey%3Devil%26y[]. Keys that need no encoding serialize as before, with two exceptions that match every other path: the brackets of a nested key are now encoded (a[b][] becomes a%5Bb%5D[], which qs.parse reads identically), and with encodeDotInKeys, a dot in the key becomes %252E instead of %2E (which decodeDotInKeys previously misread as nesting).

Affected versions

  • >=6.12.0 <6.12.6, fixed in v6.12.6

  • >=6.13.0 <6.13.4, fixed in v6.13.4

  • >=6.14.0 <6.14.3, fixed in v6.14.3

  • >=6.15.0 <6.15.4, fixed in v6.15.4

  • >=6.16.0 <6.16.2, fixed in v6.16.2

v6.17.0 and later are not affected.

allowEmptyArrays was introduced in f22b2bc and first shipped in v6.12.0, with this early return. Earlier versions have no allowEmptyArrays option and are not affected.

Impact

An application that passes an object whose key names come from untrusted input to qs.stringify with allowEmptyArrays: true (for example, to forward a parsed JSON body or user-selected fields to an upstream service) can have parameters injected into the resulting query string. The injected parameters are not keys of the object, so deleting or overwriting a key on the object (such as setting a trusted apiKey after copying the user's fields) does not remove them; whether the attacker's value or the application's wins depends on how the receiving side handles a duplicate parameter. A # in such a key ends the query string early when the result is placed in a URL. allowEmptyArrays is off by default, and only keys whose value (after any filter) is an empty array are affected.

Affected products

ProductAffected versionsFixed in
npm qs(npm) >= 6.12.0, < 6.12.6 6.12.6
npm qs(npm) >= 6.13.0, < 6.13.4 6.13.4
npm qs(npm) >= 6.14.0, < 6.14.3 6.14.3
npm qs(npm) >= 6.15.0, < 6.15.4 6.15.4
npm qs(npm) >= 6.16.0, < 6.16.2 6.16.2
redhat/grafana13-2-main(Red Hat:hummingbird:1) < 13.2.4-0.6.hum1 13.2.4-0.6.hum1
redhat/ansible-automation-platform/automation-orchestrator-ui-rhel9(Red Hat:ansible_automation_orchestrator:2026.8) All versions No fix listed
redhat/costmanagement/costmanagement-ui-rhel10(Red Hat:cost_management_on_premise:1) All versions No fix listed
redhat/cryostat/cryostat-openshift-console-plugin-rhel9(Red Hat:cryostat:4) All versions No fix listed
redhat/mta/mta-solution-server-rhel9(Red Hat:migration_toolkit_applications:8) All versions No fix listed
redhat/mta/mta-ui-rhel9(Red Hat:migration_toolkit_applications:8) All versions No fix listed
redhat/rhmtc/openshift-migration-ui-rhel8(Red Hat:rhmt:1) All versions No fix listed
redhat/multicluster-engine/console-mce-rhel9(Red Hat:multicluster_engine) All versions No fix listed
redhat/workload-availability/node-healthcheck-must-gather-rhel9(Red Hat:workload_availability_nhc:0) All versions No fix listed
redhat/workload-availability/node-healthcheck-operator-bundle(Red Hat:workload_availability_nhc:0) All versions No fix listed
redhat/workload-availability/node-healthcheck-rhel9-operator(Red Hat:workload_availability_nhc:0) All versions No fix listed
redhat/openshift-lightspeed/lightspeed-agentic-console-rhel9(Red Hat:openshift_lightspeed:1) All versions No fix listed
redhat/openshift-lightspeed/lightspeed-console-plugin-419-rhel9(Red Hat:openshift_lightspeed:1) All versions No fix listed
redhat/openshift-lightspeed/lightspeed-console-plugin-pf5-rhel9(Red Hat:openshift_lightspeed:1) All versions No fix listed
redhat/openshift-lightspeed/lightspeed-console-plugin-rhel9(Red Hat:openshift_lightspeed:1) All versions No fix listed
redhat/openshift-pipelines/pipelines-console-plugin-pf5-rhel9(Red Hat:openshift_pipelines:1) All versions No fix listed
redhat/openshift-pipelines/pipelines-console-plugin-rhel8(Red Hat:openshift_pipelines:1) All versions No fix listed
redhat/openshift-pipelines/pipelines-console-plugin-rhel9(Red Hat:openshift_pipelines:1) All versions No fix listed
redhat/openshift-pipelines/pipelines-hub-ui-rhel8(Red Hat:openshift_pipelines:1) All versions No fix listed
redhat/openshift-pipelines/pipelines-hub-ui-rhel9(Red Hat:openshift_pipelines:1) All versions No fix listed
Show 102 more
ProductAffected versionsFixed in
redhat/openshift-serverless-1/kn-eventing-integrations-transform-jsonata-rhel9(Red Hat:serverless:1) All versions No fix listed
redhat/openshift-serverless-1/logic-rhel9-operator(Red Hat:serverless:1) All versions No fix listed
redhat/openshift-service-mesh/kiali-operator-bundle(Red Hat:service_mesh:3) All versions No fix listed
redhat/openshift-service-mesh/kiali-rhel9-operator(Red Hat:service_mesh:3) All versions No fix listed
redhat/rhacm2/console-rhel9(Red Hat:acm:2) All versions No fix listed
redhat/advanced-cluster-security/rhacs-main-rhel8(Red Hat:advanced_cluster_security:4) All versions No fix listed
redhat/advanced-cluster-security/rhacs-main-rhel9(Red Hat:advanced_cluster_security:4) All versions No fix listed
redhat/ansible-automation-platform-27/mcp-server-rhel9(Red Hat:ansible_automation_platform:2) All versions No fix listed
redhat/ansible-automation-platform-tech-preview/mcp-server-rhel9(Red Hat:ansible_automation_platform:2) All versions No fix listed
redhat/automation-gateway(Red Hat:ansible_automation_platform:2) All versions No fix listed
redhat/rhaf-camel-for-springboot-maven-repository.zip(Red Hat:camel_spring_boot:4) All versions No fix listed
redhat/rhaf-camel-maven-repository.zip(Red Hat:camel_spring_boot:4) All versions No fix listed
redhat/rhaf-camel-spring-boot-maven-repository.zip(Red Hat:camel_spring_boot:4) All versions No fix listed
redhat/rhaf-hawtio-maven-repository.zip(Red Hat:apache_camel_hawtio:4) All versions No fix listed
redhat/rh-podman-desktop(Red Hat:podman_desktop:1) All versions No fix listed
redhat/rhcl-1/rhcl-rhdh-dynamic-plugin-rhel9(Red Hat:connectivity_link:1) All versions No fix listed
redhat/redhat-datagrid-maven-repository.zip(Red Hat:jboss_data_grid:8) All versions No fix listed
redhat/rhdh/red-hat-developer-hub-backstage-plugin-lightspeed(Red Hat:rhdh:1) All versions No fix listed
redhat/rhdh/red-hat-developer-hub-backstage-plugin-lightspeed-backend(Red Hat:rhdh:1) All versions No fix listed
redhat/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator(Red Hat:rhdh:1) All versions No fix listed
redhat/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator-backend(Red Hat:rhdh:1) All versions No fix listed
redhat/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator-backend-module-loki(Red Hat:rhdh:1) All versions No fix listed
redhat/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator-form-widgets(Red Hat:rhdh:1) All versions No fix listed
redhat/rhdh/red-hat-developer-hub-backstage-plugin-scaffolder-backend-module-orchestrator(Red Hat:rhdh:1) All versions No fix listed
redhat/rhdh/rhdh-hub-rhel9(Red Hat:rhdh:1) All versions No fix listed
redhat/discovery/discovery-ui-rhel9(Red Hat:discovery:2::el8) All versions No fix listed
redhat/grafana(Red Hat:enterprise_linux:10) All versions No fix listed
redhat/grafana-pcp(Red Hat:enterprise_linux:10) All versions No fix listed
redhat/linux-sgx(Red Hat:enterprise_linux:10) All versions No fix listed
redhat/pcs(Red Hat:enterprise_linux:10) All versions No fix listed
redhat/linux-sgx(Red Hat:enterprise_linux:9) All versions No fix listed
redhat/pcs(Red Hat:enterprise_linux:9) All versions No fix listed
redhat/rhelai3/bootc-cuda-rhel9(Red Hat:enterprise_linux_ai:3) All versions No fix listed
redhat/rhelai3/bootc-gaudi-rhel9(Red Hat:enterprise_linux_ai:3) All versions No fix listed
redhat/rhelai3/bootc-rocm-rhel9(Red Hat:enterprise_linux_ai:3) All versions No fix listed
redhat/rhelai3/disk-image-cuda-rhel9(Red Hat:enterprise_linux_ai:3) All versions No fix listed
redhat/rhoai/odh-core-bff-rhel9(Red Hat:openshift_ai) All versions No fix listed
redhat/rhoai/odh-dashboard-operator-rhel9(Red Hat:openshift_ai) All versions No fix listed
redhat/rhoai/odh-dashboard-rhel9(Red Hat:openshift_ai) All versions No fix listed
redhat/rhoai/odh-feature-server-rhel9(Red Hat:openshift_ai) All versions No fix listed
redhat/rhoai/odh-mod-arch-agent-ops-rhel9(Red Hat:openshift_ai) All versions No fix listed
redhat/rhoai/odh-mod-arch-automl-rhel9(Red Hat:openshift_ai) All versions No fix listed
redhat/rhoai/odh-mod-arch-autorag-rhel9(Red Hat:openshift_ai) All versions No fix listed
redhat/rhoai/odh-mod-arch-eval-hub-rhel9(Red Hat:openshift_ai) All versions No fix listed
redhat/rhoai/odh-mod-arch-gen-ai-rhel9(Red Hat:openshift_ai) All versions No fix listed
redhat/rhoai/odh-mod-arch-maas-rhel9(Red Hat:openshift_ai) All versions No fix listed
redhat/rhoai/odh-mod-arch-mlflow-rhel9(Red Hat:openshift_ai) All versions No fix listed
redhat/rhoai/odh-mod-arch-model-registry-rhel9(Red Hat:openshift_ai) All versions No fix listed
redhat/rhoai/odh-workbench-codeserver-datascience-cpu-py312-rhel9(Red Hat:openshift_ai) All versions No fix listed
redhat/openshift4/ose-agent-installer-ui-rhel9(Red Hat:openshift:4) All versions No fix listed
redhat/openshift4/ose-console-rhel9(Red Hat:openshift:4) All versions No fix listed
redhat/openshift4/ose-monitoring-plugin-rhel9(Red Hat:openshift:4) All versions No fix listed
redhat/openshift5/ose-agent-installer-ui-rhel9(Red Hat:openshift:5) All versions No fix listed
redhat/openshift5/ose-monitoring-plugin-rhel9(Red Hat:openshift:5) All versions No fix listed
redhat/odf4/mcg-core-rhel9(Red Hat:openshift_data_foundation:4) All versions No fix listed
redhat/devspaces/code-rhel9(Red Hat:openshift_devspaces:3) All versions No fix listed
redhat/devspaces/dashboard-rhel9(Red Hat:openshift_devspaces:3) All versions No fix listed
redhat/devspaces/jetbrains-ide-rhel9(Red Hat:openshift_devspaces:3) All versions No fix listed
redhat/devspaces/openvsx-rhel9(Red Hat:openshift_devspaces:3) All versions No fix listed
redhat/devspaces/pluginregistry-rhel9(Red Hat:openshift_devspaces:3) All versions No fix listed
redhat/openshift-gitops-1/argocd-rhel9(Red Hat:openshift_gitops:1) All versions No fix listed
redhat/quay/quay-rhel8(Red Hat:quay:3) All versions No fix listed
redhat/quay/quay-rhel9(Red Hat:quay:3) All versions No fix listed
redhat/satellite/iop-remediations-rhel9(Red Hat:satellite:6) All versions No fix listed
redhat/rhtpa/rhtpa-trustification-service-rhel9(Red Hat:trusted_profile_analyzer:2) All versions No fix listed
redhat/rhtpa/rhtpa-rhel10(Red Hat:trusted_profile_analyzer:3) All versions No fix listed
redhat/external-secrets-management/console-plugin-rhel9(Red Hat:secrets_management_console:0) All versions No fix listed
redhat/ansible-automation-platform/automation-portal(Red Hat:ansible_portal:2) All versions No fix listed
redhat/ansible-automation-platform/bootc-automation-portal-rhel9(Red Hat:ansible_portal:2) All versions No fix listed
debian/node-qs(Debian:12) All versions No fix listed
debian/node-qs(Debian:12) = 6.11.0+ds+~6.9.7-3 No fix listed
debian/node-qs(Debian:12) = 6.11.0+ds+~6.9.7-4 No fix listed
debian/node-qs(Debian:12) = 6.13.0+ds+~6.9.16-1 No fix listed
debian/node-qs(Debian:12) = 6.14.1+ds+~6.14.0-1 No fix listed
debian/node-qs(Debian:12) = 6.15.0+ds+~6.15.0-1 No fix listed
debian/node-qs(Debian:12) = 6.15.0+ds+~6.15.0-2 No fix listed
debian/node-qs(Debian:12) = 6.15.0+ds+~6.15.0-3 No fix listed
debian/node-qs(Debian:12) = 6.15.2+ds+~6.15.1-1 No fix listed
debian/node-qs(Debian:12) = 6.16.0+ds+~6.15.1-1 No fix listed
debian/node-qs(Debian:13) All versions No fix listed
debian/node-qs(Debian:13) = 6.13.0+ds+~6.9.16-1 No fix listed
debian/node-qs(Debian:13) = 6.14.1+ds+~6.14.0-1 No fix listed
debian/node-qs(Debian:13) = 6.15.0+ds+~6.15.0-1 No fix listed
debian/node-qs(Debian:13) = 6.15.0+ds+~6.15.0-2 No fix listed
debian/node-qs(Debian:13) = 6.15.0+ds+~6.15.0-3 No fix listed
debian/node-qs(Debian:13) = 6.15.2+ds+~6.15.1-1 No fix listed
debian/node-qs(Debian:13) = 6.16.0+ds+~6.15.1-1 No fix listed
debian/node-qs(Debian:14) All versions No fix listed
debian/node-qs(Debian:14) = 6.13.0+ds+~6.9.16-1 No fix listed
debian/node-qs(Debian:14) = 6.14.1+ds+~6.14.0-1 No fix listed
debian/node-qs(Debian:14) = 6.15.0+ds+~6.15.0-1 No fix listed
debian/node-qs(Debian:14) = 6.15.0+ds+~6.15.0-2 No fix listed
debian/node-qs(Debian:14) = 6.15.0+ds+~6.15.0-3 No fix listed
debian/node-qs(Debian:14) = 6.15.2+ds+~6.15.1-1 No fix listed
debian/node-qs(Debian:14) = 6.16.0+ds+~6.15.1-1 No fix listed
ubuntu/node-qs(Ubuntu:22.04) All versions No fix listed
ubuntu/node-qs(Ubuntu:24.04) All versions No fix listed
ubuntu/node-qs(Ubuntu:26.04) All versions No fix listed
ubuntu/node-qs(Ubuntu:26.10) All versions No fix listed
azure linux grafana-pcp(Azure Linux:4.0) All versions No fix listed
azure linux python-nbdime(Azure Linux:4.0) All versions No fix listed
azure linux yarnpkg(Azure Linux:4.0) All versions No fix listed

References