{"id":"CVE-2026-73425","aliases":["EUVD-2026-57610","GHSA-hp3v-mfqw-h74c"],"status":"published","title":"@astrojs/netlify generates an overly-broad Netlify Image CDN allowlist because remotePatterns.pathname metacharacters are not escaped","description":"Astro is a web framework for content-driven websites. Prior to 8.1.2, the Astro Netlify adapter converts each image.remotePatterns entry into a regular expression written to .netlify/v1/config.json under images.remote_images for Netlify's Image CDN allowlist. In packages/integrations/netlify/src/index.ts, remotePatternToRegex() escapes dots in hostname values but interpolates literal pathname values without escaping regular expression metacharacters such as ., +, ?, (, and [, so a restrictive pathname such as /img/v1.0/file also matches metacharacter-adjacent paths, including paths that cross a segment. Netlify enforces the generated regular expression directly and Astro's matchPattern() helper does not revalidate the request, allowing optimization of images on an already-allowed host that the declared pathname was intended to exclude. This issue is fixed in version 8.1.2.","severity":{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","level":"low","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-12","score":0.00269,"percentile":0.19304,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-185"],"published":"2026-07-20T23:24:34Z","modified":"2026-10-28T02:30:47Z","fixes":[{"ecosystem":"npm","package":"@astrojs/netlify","fixed_in":["8.1.2"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"@astrojs/netlify","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"8.1.2"}]}]},{"source":"osv","ecosystem":"npm","package":"@astrojs/netlify","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"8.1.2"}]}]}],"products":[{"vendor":"withastro","product":"astro"}],"references":[{"url":"https://github.com/withastro/astro/security/advisories/GHSA-hp3v-mfqw-h74c","tags":["x_refsource_CONFIRM","advisory","web"]},{"url":"https://github.com/withastro/astro/pull/17018","tags":["web"]},{"url":"https://github.com/advisories/GHSA-529g-xq4f-cw38","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-73425","tags":["advisory"]},{"url":"https://github.com/withastro/astro/pull/17368","tags":["web"]},{"url":"https://github.com/withastro/astro/commit/ee74c289bfe32fb6a7f59ed97c5c22db16394b72","tags":["web"]},{"url":"https://github.com/withastro/astro/releases/tag/@astrojs/netlify@8.1.2","tags":["web"]},{"url":"https://github.com/advisories/GHSA-hp3v-mfqw-h74c"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/73xxx/CVE-2026-73425.json","tags":["advisory"]},{"url":"https://github.com/withastro/astro","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2026-73425","title":"@astrojs/netlify generates an overly-broad Netlify Image CDN allowlist because remotePatterns.pathname metacharacters are not escaped","description":"Astro is a web framework for content-driven websites. Prior to 8.1.2, the Astro Netlify adapter converts each image.remotePatterns entry into a regular expression written to .netlify/v1/config.json under images.remote_images for Netlify's Image CDN allowlist. In packages/integrations/netlify/src/index.ts, remotePatternToRegex() escapes dots in hostname values but interpolates literal pathname values without escaping regular expression metacharacters such as ., +, ?, (, and [, so a restrictive pathname such as /img/v1.0/file also matches metacharacter-adjacent paths, including paths that cross a segment. Netlify enforces the generated regular expression directly and Astro's matchPattern() helper does not revalidate the request, allowing optimization of images on an already-allowed host that the declared pathname was intended to exclude. This issue is fixed in version 8.1.2.","status":"published","published":"2026-08-12T20:41:10.564Z","modified":"2026-08-13T12:56:00.248Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","level":"low","assessor":"cna"}],"cwes":["CWE-185"],"updated_at":"2026-11-02T13:43:33.766176Z"}],"euvd":[{"id":"EUVD-2026-57610","description":"Astro is a web framework for content-driven websites. Prior to 8.1.2, the Astro Netlify adapter converts each image.remotePatterns entry into a regular expression written to .netlify/v1/config.json under images.remote_images for Netlify's Image CDN allowlist. In packages/integrations/netlify/src/index.ts, remotePatternToRegex() escapes dots in hostname values but interpolates literal pathname values without escaping regular expression metacharacters such as ., +, ?, (, and [, so a restrictive pathname such as /img/v1.0/file also matches metacharacter-adjacent paths, including paths that cross a segment. Netlify enforces the generated regular expression directly and Astro's matchPattern() helper does not revalidate the request, allowing optimization of images on an already-allowed host that the declared pathname was intended to exclude. This issue is fixed in version 8.1.2.","status":"published","published":"2026-08-12T20:41:10Z","modified":"2026-08-13T12:56:00Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","level":"low"}],"updated_at":"2026-11-02T18:01:56.761721Z"}],"ghsa":[{"id":"GHSA-hp3v-mfqw-h74c","title":"@astrojs/netlify generates an overly-broad Netlify Image CDN allowlist because remotePatterns.pathname metacharacters are not escaped","description":"## Summary\n\nThe `@astrojs/netlify` adapter converts each `image.remotePatterns` entry into a regular expression that is written to `.netlify/v1/config.json` under `images.remote_images`. Netlify's Image CDN uses these regexes as the allowlist that decides which remote image URLs it will optimize. `remotePatternToRegex()` escapes `.` in the hostname but interpolates the literal `pathname` into the regex **without escaping regex metacharacters**. As a result, the generated allowlist is broader than the pattern the developer declared, and broader than Astro's canonical `matchPattern()` helper (which compares non-wildcard pathnames by exact string equality).\n\nThis is a residual of the same bug class addressed in CVE-2026-54300 (PR #17018, commit `1310277d`). That fix corrected wildcard semantics and added a `$` anchor but did not add metacharacter escaping for literal pathnames.\n\n## Details\n\nIn `packages/integrations/netlify/src/index.ts`, `remotePatternToRegex()` escapes dots in the hostname:\n\n```js\nregexStr += hostname.replace(/\\./g, '\\\\.');\n```\n\nbut interpolates the pathname unescaped in all three branches, e.g. the exact-match branch:\n\n```js\nregexStr += `(\\\\${pathname})`;\n```\n\nAny regex metacharacter in the literal path (`.`, `+`, `?`, `(`, `[`, ...) is therefore passed through raw. Because `.` matches any character (including `/`), a restrictive pattern is silently widened.\n\nThe security boundary on Netlify is the generated regex itself — Netlify's Image CDN enforces it directly and Astro's runtime `matchPattern()` is not in the loop for this path, so there is no compensating layer that re-validates the request.\n\n## Proof of Concept\n\nConfigure an SSR site with a literal pathname containing a `.`:\n\n```js\n// astro.config.mjs\nimage: {\n  remotePatterns: [{\n    protocol: 'https',\n    hostname: 'cdn.example.com',\n    pathname: '/img/v1.0/file',\n  }],\n}\n```\n\nRun `astro build` and inspect `.netlify/v1/config.json` `images.remote_images[0]`:\n\n```\nhttps://cdn\\.example\\.com(:[0-9]+)?(\\/img/v1.0/file)([?][^#]*)?$\n```\n\nTesting the generated regex:\n\n- `https://cdn.example.com/img/v1.0/file` -\u003e MATCH (intended)\n- `https://cdn.example.com/img/v1X0/file` -\u003e MATCH (bypass; the unescaped `.` matches any character)\n- `https://cdn.example.com/img/v1/0/file` -\u003e MATCH (bypass; `.` also matches `/`, crossing a path segment)\n\nAstro's canonical `matchPattern()` (exact string equality on the pathname) rejects both bypass URLs.\n\n## Impact\n\nNetlify's Image CDN accepts optimization requests for URLs on the allowed host that the developer's `remotePatterns` entry was intended to exclude. The hostname remains correctly anchored, so the broadening is confined to the pathname dimension on an already-allowed host. Realistic impact depends on whether other images the developer meant to keep out of their CDN exist at metacharacter-adjacent paths on that host. This affects reasonable, non-permissive configurations, since any `pathname` containing a `.` (file extensions, version segments) is affected.\n\n## Patches\n\nA fix will escape all regex metacharacters in the literal portions of each `remotePatterns` component before interpolation, applying only Astro's documented wildcard semantics explicitly. A regression corpus validates the generated Netlify regexes against `@astrojs/internal-helpers`' `matchPattern()`.\n\n## Workarounds\n\nAvoid regex metacharacters (notably `.`) in `image.remotePatterns[].pathname` values, or scope the allowed host so that unintended paths are not reachable.\n\n## Credit\n\nReported by @sec-reex as part of an incomplete-patch measurement study (responsible disclosure).","status":"published","published":"2026-07-20T23:24:34Z","modified":"2026-08-13T15:18:39Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","level":"low"}],"cwes":["CWE-185"],"updated_at":"2026-11-02T14:41:00.097339Z"}],"nvd":[{"id":"CVE-2026-73425","description":"Astro is a web framework for content-driven websites. Prior to 8.1.2, the Astro Netlify adapter converts each image.remotePatterns entry into a regular expression written to .netlify/v1/config.json under images.remote_images for Netlify's Image CDN allowlist. In packages/integrations/netlify/src/index.ts, remotePatternToRegex() escapes dots in hostname values but interpolates literal pathname values without escaping regular expression metacharacters such as ., +, ?, (, and [, so a restrictive pathname such as /img/v1.0/file also matches metacharacter-adjacent paths, including paths that cross a segment. Netlify enforces the generated regular expression directly and Astro's matchPattern() helper does not revalidate the request, allowing optimization of images on an already-allowed host that the declared pathname was intended to exclude. This issue is fixed in version 8.1.2.","status":"published","published":"2026-08-12T21:17:41.473Z","modified":"2026-10-24T15:10:00.19Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","level":"low","assessor":"secondary"}],"cwes":["CWE-185"],"updated_at":"2026-11-02T14:12:37.217486Z"}],"osv":[{"id":"CVE-2026-73425","title":"@astrojs/netlify generates an overly-broad Netlify Image CDN allowlist because remotePatterns.pathname metacharacters are not escaped","description":"Astro is a web framework for content-driven websites. Prior to 8.1.2, the Astro Netlify adapter converts each image.remotePatterns entry into a regular expression written to .netlify/v1/config.json under images.remote_images for Netlify's Image CDN allowlist. In packages/integrations/netlify/src/index.ts, remotePatternToRegex() escapes dots in hostname values but interpolates literal pathname values without escaping regular expression metacharacters such as ., +, ?, (, and [, so a restrictive pathname such as /img/v1.0/file also matches metacharacter-adjacent paths, including paths that cross a segment. Netlify enforces the generated regular expression directly and Astro's matchPattern() helper does not revalidate the request, allowing optimization of images on an already-allowed host that the declared pathname was intended to exclude. This issue is fixed in version 8.1.2.","status":"published","published":"2026-08-12T20:41:10.564Z","modified":"2026-10-28T02:30:47.069825623Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","level":"low"}],"cwes":["CWE-185"],"updated_at":"2026-11-02T15:45:16.365946Z"},{"id":"GHSA-hp3v-mfqw-h74c","title":"@astrojs/netlify generates an overly-broad Netlify Image CDN allowlist because remotePatterns.pathname metacharacters are not escaped","description":"## Summary\n\nThe `@astrojs/netlify` adapter converts each `image.remotePatterns` entry into a regular expression that is written to `.netlify/v1/config.json` under `images.remote_images`. Netlify's Image CDN uses these regexes as the allowlist that decides which remote image URLs it will optimize. `remotePatternToRegex()` escapes `.` in the hostname but interpolates the literal `pathname` into the regex **without escaping regex metacharacters**. As a result, the generated allowlist is broader than the pattern the developer declared, and broader than Astro's canonical `matchPattern()` helper (which compares non-wildcard pathnames by exact string equality).\n\nThis is a residual of the same bug class addressed in CVE-2026-54300 (PR #17018, commit `1310277d`). That fix corrected wildcard semantics and added a `$` anchor but did not add metacharacter escaping for literal pathnames.\n\n## Details\n\nIn `packages/integrations/netlify/src/index.ts`, `remotePatternToRegex()` escapes dots in the hostname:\n\n```js\nregexStr += hostname.replace(/\\./g, '\\\\.');\n```\n\nbut interpolates the pathname unescaped in all three branches, e.g. the exact-match branch:\n\n```js\nregexStr += `(\\\\${pathname})`;\n```\n\nAny regex metacharacter in the literal path (`.`, `+`, `?`, `(`, `[`, ...) is therefore passed through raw. Because `.` matches any character (including `/`), a restrictive pattern is silently widened.\n\nThe security boundary on Netlify is the generated regex itself — Netlify's Image CDN enforces it directly and Astro's runtime `matchPattern()` is not in the loop for this path, so there is no compensating layer that re-validates the request.\n\n## Proof of Concept\n\nConfigure an SSR site with a literal pathname containing a `.`:\n\n```js\n// astro.config.mjs\nimage: {\n  remotePatterns: [{\n    protocol: 'https',\n    hostname: 'cdn.example.com',\n    pathname: '/img/v1.0/file',\n  }],\n}\n```\n\nRun `astro build` and inspect `.netlify/v1/config.json` `images.remote_images[0]`:\n\n```\nhttps://cdn\\.example\\.com(:[0-9]+)?(\\/img/v1.0/file)([?][^#]*)?$\n```\n\nTesting the generated regex:\n\n- `https://cdn.example.com/img/v1.0/file` -\u003e MATCH (intended)\n- `https://cdn.example.com/img/v1X0/file` -\u003e MATCH (bypass; the unescaped `.` matches any character)\n- `https://cdn.example.com/img/v1/0/file` -\u003e MATCH (bypass; `.` also matches `/`, crossing a path segment)\n\nAstro's canonical `matchPattern()` (exact string equality on the pathname) rejects both bypass URLs.\n\n## Impact\n\nNetlify's Image CDN accepts optimization requests for URLs on the allowed host that the developer's `remotePatterns` entry was intended to exclude. The hostname remains correctly anchored, so the broadening is confined to the pathname dimension on an already-allowed host. Realistic impact depends on whether other images the developer meant to keep out of their CDN exist at metacharacter-adjacent paths on that host. This affects reasonable, non-permissive configurations, since any `pathname` containing a `.` (file extensions, version segments) is affected.\n\n## Patches\n\nA fix will escape all regex metacharacters in the literal portions of each `remotePatterns` component before interpolation, applying only Astro's documented wildcard semantics explicitly. A regression corpus validates the generated Netlify regexes against `@astrojs/internal-helpers`' `matchPattern()`.\n\n## Workarounds\n\nAvoid regex metacharacters (notably `.`) in `image.remotePatterns[].pathname` values, or scope the allowed host so that unintended paths are not reachable.\n\n## Credit\n\nReported by @sec-reex as part of an incomplete-patch measurement study (responsible disclosure).","status":"published","published":"2026-07-20T23:24:34Z","modified":"2026-08-13T15:30:07.980731689Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","level":"low"}],"cwes":["CWE-185"],"updated_at":"2026-11-02T15:46:49.28217Z"}]}}
