MEDIUM 5.3

CVE-2026-54300: @astrojs/netlify Image Pattern Regex Vulnerability

@astrojs/netlify versions before 7.0.13 contain a logic flaw in how remote image access patterns are converted for Netlify's Image CDN. When you define trusted image sources using wildcards—like *.example.com or /images/*—the adapter translates these rules incorrectly, allowing images from unintended hosts and paths to pass validation. For example, a wildcard subdomain pattern meant to match api.example.com would inadvertently permit requests from example.com itself (the apex domain), and a path pattern intended to restrict /images/* would match any deeper path like /images/foo/bar/baz. This creates an uncontrolled image loading vulnerability where the adapter grants Image CDN access to sources beyond your intended scope.

Source data · NVD / CISA · public domain

CVSS
3.1 · 5.3 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Weaknesses (CWE)
CWE-918
Affected products
0 configuration(s)
Published / Modified
2026-06-22 / 2026-06-23

NVD description (verbatim)

@astrojs/netlify is an adapter that allows Astro to deploy your hybrid or server rendered site to Netlify. Prior to 7.0.13, @astrojs/netlify converts Astro image.remotePatterns into Netlify Image CDN images.remote_images regular expressions with broader semantics than Astro's canonical matcher. A single wildcard hostname such as *.example.com is converted to an optional subdomain regex, so the apex host matches. A single wildcard pathname such as /ok/* is converted without end anchoring, so deeper paths match by prefix. This vulnerability is fixed in 7.0.13.

2 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2026-54300 arises from improper regex translation in @astrojs/netlify's image.remotePatterns handler. The adapter converts Astro's canonical pattern matcher into Netlify Image CDN remote_images regular expressions, but the conversion introduces semantic misalignment. Wildcard subdomains (*.example.com) become optional-subdomain patterns that match the apex host; single-level path wildcards (/ok/*) lack end anchors, matching prefixes instead of exact depths. This causes overly permissive image sourcing, classified as CWE-918 (Server-Side Request Forgery–like behavior). The CVSS 3.1 score of 5.3 (MEDIUM) reflects network-exploitable confidentiality impact with no authentication required, though availability and integrity are unaffected.

Business impact

Teams deploying hybrid or server-rendered Astro sites to Netlify risk exposure of images from unauthorized domains and paths. An attacker could craft requests to Astro endpoints that reference images from unintended sources, forcing the Image CDN to process and cache those resources under your account, inflating bandwidth costs, enabling cache poisoning, or exposing sensitive image content if wildcard patterns unintentionally grant access to internal or third-party image repositories. The blast radius depends on how broadly image patterns are defined; restrictive patterns may see minimal exposure, while loose wildcards compound the risk.

Affected systems

@astrojs/netlify versions prior to 7.0.13 are vulnerable. Any Astro project using this adapter with image.remotePatterns configuration (particularly those using wildcard subdomains or path patterns) is affected. Projects without remote image patterns, or those using @astrojs/netlify 7.0.13 or later, are not vulnerable.

Exploitability

The vulnerability is network-accessible without authentication or user interaction (CVSS AV:N, AC:L, PR:N, UI:N). Exploitation requires knowledge of the target's Astro image patterns and the ability to send requests to the Astro application; no zero-click weaponization is needed. However, practical impact depends on pattern breadth—overly permissive wildcards increase risk, while specific patterns may limit exposure. This is not currently tracked in the Known Exploited Vulnerabilities (KEV) catalog.

Remediation

Upgrade @astrojs/netlify to version 7.0.13 or later. This release corrects the regex translation logic to properly anchor paths and respect subdomain scope. After upgrading, validate your image.remotePatterns configuration to ensure they still reflect your intended trusted sources; the corrected behavior may now reject patterns that inadvertently relied on the old overly-permissive semantics.

Patch guidance

Update @astrojs/netlify in your project dependencies to 7.0.13 or later. If using package managers (npm, yarn, pnpm), run the standard update command (e.g., npm update @astrojs/netlify) and verify the new version in package-lock.json. Test your image loading in both development and staging environments to confirm no legitimate image sources are broken by the stricter pattern matching. If your application relies on image patterns that worked under the old semantics, adjust your remotePatterns configuration to explicitly include all intended sources.

Detection guidance

Review your @astrojs/netlify version in package-lock.json or yarn.lock; any version <7.0.13 requires immediate attention. Audit image.remotePatterns in your astro.config.mjs—particularly any using wildcards like *.example.com or /path/*—and compare them against your actual trusted image sources. Monitor Netlify Image CDN logs and cost metrics for unexpected image processing or bandwidth spikes that might indicate unintended pattern matches. In development, test image loading with sources outside your declared patterns to confirm they are now properly rejected.

Why prioritize this

While the CVSS score is MEDIUM (5.3), this vulnerability warrants prompt attention because it affects access control logic for external resources, potentially exposing image sourcing to unintended domains. Any organization deploying Astro to Netlify should treat this as high-priority from a compliance and data-access perspective, especially if image patterns were designed to segregate content by source. The fix is straightforward and low-risk, making rapid deployment advisable.

Risk score, explained

CVSS 3.1 score of 5.3 (MEDIUM) reflects a network-exploitable flaw (AV:N) with no special conditions (AC:L) and no authentication (PR:N, UI:N) required. The impact is limited to confidentiality (C:L) with no integrity or availability degradation (I:N, A:N), and the scope is unchanged (S:U). The vulnerability enables unauthorized information disclosure (fetching images from unintended sources) but does not cause service disruption or data modification. Severity increases if your image patterns inadvertently reference sensitive or internal image repositories.

Frequently asked questions

Does this vulnerability affect Astro sites deployed to other platforms (Vercel, AWS, etc.)?

No. This flaw is specific to @astrojs/netlify's conversion of image patterns for Netlify's Image CDN. Other adapters or deployment targets do not have the same pattern translation logic and are unaffected.

What if my Astro project doesn't use image.remotePatterns?

If you do not configure image.remotePatterns, your site is not vulnerable. This setting is only required if you enable remote image optimization. Check your astro.config.mjs; if remotePatterns is absent or not configured, you are safe.

Can I work around this without upgrading?

Temporary mitigation: remove or severely restrict image.remotePatterns to only the most specific, non-wildcard domains and paths you absolutely require. However, upgrading to 7.0.13 is the proper fix and is strongly recommended.

Will upgrading break my image loading?

Upgrading enforces stricter pattern matching, so images that previously loaded due to the overly-permissive regex may now be rejected. Test after upgrading. If breakage occurs, adjust your remotePatterns to explicitly include all legitimate sources, or verify that the previously-matched sources were indeed unintended.

This analysis is based on the CVE record and vendor advisories as of the publication date. CVSS scores and severity ratings reflect industry-standard metrics but may vary based on organizational context and threat landscape. No exploit code or proof-of-concept is provided. Always verify patch availability and compatibility with your environment before deployment. For the latest updates, consult the official @astrojs/netlify repository and Netlify security documentation. Source: NVD (public-domain), retrieved 2026-07-28. Analysis generated by SEC.co (claude-haiku-4-5).