CVE-2026-30561
Received Received - Intake
Reflected XSS in SourceCodester Sales Inventory add_purchase.php

Publication date: 2026-03-30

Last updated on: 2026-04-06

Assigner: MITRE

Description
A Reflected Cross-Site Scripting (XSS) vulnerability exists in SourceCodester Sales and Inventory System 1.0. The vulnerability is located in the add_purchase.php file via the "msg" parameter. The application fails to sanitize the input, allowing remote attackers to inject arbitrary web script or HTML via a crafted URL.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-03-30
Last Modified
2026-04-06
Generated
2026-05-07
AI Q&A
2026-03-30
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
ahsanriaz26gmailcom sales_and_inventory_system 1.0
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-79 The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

CVE-2026-30561 is a Reflected Cross-Site Scripting (XSS) vulnerability found in the SourceCodester Sales and Inventory System version 1.0, specifically in the add_purchase.php file.

The vulnerability occurs because the application accepts a "msg" parameter via a URL without properly sanitizing it, allowing an attacker to inject arbitrary web scripts or HTML.

When an authenticated user, typically an administrator, visits a crafted URL containing malicious JavaScript code in the "msg" parameter, the injected script executes in their browser.


How can this vulnerability impact me? :

This vulnerability can have serious impacts if exploited by an attacker.

  • Attackers can execute arbitrary JavaScript code in the context of an authenticated administrator's browser.
  • It can lead to session hijacking, allowing attackers to steal administrator session cookies.
  • Attackers may escalate privileges and perform unauthorized actions on behalf of the administrator.
  • The attack requires tricking an authenticated admin into visiting a maliciously crafted URL.

How can this vulnerability be detected on my network or system? Can you suggest some commands?

This vulnerability can be detected by testing the add_purchase.php page with a crafted URL containing a malicious payload in the "msg" parameter to see if the input is reflected and executed without sanitization.

For example, you can use a web browser or command-line tools like curl to send a GET request with a payload such as:

  • curl "http://<target-host>/add_purchase.php?msg=<img src='x' onerror='alert(808774)'>"

If the response page executes the injected script (e.g., an alert box appears), it confirms the presence of the reflected XSS vulnerability.

Note that the vulnerable page is accessible only to authenticated users, typically administrators, so the test should be performed in an authenticated session.


How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

The Reflected Cross-Site Scripting (XSS) vulnerability in SourceCodester Sales and Inventory System 1.0 can lead to session hijacking and unauthorized actions by attackers impersonating administrators.

Such unauthorized access and potential data breaches could impact compliance with standards like GDPR and HIPAA, which require protection of user data and secure access controls.

Specifically, if attackers steal session cookies or escalate privileges, they may gain access to sensitive personal or health information, violating confidentiality and security requirements mandated by these regulations.


What immediate steps should I take to mitigate this vulnerability?

To mitigate the Reflected Cross-Site Scripting (XSS) vulnerability in the add_purchase.php file via the "msg" parameter, immediate steps include:

  • Avoid clicking or visiting any suspicious or untrusted URLs containing the "msg" parameter until the vulnerability is fixed.
  • Restrict access to the vulnerable page (add_purchase.php) to only trusted and authenticated users, minimizing exposure.
  • Inform administrators and users about the risk of clicking on crafted URLs that could execute malicious scripts.
  • Implement input validation and output encoding on the "msg" parameter to sanitize user input and prevent script injection.
  • Consider applying web application firewall (WAF) rules to detect and block malicious payloads targeting the "msg" parameter.

Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart