fix(deps): update dependency @astrojs/netlify to ~8.1.0 [security]#1309
Open
renovate[bot] wants to merge 1 commit into
Open
fix(deps): update dependency @astrojs/netlify to ~8.1.0 [security]#1309renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
renovate
Bot
force-pushed
the
renovate/npm-astrojs-netlify-vulnerability
branch
from
July 24, 2026 16:08
07e2a3a to
b75aa9c
Compare
renovate
Bot
force-pushed
the
renovate/npm-astrojs-netlify-vulnerability
branch
from
July 25, 2026 01:25
b75aa9c to
a472602
Compare
Contributor
Author
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
~8.0.0→~8.1.0@astrojs/netlify generates an overly-broad Netlify Image CDN allowlist because remotePatterns.pathname metacharacters are not escaped
GHSA-hp3v-mfqw-h74c
More information
Details
Summary
The
@astrojs/netlifyadapter converts eachimage.remotePatternsentry into a regular expression that is written to.netlify/v1/config.jsonunderimages.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 literalpathnameinto 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 canonicalmatchPattern()helper (which compares non-wildcard pathnames by exact string equality).This 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.Details
In
packages/integrations/netlify/src/index.ts,remotePatternToRegex()escapes dots in the hostname:but interpolates the pathname unescaped in all three branches, e.g. the exact-match branch:
Any regex metacharacter in the literal path (
.,+,?,(,[, ...) is therefore passed through raw. Because.matches any character (including/), a restrictive pattern is silently widened.The 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.Proof of Concept
Configure an SSR site with a literal pathname containing a
.:Run
astro buildand inspect.netlify/v1/config.jsonimages.remote_images[0]:Testing the generated regex:
https://cdn.example.com/img/v1.0/file-> MATCH (intended)https://cdn.example.com/img/v1X0/file-> MATCH (bypass; the unescaped.matches any character)https://cdn.example.com/img/v1/0/file-> MATCH (bypass;.also matches/, crossing a path segment)Astro's canonical
matchPattern()(exact string equality on the pathname) rejects both bypass URLs.Impact
Netlify's Image CDN accepts optimization requests for URLs on the allowed host that the developer's
remotePatternsentry 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 anypathnamecontaining a.(file extensions, version segments) is affected.Patches
A fix will escape all regex metacharacters in the literal portions of each
remotePatternscomponent before interpolation, applying only Astro's documented wildcard semantics explicitly. A regression corpus validates the generated Netlify regexes against@astrojs/internal-helpers'matchPattern().Workarounds
Avoid regex metacharacters (notably
.) inimage.remotePatterns[].pathnamevalues, or scope the allowed host so that unintended paths are not reachable.Credit
Reported by @sec-reex as part of an incomplete-patch measurement study (responsible disclosure).
Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
withastro/astro (@astrojs/netlify)
v8.1.2Compare Source
Patch Changes
#17368
ee74c28Thanks @matthewp! - Fixes the generated Netlify Image CDNremote_imagespatterns so that regex metacharacters (such as.) inimage.remotePatterns(hostname,pathname) andimage.domainsare matched literally instead of behaving like wildcards. This makes the generated patterns consistent with how Astro matches these values elsewhere.Updated dependencies []:
v8.1.1Compare Source
Patch Changes
eb6f97e]:v8.1.0Compare Source
Minor Changes
#17245
f56d9e7Thanks @astrobot-houston! - AddsedgeFunctionsto thedevFeaturesadapter option, allowing users to disable Netlify Edge Function emulation duringastro devSome npm packages that access the filesystem at initialization (e.g.
node-html-parser) fail inside the edge function sandbox with "Reading or writing files with Edge Functions is not supported yet." You can now disable edge function emulation to avoid this error:Edge functions will still work in production builds and via
netlify dev.Patch Changes
#17249
02b73b0Thanks @ematipico! - Fixes an issue where thepeerDependenciesfield used incorrect dependencies.Updated dependencies []:
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.