PDF.js vulnerabilities (browser-side) — Mozilla's PDF.js, which renders PDFs in Firefox and is used by many web applications, had a serious JavaScript sandbox escape vulnerability (
CVE-2024-4367, disclosed 2024) where specially crafted PDF font names could execute arbitrary JavaScript in the browser's rendering context, bypassing the PDF sandbox entirely. This was exploitable by a malicious PDF file viewed in Firefox. Earlier PDF.js CVEs include cross-origin data leaks and prototype pollution vulnerabilities.
Adobe Acrobat RCE vulnerabilities — Acrobat has historically had multiple critical-severity RCEs (Remote Code Execution) in its JavaScript engine and PDF parsing. The JavaScript API's file system access functions (
util.printf() format string bugs,
app.doc property access), combined with memory corruption in the PDF renderer, have produced exploit chains requiring no user interaction beyond opening the document. Adobe's Patch Tuesday bulletins regularly address Acrobat JavaScript CVEs.
Heap spray via JavaScript — Early (pre-2015) exploits commonly used JavaScript to spray the heap with shellcode in preparation for a separate memory corruption exploit in the PDF renderer or font handler. JavaScript could allocate large arrays or strings of controlled content, making heap addresses predictable for exploit reliability.
Social engineering via JavaScript dialogs — Even without code execution,
app.alert() can display convincing dialog boxes asking users to enter credentials, enable macros, or approve actions. This low-sophistication vector has been used in phishing PDFs distributed via email.
Data exfiltration via submitForm —
this.submitForm() can POST form field data (including sensitive content pre-filled in hidden fields) to an attacker-controlled server without user awareness. Combined with JavaScript that reads environment data, this has been used for fingerprinting and credential harvesting.