Skip to main content
Vulnerability Database/CVE-2026-77581

CVE-2026-77581: BentoPDF CORS Proxy SSRF Vulnerability

CVE-2026-77581 is a server-side request forgery vulnerability in BentoPDF's CORS proxy that enables attackers to bypass hostname validation and access internal resources. This article covers technical details, affected versions, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-77581 Overview

CVE-2026-77581 is a Server-Side Request Forgery (SSRF) vulnerability in BentoPDF, a self-hostable client-side PDF toolkit. Versions 2.8.6 and earlier contain a flaw in the certificate and timestamp CORS proxy at cloudflare/cors-proxy-worker.js. The proxy validates a supplied hostname with isPrivateOrReservedHost() separately from the DNS resolution performed by fetch(targetUrl), enabling a DNS rebinding condition. Attackers can direct the Worker to internal or reserved destinations after validation succeeds. The issue is fixed in version 2.8.7 ([CWE-918]).

Critical Impact

An unauthenticated remote attacker can coerce the proxy Worker to issue HTTP requests to internal or reserved network destinations and relay up to 10 MB of response data back to the client.

Affected Products

  • BentoPDF versions 2.8.6 and earlier (self-hosted deployments)
  • Official bentopdf-cors-proxy.bentopdf.workers.dev Cloudflare Worker deployment
  • Any Worker execution environment with network reachability to internal or reserved destinations

Discovery Timeline

  • 2026-09-24 - CVE-2026-77581 published to NVD
  • 2026-09-29 - Last updated in NVD database

Technical Details for CVE-2026-77581

Vulnerability Analysis

The BentoPDF CORS proxy Worker exposes an SSRF primitive through three compounding weaknesses. First, the hostname is validated once against a private-or-reserved allowlist, but the subsequent fetch() call performs its own DNS lookup. An attacker-controlled domain can return a public address during validation and a private address at fetch time. Second, the request path only needs to satisfy ALLOWED_PATH_PATTERNS, which were loose enough that any URL containing certificate-like substrings would pass. Third, direct (non-browser) clients can forge the browser-oriented Origin header, bypassing the intended trust boundary. Deployments that omit PROXY_SECRET skip the HMAC signature check entirely, and even when present, the signature is an anti-abuse control rather than a destination-security boundary. The Worker will return up to 10 MB of relayed response body, enabling internal data exfiltration.

Root Cause

The root cause is a time-of-check to time-of-use (TOCTOU) issue between hostname validation and the actual network request. The validator resolves and inspects one IP address while fetch() independently resolves the hostname again, allowing DNS rebinding or dual-record responses to redirect traffic to reserved ranges.

Attack Vector

An attacker crafts a request to the public Worker with a URL whose hostname is attacker-controlled and whose path satisfies the certificate pattern allowlist. The attacker also supplies a forged Origin header. Through DNS rebinding, the hostname resolves to an internal destination such as 169.254.169.254 or an RFC1918 address when the Worker performs the outbound fetch.

javascript
// Patched ALLOWED_PATH_PATTERNS in cloudflare/cors-proxy-worker.js (v2.8.7)
const ALLOWED_PATH_PATTERNS = [
  /\.(crt|cer|pem|der|p7c|p7b)$/i,
  /(^|\/)certs(\/|$)/i,
  /(^|\/)ocsp(\/|$)/i,
  /(^|\/)crl(\/|$)/i,
  /(^|\/)caissuers(\/|$)/i,
];
// Source: https://github.com/alam00000/bentopdf/commit/58cd1a8893bfe06e4a59a72adc2e7db00a8b9266

Detection Methods for CVE-2026-77581

Indicators of Compromise

  • Worker request logs showing outbound fetch() calls to RFC1918, loopback, or link-local addresses such as 169.254.169.254, 10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16.
  • Repeated proxy requests to the same attacker-controlled hostname with short DNS TTLs characteristic of rebinding.
  • Response payloads approaching the 10 MB cap originating from internal destinations.

Detection Strategies

  • Correlate Worker access logs with upstream DNS responses to identify hostnames that resolve to both public and private addresses within short time windows.
  • Alert on proxy requests whose Origin header does not match any legitimate deployed BentoPDF frontend domain.
  • Flag Worker executions missing a valid PROXY_SECRET HMAC signature header.

Monitoring Recommendations

  • Enable Cloudflare Workers logpush and ship request and response metadata to a SIEM for retention and query.
  • Monitor egress from the Worker environment to any internal CIDR range using cloud provider flow logs.
  • Track response size distributions for the proxy endpoint to detect bulk relaying consistent with data exfiltration.

How to Mitigate CVE-2026-77581

Immediate Actions Required

  • Upgrade BentoPDF to version 2.8.7 or later on all self-hosted instances and redeploy the Cloudflare Worker.
  • Configure a strong PROXY_SECRET environment variable so the Worker enforces HMAC signature validation on every request.
  • Restrict the Worker's network reachability so it cannot route to internal, reserved, or metadata endpoints.

Patch Information

The fix is delivered in GitHub Release v2.8.7. Patches land across two commits: commit 45496fc adds warnings when PROXY_SECRET is missing and documents the DNS rebinding risk, while commit 58cd1a8 tightens ALLOWED_PATH_PATTERNS and introduces a stricter Content-Security-Policy. See GitHub Security Advisory GHSA-5xjf-rr5x-pcfj for full details.

Workarounds

  • If immediate upgrade is not possible, disable the Cloudflare Worker proxy endpoint or restrict it with Cloudflare Access policies.
  • Deploy the Worker in an isolated environment with no routes to internal networks or cloud metadata services.
  • Enforce PROXY_SECRET on all deployments to raise the attack cost, while recognizing it is not a destination-security boundary.
bash
# Set PROXY_SECRET for the Cloudflare Worker deployment
wrangler secret put PROXY_SECRET
# Then paste a high-entropy random value (e.g., `openssl rand -hex 32`)

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.