---
title: "GHSA-hp3v-mfqw-h74c: @astrojs/netlify generates an overly-broad Netlify Image CDN allowlist because remotePatterns.pathname metacharacters are not escaped"
description: "Low severity. @astrojs/netlify generates an overly-broad Netlify Image CDN allowlist because remotePatterns.pathname metacharacters are not escaped."
url: https://inlinr.com/advisories/GHSA-hp3v-mfqw-h74c
lang: en
---

[Packages](https://inlinr.com/packages) / [@astrojs/netlify](https://inlinr.com/packages/@astrojs/netlify) / [Security](https://inlinr.com/packages/@astrojs/netlify/security)

Low Vulnerability GHSA-hp3v-mfqw-h74c CVE-2026-73425 Published 20 Jul 2026

# @astrojs/netlify generates an overly-broad Netlify Image CDN allowlist because remotePatterns.pathname metacharacters are not escaped

Your version 

Affected releases · [@astrojs/netlify](https://inlinr.com/packages/@astrojs/netlify)

- 8.x 8.0.0 – 8.1.1 Fixed in 8.1.2
- 7.x 7.0.0 – 7.0.13 No fix on this line yet
- 6.x 6.0.0 – 6.6.5 No fix on this line yet
- 5.x and older 0.0.2 – 5.5.4 No fix, no longer updated

On 8.x, the newest line:

```
npm install @astrojs/netlify@8.1.2
```

Every release on a timeline

8.x 

1. Affected

8.0.0 – 8.1.1  
3 releases
2. Fixed

8.1.2 – 8.2.14  
17 releases, latest

7.x 

1. Affected

7.0.0 – 7.0.13  
14 releases

6.x 

1. Affected

6.0.0 – 6.6.5  
37 releases

5.x 

1. Affected

5.0.0 – 5.5.4  
20 releases

4.x 

1. Affected

4.0.0 – 4.1.1  
5 releases

3.x 

1. Affected

3.0.0 – 3.1.1  
7 releases

2.x 

1. Affected

2.0.0 – 2.6.0  
15 releases

1.x 

1. Affected

1.0.0 – 1.3.0  
10 releases

0.x 

1. Affected

0.0.2 – 0.5.0  
23 releases

151 stable releases of @astrojs/netlify, oldest to newest, one row per major.

## What happens

Summary

The [@astrojs/netlify](https://inlinr.com/packages/@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).

This is a residual of the same bug class addressed in CVE-2026-54300 (PR [#17018](https://github.com/withastro/astro/issues/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:

```
regexStr += hostname.replace(/\./g, '\\.');
```

but interpolates the pathname unescaped in all three branches, e.g. the exact-match branch:

```
regexStr += `(\\${pathname})`;
```

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 `.`:

```
// astro.config.mjs
image: {
  remotePatterns: [{
    protocol: 'https',
    hostname: 'cdn.example.com',
    pathname: '/img/v1.0/file',
  }],
}
```

Run `astro build` and inspect `.netlify/v1/config.json` `images.remote_images[0]`:

```
https://cdn\.example\.com(:[0-9]+)?(\/img/v1.0/file)([?][^#]*)?$
```

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 `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.

Patches

A 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](https://inlinr.com/packages/@astrojs/internal-helpers)' `matchPattern()`.

Workarounds

Avoid regex metacharacters (notably `.`) in `image.remotePatterns[].pathname` values, or scope the allowed host so that unintended paths are not reachable.

Credit

Reported by [@sec-reex](https://github.com/sec-reex) as part of an incomplete-patch measurement study (responsible disclosure).

## How it is exploited

Exploitable over the network, with no account and no action from a user.

- **Confidentiality**: low
- **Integrity**: none
- **Availability**: none

CVSS:3.1/​AV:N/​AC:H/​PR:N/​UI:N/​S:U/​C:L/​I:N/​A:N

## References

- [Reference](https://github.com/withastro/astro/security/advisories/GHSA-hp3v-mfqw-h74c "https://github.com/withastro/astro/security/advisories/GHSA-hp3v-mfqw-h74c")  
github.com/withastro/astro/security/advisories/…
- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2026-73425 "https://nvd.nist.gov/vuln/detail/CVE-2026-73425")  
nvd.nist.gov/vuln/detail/CVE-2026-73425
- [Pull request](https://github.com/withastro/astro/pull/17018 "https://github.com/withastro/astro/pull/17018")  
#17018
- [Pull request](https://github.com/withastro/astro/pull/17368 "https://github.com/withastro/astro/pull/17368")  
#17368
- [Fix commit](https://github.com/withastro/astro/commit/ee74c289bfe32fb6a7f59ed97c5c22db16394b72 "https://github.com/withastro/astro/commit/ee74c289bfe32fb6a7f59ed97c5c22db16394b72")  
ee74c28
- [Related advisory](https://github.com/advisories/GHSA-529g-xq4f-cw38 "https://github.com/advisories/GHSA-529g-xq4f-cw38")  
github.com/advisories/GHSA-529g-xq4f-cw38
- [Package](https://github.com/withastro/astro "https://github.com/withastro/astro")  
github.com/withastro/astro
- [Reference](https://github.com/withastro/astro/releases/tag/@astrojs/netlify@8.1.2 "https://github.com/withastro/astro/releases/tag/@astrojs/netlify@8.1.2")  
github.com/withastro/astro/releases/tag/@astroj…

A whole project to check? Paste its package.json in the [dependency check](https://inlinr.com/tools/dependency-check): every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.
