Cloudanix VulnDB

CVE-2024-4367

High · 8.8

CVSS

8.8

EPSS

70.7%

Published

May 14, 2024

CISA due date

—

Cloudanix analysis

Next patch cycle SSVC: Attend

A booby-trapped PDF can run malicious code when opened in an outdated PDF viewer used by Firefox, Thunderbird, or websites.

Exploit Available
Exploitation
Requires User Interaction
Attacker needs
User Interaction
Complexity
Low
Impact
Remote Code Execution
Component
Application
Class
Improper Input Validation
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

The flaw is a missing type validation check in PDF.js font handling. A malicious PDF can place JavaScript-bearing values where numeric font metadata is expected, causing PDF.js to generate and execute attacker-controlled JavaScript while rendering the document. Exploitation requires a user to open or preview the crafted PDF in a vulnerable PDF.js-based viewer, including affected Firefox, Firefox ESR, Thunderbird, or applications embedding vulnerable mozilla/pdf.js. Successful exploitation can compromise confidentiality and integrity within the PDF.js execution context, which may include access to document content, viewer state, same-origin application data depending on deployment, and the ability to make network requests from that context.

Why it matters to the business

Organizations using vulnerable PDF.js-based viewers face a high-risk document-borne attack vector: an attacker can send or host a PDF that runs code when opened. This can lead to theft of data visible to the PDF viewer, unauthorized actions inside web applications that embed PDF.js, phishing or session abuse, and potential follow-on compromise if chained with other browser or application weaknesses. The issue is older, publicly exploitable, and has a high EPSS score, so unpatched deployments should be treated as likely exposed even though it is not listed in CISA KEV and is not specifically marked as ransomware-associated.

How an attack unfolds

An attacker crafts a PDF with malformed font metadata, commonly by abusing the PDF font FontMatrix structure so that non-numeric values containing JavaScript are processed during glyph rendering. The attacker then delivers the file through email, file-sharing, a hosted web link, or any workflow where users preview PDFs. When the victim opens the PDF in a vulnerable Firefox, Firefox ESR, Thunderbird, or web application embedding vulnerable PDF.js, the viewer parses the font data and reaches the vulnerable code path. Because the type check is missing, attacker-controlled content is incorporated into dynamically generated JavaScript used by the PDF renderer. That script executes in the PDF.js context, allowing the attacker to interact with data and capabilities available to that viewer context and potentially exfiltrate information or perform unauthorized in-application actions.

How to fix it

Upgrade all affected PDF.js consumers. For upstream mozilla/pdf.js from Git, use a version containing commit 49b388101a53f1ff81390fab8336d02acf06a582 or later. For Mozilla products, upgrade Firefox to 126 or later, Firefox ESR to 115.11 or later, and Thunderbird to 115.11 or later. For applications that embed PDF.js, update the bundled library and rebuild/redeploy the application rather than relying only on browser updates. If immediate patching is not possible, reduce exposure by disabling PDF preview for untrusted documents, forcing download/opening in a patched external viewer, blocking PDF rendering in vulnerable embedded viewers, restricting who can upload PDFs, and applying content security controls that limit outbound connections from PDF viewer contexts.

How to confirm the fix worked

Confirm deployed browser and mail client versions are Firefox 126 or later, Firefox ESR 115.11 or later, and Thunderbird 115.11 or later. For embedded PDF.js, inspect the bundled dependency, build artifacts, or source lockfiles to verify the code includes commit 49b388101a53f1ff81390fab8336d02acf06a582 or a later fixed release. Test representative applications by opening a benign proof-of-concept PDF in a non-production environment and confirming that embedded JavaScript in malformed font metadata does not execute. Review web application static assets to ensure old pdf.js, pdf.worker.js, and pdf_viewer.js files are not still served from caches, CDNs, or legacy paths after remediation.

Typical attack path

  1. Identify an organization or application where users open PDFs in Firefox, Thunderbird, or an embedded PDF.js viewer.
  2. Create a malicious PDF with crafted font data, especially a FontMatrix value containing JavaScript-like payload content instead of only numeric values.
  3. Deliver the PDF through phishing, a document portal, file upload, collaboration tooling, or a web link.
  4. Wait for a victim to open or preview the document in a vulnerable PDF.js-based renderer.
  5. Trigger PDF.js font rendering so the malformed font metadata is processed.
  6. Execute attacker-controlled JavaScript in the PDF.js context.
  7. Use the available context to read accessible document/viewer data, make outbound network requests, steal tokens or page data where exposed, or stage additional attacks.

How to detect it

To determine whether exploitation already occurred, search email gateways, web proxies, file upload repositories, endpoint file telemetry, and document-management logs for PDFs received or opened before patching that contain suspicious font definitions. Prioritize PDFs with /FontMatrix entries containing strings, parentheses, semicolons, JavaScript keywords, network calls, or encoded payloads, because legitimate FontMatrix values should be numeric. Review browser history, download records, cache entries, EDR telemetry, and proxy logs for users who opened suspicious PDFs, then correlate with outbound network requests from Firefox, Thunderbird, or browsers viewing affected applications immediately after PDF rendering. In web applications embedding PDF.js, review access logs for PDF viewer routes followed by unusual same-origin API calls or unexpected outbound requests to unfamiliar domains. On endpoints, investigate suspicious child processes, credential access, or browser data access after PDF viewing, while noting that this vulnerability itself executes JavaScript in the viewer context and may not create a native process unless chained with another exploit. Retain and scan suspect PDFs with YARA or static parsing rules that flag non-numeric FontMatrix arrays and JavaScript-like content in font objects.

  • /FontMatrix [
  • /FontMatrix[
  • /FontMatrix [1 0 0 1 0 (
  • /FontMatrix [0.1 0 0 0.1 0 (
  • /FontMatrix [1 2 3 4 5 (
  • /FontMatrix [1 0 0 1 0 0];
  • /FontMatrix
  • FontMatrix
  • getPathGenerator
  • CompiledFont
  • new Function
  • document.cookie
  • XMLHttpRequest(
  • fetch(
  • navigator.sendBeacon
  • import(
  • eval(
  • Function(
  • atob(
  • fromCharCode
  • app.alert
  • /JavaScript
  • /OpenAction

What your security team should do

  • Inventory all uses of PDF.js, including bundled copies in web applications, document-management systems, portals, helpdesk platforms, and static assets served from CDNs.
  • Prioritize patching internet-facing or user-facing PDF preview functionality because exploitation is public, user-assisted, low-complexity, and has a high EPSS score.
  • Upgrade Mozilla clients and embedded PDF.js components to fixed versions; verify old pdf.js assets are removed from web roots and caches.
  • Temporarily disable preview of untrusted PDFs or route them to a patched rendering service until all embedded viewers are updated.
  • Hunt for suspicious PDFs containing malformed FontMatrix values and JavaScript-like strings in email, proxy, file upload, and endpoint telemetry.
  • Add detections for PDF downloads or uploads followed by unusual outbound requests from browser processes or from web application origins hosting PDF viewers.
  • Educate users and support teams that PDF files can be active attack content and should be handled with the same caution as office documents with macros.

The record

A type check was missing when handling fonts in PDF.js, which would allow arbitrary JavaScript execution in the PDF.js context. This vulnerability affects Firefox < 126, Firefox ESR < 115.11, and Thunderbird < 115.11.

Affected packages

Ecosystem Package Introduced Fixed
npm pdfjs-dist 0 4.2.67
npm react-pdf 0 7.7.3
npm react-pdf 8.0.0 8.0.2
AlmaLinux:8 firefox 0 115.11.0-1.el8_10.alma.1
AlmaLinux:8 thunderbird 0 115.11.0-1.el8_10.alma.1
AlmaLinux:9 firefox 0 115.11.0-1.el9_4.alma.1
AlmaLinux:9 firefox-x11 0 115.11.0-1.el9_4.alma.1
AlmaLinux:9 thunderbird 0 115.11.0-1.el9_4.alma.1
Chainguard firefox-esr 0 115.11.0-r0
Chainguard kibana-8 0 8.16.1-r0
Chainguard kibana-8-bitnami 0 8.16.1-r0
Chainguard kibana-8-iamguarded 0 8.16.1-r0
Debian:10 firefox-esr 0 115.11.0esr-1~deb10u1
Debian:10 thunderbird 0 1:115.11.0-1~deb10u1
Debian:11 firefox-esr 0 115.11.0esr-1~deb11u1
Debian:11 odoo 0 14.0.0+dfsg.2-7+deb11u2
Debian:11 thunderbird 0 1:115.11.0-1~deb11u1
Debian:12 firefox-esr 0 115.11.0esr-1~deb12u1
Debian:12 thunderbird 0 1:115.11.0-1~deb12u1
Debian:13 firefox-esr 0 115.11.0esr-1
Debian:13 odoo 0 16.0.0+dfsg.2-3
Debian:13 thunderbird 0 1:115.11.0-1
Mageia:9 firefox 0 115.11.0-1.mga9
Mageia:9 firefox-l10n 0 115.11.0-1.mga9
Mageia:9 nss 0 3.100.0-1.mga9
Mageia:9 thunderbird 0 115.11.0-1.mga9
Mageia:9 thunderbird-l10n 0 115.11.0-1.mga9
Red Hat:enterprise_linux:7::client firefox 0 0:115.11.0-1.el7_9
Red Hat:enterprise_linux:7::client firefox-debuginfo 0 0:115.11.0-1.el7_9
Red Hat:enterprise_linux:7::client thunderbird 0 0:115.11.0-1.el7_9
Red Hat:enterprise_linux:7::client thunderbird-debuginfo 0 0:115.11.0-1.el7_9
Red Hat:enterprise_linux:7::server firefox 0 0:115.11.0-1.el7_9
Red Hat:enterprise_linux:7::server firefox-debuginfo 0 0:115.11.0-1.el7_9
Red Hat:enterprise_linux:7::server thunderbird 0 0:115.11.0-1.el7_9
Red Hat:enterprise_linux:7::server thunderbird-debuginfo 0 0:115.11.0-1.el7_9
Red Hat:enterprise_linux:7::workstation firefox 0 0:115.11.0-1.el7_9
Red Hat:enterprise_linux:7::workstation firefox-debuginfo 0 0:115.11.0-1.el7_9
Red Hat:enterprise_linux:7::workstation thunderbird 0 0:115.11.0-1.el7_9
Red Hat:enterprise_linux:7::workstation thunderbird-debuginfo 0 0:115.11.0-1.el7_9
Red Hat:enterprise_linux:8::appstream firefox 0 0:115.11.0-1.el8_10
Red Hat:enterprise_linux:8::appstream firefox-debuginfo 0 0:115.11.0-1.el8_10
Red Hat:enterprise_linux:8::appstream firefox-debugsource 0 0:115.11.0-1.el8_10
Red Hat:enterprise_linux:8::appstream thunderbird 0 0:115.11.0-1.el8_10
Red Hat:enterprise_linux:8::appstream thunderbird-debuginfo 0 0:115.11.0-1.el8_10
Red Hat:enterprise_linux:8::appstream thunderbird-debugsource 0 0:115.11.0-1.el8_10
Red Hat:enterprise_linux:9::appstream firefox 0 0:115.11.0-1.el9_4
Red Hat:enterprise_linux:9::appstream firefox-debuginfo 0 0:115.11.0-1.el9_4
Red Hat:enterprise_linux:9::appstream firefox-debugsource 0 0:115.11.0-1.el9_4
Red Hat:enterprise_linux:9::appstream firefox-x11 0 0:115.11.0-1.el9_4
Red Hat:enterprise_linux:9::appstream thunderbird 0 0:115.11.0-1.el9_4
Red Hat:enterprise_linux:9::appstream thunderbird-debuginfo 0 0:115.11.0-1.el9_4
Red Hat:enterprise_linux:9::appstream thunderbird-debugsource 0 0:115.11.0-1.el9_4
Red Hat:rhel_aus:8.2::appstream firefox 0 0:115.11.0-1.el8_2
Red Hat:rhel_aus:8.2::appstream firefox-debuginfo 0 0:115.11.0-1.el8_2
Red Hat:rhel_aus:8.2::appstream firefox-debugsource 0 0:115.11.0-1.el8_2
Red Hat:rhel_aus:8.2::appstream thunderbird 0 0:115.11.0-1.el8_2
Red Hat:rhel_aus:8.2::appstream thunderbird-debuginfo 0 0:115.11.0-1.el8_2
Red Hat:rhel_aus:8.2::appstream thunderbird-debugsource 0 0:115.11.0-1.el8_2
Red Hat:rhel_aus:8.4::appstream firefox 0 0:115.11.0-1.el8_4
Red Hat:rhel_aus:8.4::appstream firefox-debuginfo 0 0:115.11.0-1.el8_4
Red Hat:rhel_aus:8.4::appstream firefox-debugsource 0 0:115.11.0-1.el8_4
Red Hat:rhel_aus:8.4::appstream thunderbird 0 0:115.11.0-1.el8_4
Red Hat:rhel_aus:8.4::appstream thunderbird-debuginfo 0 0:115.11.0-1.el8_4
Red Hat:rhel_aus:8.4::appstream thunderbird-debugsource 0 0:115.11.0-1.el8_4
Red Hat:rhel_e4s:8.4::appstream firefox 0 0:115.11.0-1.el8_4
Red Hat:rhel_e4s:8.4::appstream firefox-debuginfo 0 0:115.11.0-1.el8_4
Red Hat:rhel_e4s:8.4::appstream firefox-debugsource 0 0:115.11.0-1.el8_4
Red Hat:rhel_e4s:8.4::appstream thunderbird 0 0:115.11.0-1.el8_4
Red Hat:rhel_e4s:8.4::appstream thunderbird-debuginfo 0 0:115.11.0-1.el8_4
Red Hat:rhel_e4s:8.4::appstream thunderbird-debugsource 0 0:115.11.0-1.el8_4
Red Hat:rhel_eus:8.6::appstream firefox 0 0:115.11.0-1.el8_6
Red Hat:rhel_eus:8.6::appstream firefox-debuginfo 0 0:115.11.0-1.el8_6
Red Hat:rhel_eus:8.6::appstream firefox-debugsource 0 0:115.11.0-1.el8_6
Red Hat:rhel_eus:8.6::appstream thunderbird 0 0:115.11.0-1.el8_6
Red Hat:rhel_eus:8.6::appstream thunderbird-debuginfo 0 0:115.11.0-1.el8_6
Red Hat:rhel_eus:8.6::appstream thunderbird-debugsource 0 0:115.11.0-1.el8_6
Red Hat:rhel_eus:8.8::appstream firefox 0 0:115.11.0-1.el8_8
Red Hat:rhel_eus:8.8::appstream firefox-debuginfo 0 0:115.11.0-1.el8_8
Red Hat:rhel_eus:8.8::appstream firefox-debugsource 0 0:115.11.0-1.el8_8
Red Hat:rhel_eus:8.8::appstream thunderbird 0 0:115.11.0-1.el8_8
Red Hat:rhel_eus:8.8::appstream thunderbird-debuginfo 0 0:115.11.0-1.el8_8
Red Hat:rhel_eus:8.8::appstream thunderbird-debugsource 0 0:115.11.0-1.el8_8
Red Hat:rhel_eus:9.0::appstream firefox 0 0:115.11.0-1.el9_0
Red Hat:rhel_eus:9.0::appstream firefox-debuginfo 0 0:115.11.0-1.el9_0
Red Hat:rhel_eus:9.0::appstream firefox-debugsource 0 0:115.11.0-1.el9_0
Red Hat:rhel_eus:9.0::appstream thunderbird 0 0:115.11.0-1.el9_0
Red Hat:rhel_eus:9.0::appstream thunderbird-debuginfo 0 0:115.11.0-1.el9_0
Red Hat:rhel_eus:9.0::appstream thunderbird-debugsource 0 0:115.11.0-1.el9_0
Red Hat:rhel_eus:9.2::appstream firefox 0 0:115.11.0-1.el9_2
Red Hat:rhel_eus:9.2::appstream firefox-debuginfo 0 0:115.11.0-1.el9_2
Red Hat:rhel_eus:9.2::appstream firefox-debugsource 0 0:115.11.0-1.el9_2
Red Hat:rhel_eus:9.2::appstream firefox-x11 0 0:115.11.0-1.el9_2
Red Hat:rhel_eus:9.2::appstream thunderbird 0 0:115.11.0-1.el9_2
Red Hat:rhel_eus:9.2::appstream thunderbird-debuginfo 0 0:115.11.0-1.el9_2
Red Hat:rhel_eus:9.2::appstream thunderbird-debugsource 0 0:115.11.0-1.el9_2
Red Hat:rhel_tus:8.4::appstream firefox 0 0:115.11.0-1.el8_4
Red Hat:rhel_tus:8.4::appstream firefox-debuginfo 0 0:115.11.0-1.el8_4
Red Hat:rhel_tus:8.4::appstream firefox-debugsource 0 0:115.11.0-1.el8_4
Red Hat:rhel_tus:8.4::appstream thunderbird 0 0:115.11.0-1.el8_4
Red Hat:rhel_tus:8.4::appstream thunderbird-debuginfo 0 0:115.11.0-1.el8_4
Red Hat:rhel_tus:8.4::appstream thunderbird-debugsource 0 0:115.11.0-1.el8_4
Rocky Linux:8 firefox 0 0:115.11.0-1.el8_10
Rocky Linux:8 thunderbird 0 0:115.11.0-1.el8_10
Rocky Linux:9 thunderbird 0 0:115.11.0-1.el9_4
SUSE:Enterprise Storage 7.1 MozillaFirefox 0 115.11.0-150200.152.137.2
SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS MozillaFirefox 0 115.11.0-150200.152.137.2
SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS MozillaFirefox 0 115.11.0-150200.152.137.2
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS MozillaFirefox 0 115.11.0-150200.152.137.2
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS MozillaFirefox 0 115.11.0-150200.152.137.2
SUSE:Linux Enterprise Module for Desktop Applications 15 SP5 MozillaFirefox 0 115.11.0-150200.152.137.2
SUSE:Linux Enterprise Module for Desktop Applications 15 SP6 MozillaFirefox 0 115.11.0-150200.152.137.2
SUSE:Linux Enterprise Module for Package Hub 15 SP5 MozillaThunderbird 0 115.11.0-150200.8.160.1
SUSE:Linux Enterprise Module for Package Hub 15 SP6 MozillaThunderbird 0 115.11.0-150200.8.160.1
SUSE:Linux Enterprise Server 12 SP5 MozillaFirefox 0 115.11.0-112.212.1
SUSE:Linux Enterprise Server 15 SP2-LTSS MozillaFirefox 0 115.11.0-150200.152.137.2
SUSE:Linux Enterprise Server 15 SP3-LTSS MozillaFirefox 0 115.11.0-150200.152.137.2
SUSE:Linux Enterprise Server 15 SP4-LTSS MozillaFirefox 0 115.11.0-150200.152.137.2
SUSE:Linux Enterprise Server for SAP Applications 12 SP5 MozillaFirefox 0 115.11.0-112.212.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP2 MozillaFirefox 0 115.11.0-150200.152.137.2
SUSE:Linux Enterprise Server for SAP Applications 15 SP3 MozillaFirefox 0 115.11.0-150200.152.137.2
SUSE:Linux Enterprise Server for SAP Applications 15 SP4 MozillaFirefox 0 115.11.0-150200.152.137.2
SUSE:Linux Enterprise Software Development Kit 12 SP5 MozillaFirefox 0 115.11.0-112.212.1
SUSE:Linux Enterprise Workstation Extension 15 SP5 MozillaThunderbird 0 115.11.0-150200.8.160.1
SUSE:Linux Enterprise Workstation Extension 15 SP6 MozillaThunderbird 0 115.11.0-150200.8.160.1
Ubuntu:18.04:LTS mozjs38 0 No fix
Ubuntu:18.04:LTS mozjs52 0 No fix
Ubuntu:20.04:LTS firefox 0 126.0+build2-0ubuntu0.20.04.1
Ubuntu:20.04:LTS mozjs52 0 No fix
Ubuntu:20.04:LTS mozjs68 0 No fix
Ubuntu:20.04:LTS thunderbird 0 1:115.11.0+build2-0ubuntu0.20.04.1
Ubuntu:22.04:LTS mozjs102 0 No fix
Ubuntu:22.04:LTS mozjs78 0 No fix
Ubuntu:22.04:LTS mozjs91 0 No fix
Ubuntu:22.04:LTS thunderbird 0 1:115.11.0+build2-0ubuntu0.22.04.1
Ubuntu:23.10 thunderbird 0 1:115.11.0+build2-0ubuntu0.23.10.1
Ubuntu:24.04:LTS mozjs102 0 No fix
Ubuntu:24.04:LTS thunderbird 0 2:1snap1-0ubuntu3
Ubuntu:Pro:18.04:LTS mozjs38 0 No fix
Ubuntu:Pro:18.04:LTS mozjs52 0 No fix
Ubuntu:Pro:20.04:LTS mozjs52 0 No fix
Ubuntu:Pro:20.04:LTS mozjs68 0 No fix
openSUSE:Leap 15.5 MozillaFirefox 0 115.11.0-150200.152.137.2
openSUSE:Leap 15.5 MozillaThunderbird 0 115.11.0-150200.8.160.1
openSUSE:Leap 15.6 MozillaFirefox 0 115.11.0-150200.152.137.2
openSUSE:Leap 15.6 MozillaThunderbird 0 115.11.0-150200.8.160.1
openSUSE:Tumbleweed MozillaFirefox 0 126.0-1.1
openSUSE:Tumbleweed MozillaThunderbird 0 115.11.0-1.1
openSUSE:Tumbleweed firefox-esr 0 128.5.1-1.1

Related vulnerabilities