{"id":"CVE-2025-25289","aliases":["CVE-2025-25289","GHSA-xx4v-prfh-6cgc"],"related":[],"kind":"vulnerability","state":"published","title":"@octokit/request-error has a Regular Expression in index that Leads to ReDoS Vulnerability Due to Catastrophic Backtracking","summary":"@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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"@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.","source":"cvelist"},{"lang":"en","text":"### Summary\nA 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.\n### Details\nThe issue occurs at [line 52](https://github.com/octokit/request-error.js/blob/main/src/index.ts) of iterator.ts in the @octokit/request-error repository.\nThe vulnerability is caused by the use of an inefficient regular expression in the handling of the `authorization` header within the request processing logic:\n```js\nauthorization: options.request.headers.authorization.replace(\n  / .*$/, \n  \" [REDACTED]\"\n)\n```\nThe 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:\n```js\nheaders: {\n  authorization: \"\" + \" \".repeat(100000) + \"\\n@\",\n}\n```\nDue 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.\n### PoC\n[The gist of PoC.js](https://gist.github.com/ShiyuBanzhou/e1203ad22701fd043b8501eb37676a0d)\n1. run npm i @octokit/request-error\n2. run 'node poc.js'\nresult:\n3. then the program will stuck forever with high CPU usage\n```js\nimport { RequestError } from \"@octokit/request-error\";\n\nconst error = new RequestError(\"Oops\", 500, {\n  request: {\n    method: \"POST\",\n    url: \"https://api.github.com/foo\",\n    body: {\n      bar: \"baz\",\n    },\n    headers: {\n      authorization: \"\"+\" \".repeat(100000)+\"\\n@\",\n    },\n  },\n  response: {\n    status: 500,\n    url: \"https://api.github.com/foo\",\n    headers: {\n      \"x-github-request-id\": \"1:2:3:4\",\n    },\n    data: {\n      foo: \"bar\",\n    },\n  },\n});\n```\n\n### Impact\n#### Vulnerability Type & Impact:\nThis 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).\n#### Who is Impacted?\n* Projects or services using this code to process HTTP headers are vulnerable.\n* Applications that rely on user-supplied `authorization` headers are at risk, especially those processing a large volume of authentication requests.\n* Multi-tenant or API-driven platforms could experience degraded performance or service outages if exploited at scale.","format":"markdown","source":"ghsa"},{"lang":"es","text":"@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.","source":"nvd"}],"published":"2025-02-14T17:58:54.000Z","modified":"2026-09-10T03:50:06.165Z","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, < 6.1.7","status":"affected"}],"vendor":"octokit","product":"request-error.js","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"1.0.0","status":"affected","fixed":"5.1.1"}],"ecosystem":"npm","package":"@octokit/request-error","purl":"pkg:npm/%40octokit/request-error","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"6.0.0","status":"affected","fixed":"6.1.7"}],"ecosystem":"npm","package":"@octokit/request-error","purl":"pkg:npm/%40octokit/request-error","source":"ghsa"}],"references":[{"url":"https://github.com/octokit/request-error.js/security/advisories/GHSA-xx4v-prfh-6cgc","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/octokit/request-error.js/commit/d558320874a4bc8d356babf1079e6f0056a59b9e","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/octokit/request-error.js/blob/main/src/index.ts","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-25289","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/octokit/request-error.js","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2025-02-14T20:08:24.260Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-25289","url":"https://www.cve.org/CVERecord?id=CVE-2025-25289","licence":"CVE Terms of Use","modified":"2025-02-14T20:08:32.674Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-xx4v-prfh-6cgc","url":"https://github.com/advisories/GHSA-xx4v-prfh-6cgc","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:06.165Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-25289","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-25289","licence":"Public domain","modified":"2026-06-17T09:00:37.410Z"}],"updatedAt":"2026-11-25T22:58:54.115Z","epss":{"score":0.00654,"percentile":0.5262,"date":"2026-12-01T12:00:22.000Z"}}