Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2024-2066 Overview
CVE-2024-2066 is a stored cross-site scripting (XSS) vulnerability in SourceCodester Computer Inventory System 1.0. The flaw resides in /endpoint/add-computer.php, where the model parameter is not properly sanitized before being rendered. An attacker can inject arbitrary JavaScript that executes in the browser of any user who views the affected page. The issue is tracked as VulDB entry VDB-255381 and classified under CWE-79. The exploit has been publicly disclosed, lowering the barrier for opportunistic abuse against exposed instances.
Critical Impact
Remote attackers can execute arbitrary script in authenticated user sessions, enabling cookie theft, session hijacking, and administrative action abuse against the inventory application.
Affected Products
- SourceCodester Computer Inventory System 1.0
- Vendor: remyandrade
- Vulnerable component: /endpoint/add-computer.php (model parameter)
Discovery Timeline
- 2024-03-01 - CVE-2024-2066 published to NVD
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-2066
Vulnerability Analysis
The vulnerability is a stored cross-site scripting flaw within the add-computer workflow of the Computer Inventory System. The /endpoint/add-computer.php script accepts a model parameter from user input without applying contextual output encoding or input sanitization. Submitted script payloads are persisted in the application's data store and later rendered to any user who loads the inventory listing. Because the payload is stored, exploitation does not require social engineering a victim into clicking a crafted link; the trigger is passive page viewing.
The network-reachable attack surface and user interaction model allow a remote attacker to coerce script execution in another user's authenticated session. Impact is bounded to the integrity and confidentiality of client-side session state within the application context.
Root Cause
The root cause is improper neutralization of input during web page generation [CWE-79]. The model form field is written directly into HTML output without entity encoding. No server-side validation enforces an allow-list of acceptable characters, and no templating layer applies contextual escaping before rendering stored values.
Attack Vector
An attacker submits a crafted model value containing JavaScript through the add-computer form endpoint. The payload is written to the application database. When an operator or administrator loads a page that displays the stored model value, the browser parses and executes the attacker-controlled script. See the GitHub PoC Repository for the published proof-of-concept.
// No verified exploitation code is reproduced here.
// Refer to the linked VulDB and GitHub advisory for payload specifics.
Detection Methods for CVE-2024-2066
Indicators of Compromise
- POST requests to /endpoint/add-computer.php containing <script>, onerror=, onload=, or javascript: substrings in the model field.
- Unexpected outbound HTTP requests from administrator browsers to attacker-controlled hosts shortly after viewing inventory pages.
- Stored database records in the computer or equivalent table whose model column contains HTML or JavaScript syntax.
Detection Strategies
- Deploy a web application firewall rule that inspects the model parameter for HTML tags and common XSS payload patterns.
- Review web server access logs for anomalous payloads targeting /endpoint/add-computer.php across unauthenticated or low-privilege sessions.
- Perform a one-time audit query against stored inventory data to surface records containing <, >, or script tokens.
Monitoring Recommendations
- Alert on administrator browser sessions that generate cross-origin requests after visiting the inventory interface.
- Monitor for new or unexpected JavaScript source references in HTTP responses rendered by the application.
- Track repeated form submissions to the add-computer endpoint from a single source address over short time windows.
How to Mitigate CVE-2024-2066
Immediate Actions Required
- Restrict network access to the Computer Inventory System so only trusted internal users can reach /endpoint/add-computer.php.
- Purge or sanitize existing database entries containing HTML or script syntax in the model field.
- Require authentication and role-based authorization on all add-computer and inventory-view endpoints.
Patch Information
No vendor patch is referenced in the NVD entry or associated VulDB Analysis Report. Operators should treat the application as unmaintained and consider replacement or forking the project to apply fixes directly. At minimum, implement server-side input validation and contextual output encoding on all form parameters, including model.
Workarounds
- Place the application behind a reverse proxy enforcing a strict Content Security Policy that disables inline script execution.
- Add a WAF signature that rejects requests to /endpoint/add-computer.php where the model parameter contains angle brackets or event-handler attributes.
- Modify add-computer.php to wrap the model output in htmlspecialchars($model, ENT_QUOTES, 'UTF-8') before rendering.
# Example PHP output-encoding fix for the vulnerable render path
# Replace direct echo of $model with contextually encoded output:
# echo htmlspecialchars($model, ENT_QUOTES, 'UTF-8');
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

