5.3medium
@octokit/request-error has a Regular Expression in index that Leads to ReDoS Vulnerability Due to Catastrophic Backtracking
- Severity
- 5.3medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.65% (higher than 52% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-xx4v-prfh-6cgc
Description
@octokit/request-error is an error class for Octokit request errors. Starting in version 1.0.0 and prior to version 6.1.7, a Regular Expression Denial of Service (ReDoS) vulnerability exists in the processing of HTTP request headers. By sending an authorization header containing an excessively long sequence of spaces followed by a newline and "@", an attacker can exploit inefficient regular expression processing, leading to excessive resource consumption. This can significantly degrade server performance or cause a denial-of-service (DoS) condition, impacting availability. Version 6.1.7 contains a fix for the issue.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| octokit request-error.js | >= 1.0.0, < 6.1.7 | CVE List |
| @octokit/request-error (npm) | from 1.0.0 before 5.1.1, from 6.0.0 before 6.1.7 | GitHub Advisory Database |
All scores
| GitHub_M | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
| GitHub | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
Classification
SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.
What each source says
CVE List
@octokit/request-error is an error class for Octokit request errors. Starting in version 1.0.0 and prior to version 6.1.7, a Regular Expression Denial of Service (ReDoS) vulnerability exists in the processing of HTTP request headers. By sending an authorization header containing an excessively long sequence of spaces followed by a newline and "@", an attacker can exploit inefficient regular expression processing, leading to excessive resource consumption. This can significantly degrade server performance or cause a denial-of-service (DoS) condition, impacting availability. Version 6.1.7 contains a fix for the issue.
GitHub Advisory Database
Summary
A Regular Expression Denial of Service (ReDoS) vulnerability exists in the processing of HTTP request headers. By sending an authorization header containing an excessively long sequence of spaces followed by a newline and "@", an attacker can exploit inefficient regular expression processing, leading to excessive resource consumption. This can significantly degrade server performance or cause a denial-of-service (DoS) condition, impacting availability.
Details
The issue occurs at line 52 of iterator.ts in the @octokit/request-error repository.
The vulnerability is caused by the use of an inefficient regular expression in the handling of the authorization header within the request processing logic:
authorization: options.request.headers.authorization.replace(
/ .*$/,
" [REDACTED]"
)
The regular expression / .*$/ matches a space followed by any number of characters until the end of the line. This pattern is vulnerable to Regular Expression Denial of Service (ReDoS) when processing specially crafted input. Specifically, an attacker can send an authorization header containing a long sequence of spaces followed by a newline and "@", such as:
headers: {
authorization: "" + " ".repeat(100000) + "\n@",
}
Due to the way JavaScript's regular expression engine backtracks while attempting to match the space followed by arbitrary characters, this input can cause excessive CPU usage, significantly slowing down or even freezing the server. This leads to a denial-of-service condition, impacting availability.
PoC
- run npm i @octokit/request-error
- run 'node poc.js' result:
- then the program will stuck forever with high CPU usage
import { RequestError } from "@octokit/request-error";
const error = new RequestError("Oops", 500, {
request: {
method: "POST",
url: "https://api.github.com/foo",
body: {
bar: "baz",
},
headers: {
authorization: ""+" ".repeat(100000)+"\n@",
},
},
response: {
status: 500,
url: "https://api.github.com/foo",
headers: {
"x-github-request-id": "1:2:3:4",
},
data: {
foo: "bar",
},
},
});
Impact
Vulnerability Type & Impact:
This is a Regular Expression Denial of Service (ReDoS) vulnerability, which occurs due to an inefficient regular expression (/ .*$/) used to sanitize the authorization header. An attacker can craft a malicious input that triggers excessive backtracking in the regex engine, leading to high CPU consumption and potential denial-of-service (DoS).
Who is Impacted?
- Projects or services using this code to process HTTP headers are vulnerable.
- Applications that rely on user-supplied
authorizationheaders are at risk, especially those processing a large volume of authentication requests. - Multi-tenant or API-driven platforms could experience degraded performance or service outages if exploited at scale.
NVD (es)
@octokit/request-error es una clase de error para los errores de solicitud de Octokit. A partir de la versión 1.0.0 y antes de la versión 6.1.7, existe una vulnerabilidad de denegación de servicio de expresión regular (ReDoS) en el procesamiento de encabezados de solicitud HTTP. Al enviar un encabezado de autorización que contiene una secuencia excesivamente larga de espacios seguidos de una nueva línea y "@", un atacante puede explotar un procesamiento ineficiente de expresiones regulares, lo que lleva a un consumo excesivo de recursos. Esto puede degradar significativamente el rendimiento del servidor o causar una condición de denegación de servicio (DoS), lo que afecta la disponibilidad. La versión 6.1.7 contiene una solución para el problema.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-25289 changed 2025-02-14 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-xx4v-prfh-6cgc changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2025-25289 changed 2026-06-17 | Public domain |