{"id":"CVE-2026-86251","aliases":["GHSA-72gr-qfp7-vwhw"],"summary":"h3 before 1.15.9 Path Traversal via Double Decoding","published_at":"2026-03-20T20:50:09Z","modified_at":"2026-09-18T09:26:12Z","products":[],"rating":{"severity":"high","score":8.2,"vector":"CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","attack_path":"internet_unauthenticated","user_interaction":false,"malicious":false,"red_hat":"Moderate","vendor_ratings":[{"source":"Red Hat","rating":"Moderate"}]},"fix_available":false,"kev":{"listed":false,"ransomware":false},"public_exploit":false,"exploits":[],"epss":{"score":0.004279999993741512,"percentile":0.37755998969078064,"date":"2026-11-19T00:00:00Z"},"priority":10.2,"details":"h3 versions before 1.15.9 contain a path traversal vulnerability in the serveStatic utility. A double-decoding flaw allows a request path containing double-encoded dot sequences (e.g. %252e%252e) to be decoded to %2e%2e, which survives resolveDotSegments() because that function only checks for literal '.' characters. When the resulting asset ID is resolved by URL-based backends (CDN, S3, object storage), %2e%2e is interpreted as '..' per RFC 3986, enabling path traversal to read arbitrary files from the backend.","affected_stack":[],"affected_other":[{"ecosystem":"CVE","package":"h3js/h3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.15.9"}]}],"fixed":["1.15.9"],"provider":"cvelistv5","source":"CVE-2026-86251","relation":"self"},{"ecosystem":"TuxCare:npm","package":"h3","purl":"pkg:npm/h3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.15.3-tuxcare.0"},{"fixed":"1.15.3-tuxcare.2"}]}],"versions":["1.15.3","1.15.3-tuxcare.1"],"fixed":["1.15.3-tuxcare.2"],"provider":"osv","source":"CLSA-2026-1790707412","relation":"upstream"},{"ecosystem":"npm","package":"h3","purl":"pkg:npm/h3","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.15.9"}]}],"fixed":["1.15.9"],"provider":"osv","source":"GHSA-72gr-qfp7-vwhw","relation":"self"}],"product_status":[{"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","cpe":"cpe:/a:redhat:openshift_ai","status":"affected","packages":["rhoai/odh-feature-server-rhel9"],"package_count":1,"fixed":[],"advisories":[],"note":"Fix deferred","provider":"redhat-vex","source":"CVE-2026-86251"}],"records":[{"provider":"osv","source_id":"CLSA-2026-1790707412","relation":"upstream","url":"https://osv.dev/vulnerability/CLSA-2026-1790707412","published_at":"2026-09-29T18:43:32Z","modified_at":"2026-10-15T09:47:57.310099Z","summary":"TuxCare security update for h3 (2 CVEs)","details":"TuxCare rebuilt h3 to address 2 CVEs. Fixed in 1.15.3-tuxcare.2.","severity":[],"affected":[{"ecosystem":"TuxCare:npm","package":"h3","purl":"pkg:npm/h3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.15.3-tuxcare.0"},{"fixed":"1.15.3-tuxcare.2"}]}],"versions":["1.15.3","1.15.3-tuxcare.1"],"fixed":["1.15.3-tuxcare.2"],"provider":"osv","source":"CLSA-2026-1790707412","relation":"upstream"}],"product_status":[],"references":[]},{"provider":"cvelistv5","source_id":"CVE-2026-86251","relation":"self","url":"https://www.cve.org/CVERecord?id=CVE-2026-86251","license":"CC-BY-4.0","published_at":"2026-09-06T12:00:26.881Z","modified_at":"2026-09-09T13:57:41.603Z","summary":"h3 before 1.15.9 Path Traversal via Double Decoding","details":"h3 versions before 1.15.9 contain a path traversal vulnerability in the serveStatic utility. A double-decoding flaw allows a request path containing double-encoded dot sequences (e.g. %252e%252e) to be decoded to %2e%2e, which survives resolveDotSegments() because that function only checks for literal '.' characters. When the resulting asset ID is resolved by URL-based backends (CDN, S3, object storage), %2e%2e is interpreted as '..' per RFC 3986, enabling path traversal to read arbitrary files from the backend.","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","source":"CVE-2026-86251"},{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","source":"CVE-2026-86251"}],"affected":[{"ecosystem":"CVE","package":"h3js/h3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.15.9"}]}],"fixed":["1.15.9"],"provider":"cvelistv5","source":"CVE-2026-86251","relation":"self"}],"product_status":[],"references":[{"type":"ADVISORY","url":"https://github.com/h3js/h3/security/advisories/GHSA-72gr-qfp7-vwhw"},{"type":"WEB","url":"https://www.vulncheck.com/advisories/h3-before-1.15.9-path-traversal-via-double-decoding"}]},{"provider":"osv","source_id":"GHSA-72gr-qfp7-vwhw","relation":"self","url":"https://osv.dev/vulnerability/GHSA-72gr-qfp7-vwhw","license":"CC-BY-4.0","published_at":"2026-03-20T20:50:09Z","modified_at":"2026-09-10T03:50:37.806165Z","summary":"h3: Double Decoding in `serveStatic` Bypasses `resolveDotSegments` Path Traversal Protection via `%252e%252e`","details":"## Summary\n\nThe `serveStatic` utility in h3 applies a redundant `decodeURI()` call to the request pathname after `H3Event` has already performed percent-decoding with `%25` preservation. This double decoding converts `%252e%252e` into `%2e%2e`, which bypasses `resolveDotSegments()` (since it checks for literal `.` characters, not percent-encoded equivalents). When the resulting asset ID is resolved by URL-based backends (CDN, S3, object storage), `%2e%2e` is interpreted as `..` per the URL Standard, enabling path traversal to read arbitrary files from the backend.\n\n## Details\n\nThe vulnerability is a conflict between two decoding stages:\n\n**Stage 1 — `H3Event` constructor** (`src/event.ts:65-69`):\n\n```typescript\nif (url.pathname.includes(\"%\")) {\n  url.pathname = decodeURI(\n    url.pathname.includes(\"%25\") ? url.pathname.replace(/%25/g, \"%2525\") : url.pathname,\n  );\n}\n```\n\nThis correctly preserves `%25` sequences by escaping them before decoding. A request for `/%252e%252e/etc/passwd` produces `event.url.pathname` = `/%2e%2e/etc/passwd` — the `%25` was preserved so `%252e` became `%2e` (not `.`).\n\n**Stage 2 — `serveStatic`** (`src/utils/static.ts:86-88`):\n\n```typescript\nconst originalId = resolveDotSegments(\n  decodeURI(withLeadingSlash(withoutTrailingSlash(event.url.pathname))),\n);\n```\n\nThis applies a **second** `decodeURI()`, which decodes `%2e` → `.`, producing `/../../../etc/passwd`. However, the decoding happens *inside* the `resolveDotSegments()` call argument — `decodeURI` runs first, then `resolveDotSegments` processes the result.\n\nWait — re-examining the flow more carefully:\n\n1. Input pathname after event.ts: `/%2e%2e/%2e%2e/etc/passwd`\n2. `decodeURI()` in static.ts converts `%2e` → `.`, producing: `/../../../etc/passwd`\n3. `resolveDotSegments(\"/../../../etc/passwd\")` **does** resolve `..` segments, clamping to `/etc/passwd`\n\nThe actual bypass is subtler. `decodeURI()` does **not** decode `%2e` — it only decodes characters that `encodeURI` would encode. Since `.` is never encoded by `encodeURI`, `%2e` is **not** decoded by `decodeURI()`. So the chain is:\n\n1. Request: `/%252e%252e/%252e%252e/etc/passwd`\n2. After event.ts decode: `/%2e%2e/%2e%2e/etc/passwd`\n3. `decodeURI()` in static.ts: `/%2e%2e/%2e%2e/etc/passwd` (unchanged — `decodeURI` doesn't decode `%2e`)\n4. `resolveDotSegments()` fast-returns at line 56 because `%2e` contains no literal `.` character:\n   ```typescript\n   if (!path.includes(\".\")) {\n     return path;\n   }\n   ```\n5. Asset ID `/%2e%2e/%2e%2e/etc/passwd` is passed to `getMeta()` and `getContents()` callbacks\n6. URL-based backends resolve `%2e%2e` as `..` per RFC 3986 / URL Standard\n\nThe root cause is `resolveDotSegments()` only checks for literal `.` characters and does not account for percent-encoded dot sequences (`%2e`). The `decodeURI()` in static.ts is redundant (event.ts already decodes) but is not the direct cause — the real gap is that `%2e%2e` survives as a traversal payload through both decoding stages and `resolveDotSegments`.\n\n## PoC\n\n**1. Create a minimal h3 server with a URL-based static backend:**\n\n```javascript\n// server.mjs\nimport { H3, serveStatic } from \"h3\";\nimport { serve } from \"srvx\";\n\nconst app = new H3();\n\napp.get(\"/**\", (event) => {\n  return serveStatic(event, {\n    getMeta(id) {\n      console.log(\"[getMeta] asset ID:\", id);\n      // Simulate URL-based backend (CDN/S3)\n      const url = new URL(id, \"https://cdn.example.com/static/\");\n      console.log(\"[getMeta] resolved URL:\", url.href);\n      return { type: \"text/plain\" };\n    },\n    getContents(id) {\n      console.log(\"[getContents] asset ID:\", id);\n      const url = new URL(id, \"https://cdn.example.com/static/\");\n      console.log(\"[getContents] resolved URL:\", url.href);\n      return `Fetched from: ${url.href}`;\n    },\n  });\n});\n\nserve({ fetch: app.fetch, port: 3000 });\n```\n\n**2. Send the double-encoded traversal request:**\n\n```bash\ncurl -v 'http://localhost:3000/%252e%252e/%252e%252e/etc/passwd'\n```\n\n**3. Observe server logs:**\n\n```\n[getMeta] asset ID: /%2e%2e/%2e%2e/etc/passwd\n[getMeta] resolved URL: https://cdn.example.com/etc/passwd\n[getContents] asset ID: /%2e%2e/%2e%2e/etc/passwd\n[getContents] resolved URL: https://cdn.example.com/etc/passwd\n```\n\nThe `%2e%2e` sequences in the asset ID are resolved as `..` by the `URL` constructor, causing the backend URL to traverse from `/static/` to `/etc/passwd`.\n\n## Impact\n\n- **Arbitrary file read from backend storage:** An unauthenticated attacker can read files outside the intended static asset directory on any URL-based backend (CDN origins, S3 buckets, object storage, reverse-proxied file servers).\n- **Sensitive data exposure:** Depending on the backend, this could expose configuration files, credentials, source code, or other tenants' data in shared storage.\n- **Affected deployments:** Applications using `serveStatic` with callbacks that resolve asset IDs via URL construction (`new URL(id, baseUrl)` or equivalent). This is a common pattern for CDN proxying and cloud object storage backends. Filesystem-based backends using `path.join()` are not affected since `%2e%2e` is not resolved as a traversal sequence by filesystem APIs.\n\n## Recommended Fix\n\nThe `resolveDotSegments()` function must account for percent-encoded dot sequences. Additionally, the redundant `decodeURI()` in `serveStatic` should be removed since `H3Event` already handles decoding.\n\n**Fix 1 — Remove redundant `decodeURI` in `src/utils/static.ts:86-88`:**\n\n```diff\n  const originalId = resolveDotSegments(\n-   decodeURI(withLeadingSlash(withoutTrailingSlash(event.url.pathname))),\n+   withLeadingSlash(withoutTrailingSlash(event.url.pathname)),\n  );\n```\n\n**Fix 2 — Harden `resolveDotSegments` in `src/utils/internal/path.ts:55-73` to handle percent-encoded dots:**\n\n```diff\n export function resolveDotSegments(path: string): string {\n-  if (!path.includes(\".\")) {\n+  if (!path.includes(\".\") && !path.toLowerCase().includes(\"%2e\")) {\n     return path;\n   }\n   // Normalize backslashes to forward slashes to prevent traversal via `\\`\n-  const segments = path.replaceAll(\"\\\\\", \"/\").split(\"/\");\n+  const segments = path.replaceAll(\"\\\\\", \"/\")\n+    .replaceAll(/%2e/gi, \".\")\n+    .split(\"/\");\n   const resolved: string[] = [];\n```\n\nBoth fixes should be applied. Fix 1 removes the unnecessary double-decode. Fix 2 provides defense-in-depth by ensuring `resolveDotSegments` cannot be bypassed with percent-encoded dots regardless of the caller.","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","source":"GHSA-72gr-qfp7-vwhw"}],"affected":[{"ecosystem":"npm","package":"h3","purl":"pkg:npm/h3","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.15.9"}]}],"fixed":["1.15.9"],"provider":"osv","source":"GHSA-72gr-qfp7-vwhw","relation":"self"}],"product_status":[],"references":[{"type":"WEB","url":"https://github.com/h3js/h3/security/advisories/GHSA-72gr-qfp7-vwhw"},{"type":"PACKAGE","url":"https://github.com/h3js/h3"}]},{"provider":"redhat-vex","source_id":"CVE-2026-86251","relation":"self","url":"https://access.redhat.com/security/cve/CVE-2026-86251","license":"CC-BY-4.0","published_at":"2026-09-06T12:00:26.881Z","modified_at":"2026-09-18T09:26:12Z","summary":"h3: h3: Information disclosure via path traversal due to double-decoding flaw","details":"A flaw was found in h3. A remote attacker could exploit a path traversal vulnerability in the serveStatic utility. This vulnerability arises from a double-decoding flaw, where specially crafted, double-encoded dot sequences in a request path are incorrectly processed. This allows an attacker to bypass security checks and read arbitrary files from backend storage systems, leading to information disclosure.","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","source":"CVE-2026-86251"},{"type":"Red Hat","score":"Moderate","source":"CVE-2026-86251"}],"affected":[],"product_status":[{"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","cpe":"cpe:/a:redhat:openshift_ai","status":"affected","packages":["rhoai/odh-feature-server-rhel9"],"package_count":1,"fixed":[],"advisories":[],"note":"Fix deferred","provider":"redhat-vex","source":"CVE-2026-86251"}],"references":[{"type":"WEB","url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-86251.json"},{"type":"WEB","url":"https://access.redhat.com/security/cve/CVE-2026-86251"},{"type":"WEB","url":"https://bugzilla.redhat.com/show_bug.cgi?id=2529161"},{"type":"WEB","url":"https://www.cve.org/CVERecord?id=CVE-2026-86251"},{"type":"WEB","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-86251"},{"type":"WEB","url":"https://github.com/h3js/h3/security/advisories/GHSA-72gr-qfp7-vwhw"},{"type":"WEB","url":"https://www.vulncheck.com/advisories/h3-before-1.15.9-path-traversal-via-double-decoding"}]}],"references":[{"type":"ADVISORY","url":"https://github.com/h3js/h3/security/advisories/GHSA-72gr-qfp7-vwhw"},{"type":"WEB","url":"https://www.vulncheck.com/advisories/h3-before-1.15.9-path-traversal-via-double-decoding"},{"type":"PACKAGE","url":"https://github.com/h3js/h3"},{"type":"WEB","url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-86251.json"},{"type":"WEB","url":"https://access.redhat.com/security/cve/CVE-2026-86251"},{"type":"WEB","url":"https://bugzilla.redhat.com/show_bug.cgi?id=2529161"},{"type":"WEB","url":"https://www.cve.org/CVERecord?id=CVE-2026-86251"},{"type":"WEB","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-86251"}],"sources":[{"provider":"osv","source_id":"CLSA-2026-1790707412","url":"https://osv.dev/vulnerability/CLSA-2026-1790707412","modified_at":"2026-10-15T09:47:57.310099Z","relation":"upstream"},{"provider":"cvelistv5","source_id":"CVE-2026-86251","url":"https://www.cve.org/CVERecord?id=CVE-2026-86251","license":"CC-BY-4.0","modified_at":"2026-09-09T13:57:41.603Z","relation":"self"},{"provider":"osv","source_id":"GHSA-72gr-qfp7-vwhw","url":"https://osv.dev/vulnerability/GHSA-72gr-qfp7-vwhw","license":"CC-BY-4.0","modified_at":"2026-09-10T03:50:37.806165Z","relation":"self"},{"provider":"redhat-vex","source_id":"CVE-2026-86251","url":"https://access.redhat.com/security/cve/CVE-2026-86251","license":"CC-BY-4.0","modified_at":"2026-09-18T09:26:12Z","relation":"self"}]}
