Skip to main content

CVE-2024-8174: Blood Bank System XSS Vulnerability

CVE-2024-8174 is a cross-site scripting flaw in Blood Bank System 1.0 affecting the login page. Attackers can inject malicious scripts through user input. This article covers technical details, affected versions, and mitigation.

Published:

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-8174 Overview

CVE-2024-8174 is a reflected cross-site scripting (XSS) vulnerability in code-projects Blood Bank System 1.0. The flaw resides in the /login.php endpoint, where the user parameter is rendered without proper output encoding. Attackers can craft a malicious URL that injects arbitrary JavaScript into the login page response. The attack is executed remotely over the network and requires no authentication. The exploit has been publicly disclosed, increasing the probability of opportunistic abuse against exposed instances.

Critical Impact

Remote attackers can inject arbitrary script into the login page via the user parameter, enabling session theft, credential harvesting, and client-side redirection against users of the Blood Bank System.

Affected Products

  • code-projects Blood Bank System 1.0
  • Component: Login Page (/login.php)
  • Parameter: user

Discovery Timeline

  • 2024-08-26 - CVE-2024-8174 published to the National Vulnerability Database
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2024-8174

Vulnerability Analysis

The vulnerability is a reflected cross-site scripting flaw classified under CWE-79. The /login.php script accepts user-supplied input through the user request parameter and echoes that value back into the HTML response. Because the application does not perform contextual output encoding or input sanitization, an attacker can supply JavaScript payloads that execute in the victim's browser session. The flaw is exploitable without authentication and requires only that a victim load an attacker-crafted URL.

Successful exploitation runs in the context of the Blood Bank System origin. Attackers can steal session cookies, harvest login credentials entered on the compromised page, perform actions on behalf of authenticated users, or redirect visitors to attacker-controlled infrastructure.

Root Cause

The root cause is missing input validation and output encoding on the user parameter processed by /login.php. Input flows directly from the HTTP request into the rendered HTML response, allowing injection of <script> tags or event-handler attributes that the browser executes.

Attack Vector

The attack vector is network-based and requires user interaction, typically through phishing or a malicious link. The attacker crafts a URL pointing to the vulnerable login.php endpoint containing a JavaScript payload in the user query parameter. When the victim visits the URL, the payload reflects into the response and executes in the browser.

Technical details are documented in the GitHub XSS Vulnerability Report and the VulDB entry #275773.

Detection Methods for CVE-2024-8174

Indicators of Compromise

  • HTTP requests to /login.php containing <script>, javascript:, onerror=, or onload= substrings in the user parameter.
  • URL-encoded script fragments such as %3Cscript%3E or %3Cimg%20src%3Dx%20onerror%3D targeting the login endpoint.
  • Referrer headers from external domains linking directly to /login.php with query strings on the user parameter.
  • Browser console errors or outbound requests from the login page to unexpected third-party domains.

Detection Strategies

  • Deploy a web application firewall (WAF) rule that blocks or alerts on script-like patterns in query parameters sent to /login.php.
  • Review web server access logs for anomalous user parameter values containing HTML tags or JavaScript keywords.
  • Instrument the application with a strict Content Security Policy (CSP) in report-only mode to surface injection attempts.

Monitoring Recommendations

  • Forward web server and WAF logs to a centralized analytics platform for continuous inspection of the /login.php endpoint.
  • Alert on repeated requests from a single source containing encoded HTML or JavaScript metacharacters.
  • Monitor DNS and proxy logs for outbound connections to newly registered or low-reputation domains originating from users who visited the login page.

How to Mitigate CVE-2024-8174

Immediate Actions Required

  • Restrict external exposure of the Blood Bank System until a sanitization fix is applied; place it behind an authenticated VPN or IP allow list.
  • Deploy WAF rules that block requests to /login.php containing HTML tags, JavaScript URIs, or event-handler attributes in the user parameter.
  • Audit /login.php source code and apply contextual output encoding using functions such as htmlspecialchars($user, ENT_QUOTES, 'UTF-8') before echoing user input.
  • Set HttpOnly and Secure flags on session cookies to limit the impact of successful script execution.

Patch Information

At the time of publication, the vendor code-projects has not published an official patch for Blood Bank System 1.0. Organizations running this application should apply source-level fixes to encode and validate the user parameter in /login.php, or discontinue use of the affected release. Monitor the code-projects website for updates.

Workarounds

  • Enforce a strict Content Security Policy that disallows inline scripts, for example Content-Security-Policy: default-src 'self'; script-src 'self'.
  • Apply server-side input validation that rejects any user parameter containing <, >, ", ', or / characters before processing.
  • Reverse-proxy the application through a hardened gateway that strips or encodes dangerous metacharacters in query strings.
bash
# Example Apache mod_security rule to block reflected XSS on /login.php
SecRule REQUEST_URI "@beginsWith /login.php" \
  "id:1008174,phase:2,deny,status:403,log,msg:'CVE-2024-8174 XSS attempt',\
   chain"
  SecRule ARGS:user "@rx (?i)(<script|javascript:|onerror=|onload=|<img)" \
    "t:none,t:urlDecodeUni,t:htmlEntityDecode"

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

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.