Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2025-68616-Detecting-and-Patching-an-SSRF-in-WeasyPrint-with-Wazuh — Hands-on vulnerability management case study: how Wazuh flagged a real SSRF (CVE-2025-68616) in WeasyPrint, and how I reproduced and patched it. | Kitploit
Tools/GitHubGitHub/rauljvc8/cve-2025-68616-detecting-and-patching-an-ssrf-in-weasyprint-with-wazuh
Vulnerability AnalysisWeb SecurityIntrusion DetectionLearning & EducationIncident ResponseLabs & Practice
GitHubrauljvc8/cve-2025-68616-detecting-and-patching-an-ssrf-in-weasyprint-with-wazuh

CVE-2025-68616-Detecting-and-Patching-an-SSRF-in-WeasyPrint-with-Wazuh

Hands-on vulnerability management case study: how Wazuh flagged a real SSRF (CVE-2025-68616) in WeasyPrint, and how I reproduced and patched it.

View Repository
141 month agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

From Detection to Remediation: Hunting and Patching a Real SSRF (CVE-2025-68616) in WeasyPrint with Wazuh

TL;DR

During a personal practice exercise with Wazuh (open source SIEM/XDR) on a Kali Linux machine, the Vulnerability Detection module identified a High (CVSS 7.5) severity vulnerability in the WeasyPrint package: an SSRF protection bypass (CVE-2025-68616). I investigated the finding, reproduced the issue with a local proof of concept, applied the patched version of the project, and verified that exploitation no longer works. This repository documents the full process: detection, analysis, PoC, and remediation.

Context

Wazuh is an open source security platform (SIEM + XDR) that combines, among other things, log collection, file integrity monitoring (FIM), anomaly detection, and vulnerability detection for software installed on monitored hosts, cross-referencing the package inventory against CVE databases (NVD, among others).

In this exercise, the Wazuh agent ran on a Kali GNU/Linux 2025.4 machine, with the manager, indexer, and dashboard also running locally. Before reaching the finding, the environment already had active monitoring working correctly: PAM login sessions, sudo executions, listening port changes, and rootcheck anomaly events, all visible in the module.

Threat Hunting

The Finding: CVE-2025-68616

The Vulnerability Detection module in Wazuh reported 1 High severity vulnerability on the Kali agent, associated with the weasyprint package.

Technical Detail (NVD)

WeasyPrint is a Python library that converts HTML/CSS into PDF documents, widely used to generate reports, invoices, and dynamic documents from web applications.

  • CVE: CVE-2025-68616
  • CVSS 3.x Base Score: 7.5 (High)
  • Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
  • CWE-918: Server-Side Request Forgery (SSRF)
  • CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
  • Affected versions: prior to 68.0 (cpe:2.3:a:kozea:weasyprint:*:*:*:*:*:*:*:*, up to excluding 68.0)
  • Published (NVD): 01/19/2026

Description: prior to version 68.0, an SSRF protection bypass exists in WeasyPrint's default_url_fetcher. The vulnerability allows an attacker to access internal network resources (such as localhost services or cloud metadata endpoints) even when the developer implemented a custom url_fetcher to block such access. This happens because the underlying urllib library automatically follows HTTP redirects without re-validating the new destination against the developer's security policy. Version 68.0 contains a patch for the issue.

References:

  • Official advisory: GHSA-983w-rhvv-gwmv
  • Patch commit: b6a14f0...43f0e565
  • Red Hat CVE: access.redhat.com/security/cve/CVE-2025-68616

Proof of Concept (PoC)

To confirm the real-world impact before patching, I set up a local exploitation scenario against the vulnerable version installed on the system.

1. Cloned the repository with the patch applied (main branch, which already includes the fix from version 68.0):

root@kitploit:~
git clone https://github.com/Kozea/WeasyPrint.git

2. Reviewed the fixed code, specifically weasyprint/urls.py, where the default_url_fetcher logic and redirect handling live:

3. Built a malicious HTML file that attempts to exfiltrate a local system file through an iframe, simulating the SSRF / unauthorized resource access vector described in the CVE (note: file names and file contents below are kept exactly as executed, matching the terminal output in the screenshots):

root@kitploit:~
cat << 'EOF' > ataque.html
<!DOCTYPE html>
<html>
<head>
    <title>PoC SSRF - WeasyPrint</title>
</head>
<body>
    <h1>Prueba de Exfiltración de Archivos Locales</h1>
    <p>Si el parche no está aplicado, el contenido de abajo debería mostrar el archivo /etc/passwd:</p>
    
</body>
</html>
EOF

python3 -m weasyprint ataque.html resultado_vulnerable.pdf
xdg-open resultado_vulnerable.pdf

4. Result: when opening the generated PDF, the iframe pointing to file:///etc/passwd appears empty, with no content from the system file. This confirms that, on the patched version, the attempt to access an unauthorized resource is correctly blocked.

Remediation

  • Identified that the system had a version of WeasyPrint prior to 68.0 installed, vulnerable to CVE-2025-68616.
  • Obtained the fixed code via git clone of the official repository (branch including the patch commit b6a14f0...).
  • Validated, through the PoC described above, that the patched version no longer allows access to the file:///etc/passwd resource via the iframe.

Conclusions and Lessons Learned

  • Wazuh's Vulnerability Detection module made it possible to identify a real, high-severity vulnerability in an installed dependency, without the need for manual package scanning.
  • Cross-referencing the Wazuh alert with the official CVE entry in NVD was key to understanding the exact attack vector (SSRF via url_fetcher bypass) before attempting to reproduce it.
  • Building a controlled PoC, in a personal and isolated environment, made it possible to validate the real-world impact and objectively confirm the effectiveness of the patch, rather than simply trusting the version number.
  • This workflow (detection → analysis → PoC → remediation → verification) mirrors exactly the vulnerability management lifecycle expected in a professional security environment.

Practice conducted in a personal, isolated environment (Kali Linux + Wazuh running locally) for educational purposes. No third-party systems were accessed.


Download Tool