IPBUF安全漏洞报告
English
CVE-2026-30561 CVSS 6.1 中危

CVE-2026-30561 SourceCodester销售库存系统XSS漏洞

披露日期: 2026-03-30

漏洞信息

漏洞编号
CVE-2026-30561
漏洞类型
XSS
CVSS评分
6.1 中危
攻击向量
网络 (AV:N)
认证要求
无需认证 (PR:N)
用户交互
需要交互 (UI:R)
影响产品
SourceCodester Sales and Inventory System

相关标签

XSSReflected XSSSourceCodesterWeb SecurityCVE-2026-30561

漏洞概述

SourceCodester Sales and Inventory System 1.0 版本中的 add_purchase.php 文件存在反射型跨站脚本(XSS)漏洞。由于应用程序未对 msg 参数进行严格的输入过滤和清理,远程攻击者可以通过构造恶意 URL 来注入任意的 Web 脚本或 HTML 代码。当受害者访问该链接时,恶意脚本将在其浏览器中执行,可能导致窃取 Cookie 或会话劫持等安全风险。

技术细节

该漏洞属于反射型跨站脚本攻击(Reflected XSS)。漏洞产生的根本原因在于 SourceCodester Sales and Inventory System 1.0 的 add_purchase.php 页面在处理用户输入时,对 msg 参数缺乏必要的安全过滤机制。应用程序直接将用户提交的数据未经任何转义就反射回 HTTP 响应页面中。攻击者可利用此漏洞,构造包含恶意 JavaScript 代码的 URL(例如 <script>alert(document.cookie)</script>)。由于该攻击需要用户交互(CVSS 向量 UI:R),攻击者通常结合钓鱼邮件或社会工程学手段诱导受害者点击链接。一旦受害者访问,浏览器将解析并执行注入的脚本,攻击者即可借此窃取用户的敏感信息(如 Session ID、Cookie)、执行未授权操作或将用户重定向至恶意网站,对用户的数据机密性和完整性构成威胁。

攻击链分析

STEP 1
Reconnaissance
Identify the target system running SourceCodester Sales and Inventory System 1.0.
STEP 2
Weaponization
Craft a malicious URL containing JavaScript payload within the 'msg' parameter of add_purchase.php.
STEP 3
Delivery
Send the malicious URL to the victim via phishing emails or social engineering.
STEP 4
Exploitation
The victim clicks the link, sending a request to the server with the unfiltered payload.
STEP 5
Execution
The server reflects the payload in the response, and the victim's browser executes the malicious script.

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
// PoC for CVE-2026-30561 // Target: SourceCodester Sales and Inventory System 1.0 // File: add_purchase.php // Parameter: msg // Payload to inject var payload = "<script>alert('CVE-2026-30561 XSS');</script>"; // Vulnerable URL construction var targetUrl = "http://example.com/add_purchase.php?msg=" + encodeURIComponent(payload); // Simulate request console.log("Execute the following URL in a browser to trigger the vulnerability:"); console.log(targetUrl); // HTTP Request Example: // GET /add_purchase.php?msg=<script>alert('CVE-2026-30561 XSS');</script> HTTP/1.1 // Host: example.com

影响范围

SourceCodester Sales and Inventory System 1.0

防御指南

临时缓解措施
建议立即升级到最新版本或应用官方补丁。在无法立即修复的情况下,应通过WAF添加规则过滤针对'add_purchase.php'中'msg'参数的恶意脚本输入,并对所有用户输出进行编码处理,同时加强用户安全意识教育,警惕不明链接。

参考链接

快速导航: 前沿安全 最新收录域名列表 最新威胁情报列表 最新网站排名列表 最新工具资源列表 最新CVE漏洞列表