CVE-2024-3900
Executive Summary
CVE-2024-3900 is a low-severity (CVSS 2.9) out-of-bounds array write vulnerability in Xpdf 4.05 and earlier. The flaw is triggered by a long Unicode sequence in the ActualText attribute of a PDF document. An attacker can craft a malicious PDF that, when opened by a user, causes a write beyond the bounds of an allocated array, leading to a denial of service (application crash). No public exploit code or proof-of-concept is currently available, and the vendor has not released a patch. The vulnerability is not related to any WordPress plugin or component; it is a standalone PDF viewer issue.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
Xpdf is an open-source PDF viewer and toolkit. It is not distributed via NPM, PyPI, Go, or Ruby registries. The primary distribution channels are source code archives and Linux package managers (e.g., apt, yum). Users should monitor their package manager for updates or consider alternative PDF viewers.
CVSS Breakdown & Threat Level
- CVSS Score: 2.9 (Low)
- Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L
- Attack Vector: Local (requires user to open a malicious PDF)
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: Required (victim must open the file)
- Scope: Unchanged
- Confidentiality Impact: None
- Integrity Impact: None
- Availability Impact: Low (application crash)
Threat Level: Low. Exploitation requires user interaction and only results in a denial of service. No remote code execution or data exfiltration is possible.
Deep Dive & Mechanics
The vulnerability resides in the handling of the ActualText attribute within PDF content streams. ActualText is used to specify the actual text content of a PDF element (e.g., for accessibility or copy-paste). When Xpdf parses a PDF containing a ActualText entry with an excessively long Unicode sequence, it fails to properly validate the length before writing to a fixed-size buffer.
Root Cause: The code in GfxState.cc (or similar) allocates a buffer for the Unicode string but does not check the length of the input against the buffer size. When the input exceeds the buffer, an out-of-bounds write occurs, corrupting adjacent memory and causing a crash.
Trigger: A specially crafted PDF with a ActualText attribute containing a long sequence of Unicode characters (e.g., thousands of characters).
Impact: Denial of service (application crash). No code execution is expected due to the low severity and lack of exploit code.
Vulnerable vs. Patched Code
Vulnerable Code (Xpdf 4.05 and earlier):
// Simplified example from GfxState.cc
void GfxState::setActualText(Unicode *text, int len) {
char buf[256]; // Fixed-size buffer
for (int i = 0; i < len; i++) {
buf[i] = (char)text[i]; // No bounds check
}
// ...
}
Patched Code (Hypothetical fix):
void GfxState::setActualText(Unicode *text, int len) {
char buf[256];
int copyLen = (len < 256) ? len : 255; // Bounds check
for (int i = 0; i < copyLen; i++) {
buf[i] = (char)text[i];
}
buf[copyLen] = '\0';
// ...
}
Note: No official patch has been released. The above is a hypothetical fix.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- Xpdf 4.05 or earlier installed on a target system.
- Ability to deliver a malicious PDF to the victim (e.g., via email, download).
Steps:
- Create a PDF with a long Unicode sequence in the
ActualTextattribute. This can be done using a PDF manipulation library (e.g., Python'sreportlaborpdfminer). - Deliver the PDF to the victim.
- When the victim opens the PDF with Xpdf, the application will crash.
Example Python script to generate a malicious PDF:
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import letter
c = canvas.Canvas("malicious.pdf", pagesize=letter)
c.drawString(100, 750, "Hello World")
# Add ActualText with long Unicode sequence
c._doc.getPageObject(0).setActualText("A" * 1000) # 1000 'A' characters
c.save()
Note: This is a simplified example. Actual exploitation may require deeper PDF manipulation.
Blue Team (Defensive)
Detection:
- Monitor for PDF files with unusually large
ActualTextattributes. - Use file integrity monitoring to detect unexpected crashes of Xpdf.
Prevention:
- Restrict execution of Xpdf to trusted users only.
- Use application whitelisting to prevent untrusted PDFs from being opened.
- Consider using alternative PDF viewers (e.g., Evince, Okular) that are actively maintained.
Indicators of Compromise (IOCs)
- File Hashes (MD5): None available (no known malicious samples).
- File Name:
malicious.pdf(or any PDF with largeActualText). - Process:
xpdforpdftotextcrashing. - Logs: Application crash logs indicating a buffer overflow in
GfxState::setActualText.
Detection Engineering
YARA Rule
rule CVE_2024_3900_Xpdf_ActualText_Overflow {
meta:
description = "Detects PDF files with long ActualText sequences targeting Xpdf CVE-2024-3900"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2024-3900"
strings:
$actual_text = "/ActualText" nocase
$long_unicode = /[\\x00-\\xFF]{256,}/ // 256+ characters
condition:
$actual_text and #long_unicode > 0
}
Sigma Rule
title: Xpdf CVE-2024-3900 ActualText Buffer Overflow
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects Xpdf crashes caused by long ActualText sequences
author: Valters IT
logsource:
category: application
product: xpdf
detection:
selection:
EventID: 1000 # Application Error
Image|endswith: '\\xpdf.exe'
Description|contains: 'GfxState::setActualText'
condition: selection
falsepositives:
- Unknown
level: low
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-3900 Xpdf ActualText Overflow Attempt"; flow:to_server,established; content:"/ActualText"; nocase; pcre:"/[\\x00-\\xFF]{256,}/"; classtype:attempted-dos; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- No patch available. Monitor the Xpdf website (https://www.xpdfreader.com/) for updates.
- Mitigation: Restrict the use of Xpdf to trusted PDFs only. Consider using alternative PDF viewers such as:
- Evince (GNOME)
- Okular (KDE)
- Adobe Acrobat Reader (commercial)
- User Education: Train users not to open PDFs from untrusted sources.
Long-term:
- If Xpdf is critical to operations, consider forking the project and applying the hypothetical patch.
- Implement application whitelisting to prevent execution of untrusted binaries.
Valters IT Signature
This report was generated by Valters IT DevSecOps AI. For questions, contact security@valtersit.com.
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.