Packages / @astrojs/cloudflare / Security

LowVulnerabilityGHSA-88gm-j2wx-58h6CVE-2026-41321Published 23 Apr 2026

Cloudflare has SSRF via redirect following through its image-binding-transform endpoint (incomplete fix for GHSA-qpr4)

Affected releases · @astrojs/cloudflare

  • 13.x13.0.0 – 13.1.9Fixed in 13.1.10
  • 12.x12.0.0 – 12.6.13No fix on this line yet
  • 11.x and older0.2.0 – 11.2.0No fix, no longer updated

On 13.x, the newest line:

npm install @astrojs/cloudflare@13.1.10
14.x
  1. Not affected

    14.0.0 – 14.4.1

    25 releases, latest

13.x
  1. Affected

    13.0.0 – 13.1.9

    13 releases

  2. Fixed

    13.1.10 – 13.7.0

    16 releases

12.x
  1. Affected

    12.0.0 – 12.6.13

    32 releases

11.x
  1. Affected

    11.0.0 – 11.2.0

    8 releases

10.x
  1. Affected

    10.0.0 – 10.4.2

    16 releases

9.x
  1. Affected

    9.0.0 – 9.2.1

    6 releases

8.x
  1. Affected

    8.0.0 – 8.1.0

    4 releases

7.x
  1. Affected

    7.0.0 – 7.7.1

    21 releases

6.x
  1. Affected

    6.0.0 – 6.8.1

    20 releases

5.x
  1. Affected

    5.0.0

    1 release

4.x
  1. Affected

    4.0.0 – 4.1.1

    4 releases

3.x
  1. Affected

    3.0.0 – 3.1.2

    4 releases

2.x
  1. Affected

    2.0.0 – 2.1.0

    2 releases

1.x
  1. Affected

    1.0.0 – 1.0.2

    3 releases

0.x
  1. Affected

    0.2.0 – 0.5.0

    8 releases

183 stable releases of @astrojs/cloudflare, oldest to newest, one row per major.

Is your project affected?

Paste your package.json, or type the range you declare for @astrojs/cloudflare. It is read in your browser and sent nowhere.

What happens

Summary

The fetch() call for remote images in packages/integrations/cloudflare/src/utils/image-binding-transform.ts (line 28) uses the default redirect: 'follow' behavior. This allows the Cloudflare Worker to follow HTTP redirects to arbitrary URLs, bypassing the isRemoteAllowed() domain allowlist check which only validates the initial URL.

All three other image fetch paths in the codebase correctly use { redirect: 'manual' }. This is an incomplete fix for GHSA-qpr4-c339-7vq8.

Confirmed on HEAD.

Root Cause

image-binding-transform.ts line 28:

const content = await (isRemotePath(href) ? fetch(imageSrc) : assets.fetch(imageSrc));

Missing { redirect: 'manual' }. The three protected paths:

// image-passthrough-endpoint.ts:23
response = await fetch(href, { redirect: 'manual' });

// assets/endpoint/shared.ts:11
const res = await fetch(src, { redirect: 'manual' });

// assets/utils/remoteProbe.ts:53
const response = await fetch(url, { redirect: 'manual' });

PoC

Demonstrated with Node.js that fetch() without redirect: 'manual' follows 302 redirects to arbitrary destinations:

# Server A (allowed domain) returns 302 → Server B (internal)
fetch('http://allowed:19741/img.jpg')                        → follows 302 → hits http://internal:19742/secret
fetch('http://allowed:19741/img.jpg', {redirect:'manual'})   → returns 302, internal server NOT hit

Attack path: attacker finds an open redirect on an allowed domain, crafts /_image?href=https://allowed-cdn.com/redirect?url=http://internal-service/, and the Worker follows the redirect to the unauthorized destination.

Impact

Bypasses the image.domains and image.remotePatterns allowlist for the default Cloudflare image service (cloudflare-binding). Enables blind SSRF to domains not in the allowlist. Same vulnerability class as GHSA-qpr4-c339-7vq8 (HIGH) which fixed the passthrough endpoint but missed this one.

Suggested Fix

const content = await (isRemotePath(href) ? fetch(imageSrc, { redirect: 'manual' }) : assets.fetch(imageSrc));