CVE-2025-25289: @octokit/request-error has a Regular Expression in index that Leads to ReDoS Vulnerability Due to Catastrophic Backtracking

Published Feb 14, 2025
·
Updated

@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.

Other sources

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: js 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: js 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 The gist of PoC.js 1. run npm i @octokit/request-error 2. run 'node poc.js' result: 3. then the program will stuck forever with high CPU usage js 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 authorization headers 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.

— GitHub

Affected Software

2 affected componentsFixes available
npm/@octokit/request-error>=6.0.0<6.1.7
6.1.7
npm/@octokit/request-error>=1.0.0<5.1.1
5.1.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/@octokit/request-error to a version that resolves this vulnerability.

    Fixed in 6.1.7
  2. Upgrade

    Upgrade npm/@octokit/request-error to a version that resolves this vulnerability.

    Fixed in 5.1.1
  3. Upgrade

    Upgrade @octokit/request-error to a version that resolves this vulnerability.

    Fixed in 6.1.7

Event History

Feb 14, 2025
Advisory Published
via GitHub·05:58 PM
CVE Published
via MITRE·07:35 PM
Data Sourced
via MITRE·07:35 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:15 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

What is the severity of CVE-2025-25289?

CVE-2025-25289 is classified as a Regular Expression Denial of Service (ReDoS) vulnerability.

2

How do I fix CVE-2025-25289?

To fix CVE-2025-25289, upgrade the @octokit/request-error package to version 6.1.7 or later.

3

What software is affected by CVE-2025-25289?

CVE-2025-25289 affects versions of the @octokit/request-error package from 1.0.0 to 6.1.6.

4

How does CVE-2025-25289 work?

CVE-2025-25289 works by exploiting inefficient regular expressions in processing HTTP request headers with excessively long input.

5

What type of vulnerability is CVE-2025-25289?

CVE-2025-25289 is a denial of service vulnerability caused by regular expression processing issues.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203