[38;2;63;63;70m================================================================================[0m [1;38;2;250;250;250mlegitbiz[38;2;113;113;122m[[1;38;2;16;185;129mresearch[38;2;113;113;122m][0m [38;2;113;113;122m// [1;38;2;52;211;153madvisory[0m [38;2;63;63;70m================================================================================[0m [38;2;113;113;122mid:[0m [1;38;2;52;211;153mLB-2026-010 // html-pdf-node[0m [38;2;113;113;122mtarget:[0m [1;38;2;250;250;250mhtml-pdf-node (all versions) (npm)[0m [38;2;113;113;122mtype:[0m [1;38;2;250;250;250mCross-Site Scripting & SSRF (CWE-79, CWE-918)[0m [38;2;113;113;122mseverity:[0m [1;38;2;248;113;113mCritical (CVSS:3.1 9.8 - AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)[0m [38;2;113;113;122mchannel:[0m [1;38;2;56;189;248mGitHub Issues / Coordinated Disclosure[0m [38;2;113;113;122mdate:[0m [1;38;2;250;250;250m2026-11-27[0m [38;2;113;113;122mstatus:[0m [1;38;2;16;185;129msubmitted / vendor notified[0m [38;2;113;113;122mresearcher:[0m [1;38;2;250;250;250mlegitbiz[research][0m [38;2;63;63;70m--------------------------------------------------------------------------------[0m [1;38;2;52;211;153m[01][0m [38;2;113;113;122m//[0m [1;38;2;250;250;250msummary[0m [38;2;63;63;70m--------------------------------------------------------------------------------[0m [38;2;212;212;216mhtml-pdf-node converts HTML content or web pages to PDF using Puppeteer. It[0m [38;2;212;212;216mcontains two critical vulnerabilities:[0m [1;38;2;52;211;153m1. [0m[38;2;212;212;216mCross-Site Scripting (XSS): User-supplied HTML content is rendered directly[0m [38;2;212;212;216m in a headless browser launched with --no-sandbox, executing arbitrary JavaScript.[0m [1;38;2;52;211;153m2. [0m[38;2;212;212;216mServer-Side Request Forgery (SSRF): User-supplied URLs are navigated to via[0m [38;2;212;212;216m page.goto(), allowing requests to internal networks or local file:// protocols.[0m [38;2;63;63;70m--------------------------------------------------------------------------------[0m [1;38;2;52;211;153m[02][0m [38;2;113;113;122m//[0m [1;38;2;250;250;250mroot cause analysis (index.js)[0m [38;2;63;63;70m--------------------------------------------------------------------------------[0m [38;2;212;212;216mIn index.js, generatePdf() processes input options:[0m [38;2;212;212;216mIf file.content is provided:[0m [38;2;212;212;216m data = await inlineCss(file.content, {url:"/"});[0m [38;2;52;211;153m const template = hb.compile(data, { strict: true });[0m [38;2;52;211;153m const result = template(data);[0m [38;2;212;212;216m await page.setContent(result, { waitUntil: 'networkidle0' });[0m [38;2;212;212;216mThe content is passed straight to page.setContent(), executing embedded scripts.[0m [38;2;212;212;216mIf file.url is provided:[0m [38;2;212;212;216m await page.goto(file.url, { waitUntil:[ 'load', 'networkidle0'] });[0m [38;2;212;212;216mThe URL is passed straight to page.goto() without validation, enabling internal[0m [38;2;212;212;216mnetwork scans and cloud metadata extraction (e.g. 169.254.169.254).[0m [38;2;63;63;70m--------------------------------------------------------------------------------[0m [1;38;2;52;211;153m[03][0m [38;2;113;113;122m//[0m [1;38;2;250;250;250mproof of concept[0m [38;2;63;63;70m--------------------------------------------------------------------------------[0m [38;2;212;212;216mconst pdf = require('html-pdf-node');[0m [38;2;212;212;216m// XSS PoC:[0m [38;2;212;212;216mconst fileXSS = { content: '