CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-42040

CVE-2026-42040: Null Byte Injection via Improper Parameter Serialization in Axios

Alon Barad
Alon Barad
Software Engineer

May 5, 2026·5 min read·37 visits

Executive Summary (TL;DR)

A logic flaw in Axios's URL parameter serializer reverts safely encoded null bytes (%00) back to raw null characters. This requires a specific non-default configuration to trigger but can lead to downstream parsing errors or WAF bypasses.

Axios versions prior to 0.31.1 and 1.x versions prior to 1.15.1 contain a Null Byte Injection vulnerability (CWE-626) in the AxiosURLSearchParams module. A logic defect in the internal parameter encoder incorrectly reverts safely encoded null bytes (%00) back into raw null byte characters. This flaw can facilitate path truncation attacks or security filter bypasses when interacting with vulnerable downstream systems.

Vulnerability Overview

Axios is a widely utilized promise-based HTTP client for browser and Node.js environments. The library includes various helper modules for data processing, including AxiosURLSearchParams, which handles the serialization of URL parameters. This specific module processes key-value pairs and converts them into URL-encoded query strings suitable for HTTP transmission.

A logic flaw exists within the internal encoding mechanism of this helper class, classified as a Null Byte Interaction Error (CWE-626). During the parameter serialization phase, the encoder applies a secondary replacement function after standard URI encoding. This secondary function is intended to restore specific characters for aesthetic or compatibility reasons.

Due to an incorrect mapping in this secondary step, safe URL-encoded null bytes (%00) are actively replaced with raw null byte characters (\x00). This results in the injection of literal null bytes into the final outgoing request payload. The vulnerability primarily affects environments utilizing Axios versions prior to 0.31.1, as well as the 1.x branch prior to version 1.15.1.

Root Cause Analysis

The defect resides in the post-processing phase of the encode utility within lib/helpers/AxiosURLSearchParams.js. The encode function is designed to take an input string, apply the native JavaScript encodeURIComponent function, and then run a custom regular expression replacement. The native function operates correctly, taking an input containing \x00 and converting it safely to %00.

The vulnerability is introduced by the custom replacement logic that immediately follows. The code utilizes a regular expression /[!'()~]|%20|%00/g to identify specific encoded sequences for further modification. When a match is found, the character sequence is passed to a lookup object named charMap to determine the final output string.

The charMap object contains a severe misconfiguration. It explicitly defines a mapping of '%00': '\x00', instructing the application to take the safe %00 string and convert it back into a raw, unencoded null byte. Consequently, any parameter value initially containing a null byte will successfully pass through the standard encoding phase only to be reverted to an unsafe state before transmission.

Code Analysis

An examination of the vulnerable source code clearly highlights the encoding regression. The charMap object serves as a static translation dictionary. While most entries handle standard character normalization, the final entry deliberately targets encoded null bytes.

const charMap = {
  '!': '%21',
  "'": '%27',
  '(': '%28',
  ')': '%29',
  '~': '%7E',
  '%20': '+',
  '%00': '\x00' // Vulnerable entry reversing safe encoding
};
 
function encode(val) {
  return encodeURIComponent(val).replace(/[!'()~]|%20|%00/g, (char) => {
    return charMap[char];
  });
}

The patched versions resolve this issue by removing both the dictionary entry and its corresponding trigger in the regular expression. This ensures that the native JavaScript encoding remains intact and is not tampered with by the secondary string replacement function.

const charMap = {
  '!': '%21',
  "'": '%27',
  '(': '%28',
  ')': '%29',
  '~': '%7E',
  '%20': '+'
};
 
function encode(val) {
  return encodeURIComponent(val).replace(/[!'()~]|%20/g, (char) => {
    return charMap[char];
  });
}

Exploitation Mechanics

Exploitation requires a high degree of complexity due to the non-default execution path. The standard Axios request flow, governed by buildURL.js, does not invoke the flawed AxiosURLSearchParams module by default. An application must explicitly configure a custom paramsSerializer or manually instantiate the vulnerable class to process user-supplied input.

If the prerequisite conditions are met, an attacker can submit a payload containing a literal null byte within a query parameter or form field. The application processes this input, passes it to the flawed serialization function, and constructs an HTTP request containing the raw \x00 byte. This request is then transmitted to the target backend or proxy infrastructure.

The success of the exploit ultimately depends on the behavior of the downstream sink. The raw null byte must cause a parsing anomaly, such as premature string termination in C/C++ backends or evaluation logic bypasses within a Web Application Firewall.

Impact Assessment

The primary security impact involves the manipulation of downstream systems that expect strictly conforming HTTP parameters. When a raw null byte is injected into a URL or form-encoded body, systems developed in memory-unsafe languages or utilizing legacy CGI parsers may interpret the byte as a string terminator. This forces the parser to discard the remainder of the parameter string, potentially altering application logic.

A secondary consequence is the potential to bypass security filters and Web Application Firewalls (WAFs). A WAF that performs strict validation against URL-encoded inputs may halt inspection upon encountering an unexpected raw null byte. This truncation allows malicious payloads appended after the null byte to pass through the filter undetected, arriving at the backend application intact.

Despite these vectors, the vulnerability is assigned a low CVSS score of 3.7. The high attack complexity, requirement for non-standard developer configurations, and reliance on specific downstream architecture significantly restrict the practical blast radius of this flaw.

Remediation and Mitigation

The definitive remediation strategy is upgrading the Axios dependency to a patched release. Development teams must ensure their package managers resolve Axios to version 1.15.1 or greater for the 1.x branch, or version 0.31.1 for legacy codebases. This fully removes the flawed mapping from the internal encoding module.

In environments where immediate patching is unfeasible, developers should audit their codebase for custom paramsSerializer implementations. Any logic that explicitly delegates parameter encoding to the AxiosURLSearchParams class should be temporarily replaced with native JavaScript URLSearchParams or standard encodeURIComponent calls.

As a defense-in-depth measure, all applications should implement strict input validation at the outer boundary. Unprintable control characters, including null bytes (\x00), should be actively sanitized or rejected before they reach underlying HTTP client libraries. This practice mitigates similar injection vectors across the application stack.

Technical Appendix

CVSS Score
3.7/ 10
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N
EPSS Probability
0.04%
Top 87% most exploited

Affected Systems

Axios HTTP Client (Node.js environments)Axios HTTP Client (Browser environments)

Affected Versions Detail

Product
Affected Versions
Fixed Version
Axios
Axios
< 0.31.10.31.1
Axios
Axios
>= 1.0.0, < 1.15.11.15.1
AttributeDetail
CWE IDCWE-626
Attack VectorNetwork
CVSS v3.1 Score3.7 (Low)
EPSS Score0.00044
Exploit StatusNone
CISA KEVFalse

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1562Impair Defenses
Defense Evasion
CWE-626
Null Byte Interaction Error

Null Byte Interaction Error (Poison Null Byte)

References & Sources

  • [1]GitHub Security Advisory GHSA-xhjh-pmcv-23jw
  • [2]NVD Vulnerability Detail CVE-2026-42040
  • [3]Axios Threat Model Documentation

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 1 hour ago•CVE-2026-11645
8.8

CVE-2026-11645: Out-of-Bounds Memory Access in Google Chrome V8 Engine

A high-severity memory corruption vulnerability exists in the V8 JavaScript engine of Google Chrome before versions 149.0.7827.102/103. The flaw arises from an incorrect bounds-check elimination during JIT compilation by the TurboFan optimizer, allowing remote attackers to achieve out-of-bounds read and write access inside the sandboxed renderer process.

Amit Schendel
Amit Schendel
8 views•6 min read
•about 9 hours ago•CVE-2026-50751
9.3

CVE-2026-50751: Authentication Bypass in Check Point Security Gateway IKEv1 Legacy Validation

An improper authentication vulnerability (CWE-287) exists in the legacy, deprecated Internet Key Exchange version 1 (IKEv1) key exchange protocol implementation in Check Point Security Gateways. The vulnerability is caused by a logic flow weakness during the certificate validation process for Remote Access VPN and Mobile Access (SSL VPN) connections. An unauthenticated remote attacker can exploit this weakness to bypass user authentication entirely, establishing a fully functional Remote Access VPN connection without a valid password.

Alon Barad
Alon Barad
54 views•6 min read
•about 23 hours ago•CVE-2026-39922
6.3

CVE-2026-39922: Server-Side Request Forgery in GeoNode Service Registration Endpoint

GeoNode versions prior to 4.4.5 and 5.0.2 are vulnerable to Server-Side Request Forgery (SSRF) in the service registration endpoint. Authenticated attackers with low privileges can exploit insufficient input validation in the Web Map Service (WMS) registration module to force the application server to make outbound network queries to loopback addresses, private RFC1918 subnets, link-local scopes, and cloud metadata endpoints. This technical report details the mechanics of the vulnerability, the underlying architectural flaw, and how to effectively remediate and mitigate the associated security risks.

Alon Barad
Alon Barad
4 views•7 min read
•1 day ago•CVE-2022-0492
7.8

CVE-2022-0492: Privilege Escalation and Container Escape via cgroups v1 release_agent

CVE-2022-0492 is a high-severity missing authorization vulnerability in the Linux kernel's Control Groups (cgroups) v1 implementation. The flaw resides within the cgroup_release_agent_write function in kernel/cgroup/cgroup-v1.c, where the kernel fails to validate if the process writing to the release_agent file possesses administrative capabilities in the initial user namespace. This allows a local attacker inside a container with root privileges (UID 0) to abuse user namespaces, mount a cgroups v1 directory, modify the release_agent parameter, and execute arbitrary commands on the host system as host root, effectively achieving a complete container escape.

Amit Schendel
Amit Schendel
12 views•7 min read
•3 days ago•GHSA-G72G-R7M4-9X4G
6.3

GHSA-G72G-R7M4-9X4G: Insufficient Session Expiration of OAuth Tokens in NocoDB

NocoDB is subject to an insufficient session expiration vulnerability where OAuth access and refresh tokens are not invalidated or revoked during security-sensitive actions such as password changes, forgot-password requests, or password resets. This allows an attacker possessing an active OAuth token to maintain unauthorized persistence.

Amit Schendel
Amit Schendel
12 views•6 min read
•3 days ago•GHSA-FGMC-2HQJ-86V4
6.9

GHSA-FGMC-2HQJ-86V4: Default Administrative Credentials in vantage6-server

A vulnerability in the vantage6 federated learning framework allows unauthenticated remote attackers to gain administrative control of the server via hardcoded default credentials (root/root) when deployed under default configurations in versions 4.2.3 and below.

Amit Schendel
Amit Schendel
8 views•5 min read