Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. axios
  4. ›
  5. CVE-2026-42040

CVE-2026-42040: Axios: Null Byte Injection via Reverse-Encoding in AxiosURLSearchParams

May 5, 2026

The encode() function in lib/helpers/AxiosURLSearchParams.js contains a character mapping (charMap) at line 21 that reverses the safe percent-encoding of null bytes. After encodeURIComponent('\x00') correctly produces the safe sequence %00, the charMap entry '%00': '\x00' converts it back to a raw null byte.

This is a clear encoding defect: every other charMap entry encodes in the safe direction (literal → percent-encoded), while this single entry decodes in the opposite (dangerous) direction.

Severity: Low (CVSS 3.7) Affected Versions: All versions containing this charMap entry Vulnerable Component: lib/helpers/AxiosURLSearchParams.js:21

References

  • github.com/advisories/GHSA-xhjh-pmcv-23jw
  • github.com/axios/axios
  • github.com/axios/axios/security/advisories/GHSA-xhjh-pmcv-23jw
  • nvd.nist.gov/vuln/detail/CVE-2026-42040

Code Behaviors & Features

Detect and mitigate CVE-2026-42040 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 0.31.1, all versions starting from 1.0.0 before 1.15.1

Fixed versions

  • 1.15.1
  • 0.31.1

Solution

Upgrade to versions 0.31.1, 1.15.1 or above.

Impact 3.7 LOW

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N

Learn more about CVSS

Weakness

  • CWE-116: Improper Encoding or Escaping of Output
  • CWE-626: Null Byte Interaction Error (Poison Null Byte)

Source file

npm/axios/CVE-2026-42040.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 09 May 2026 00:19:51 +0000.