关键信息总结 产品信息 Vendor Homepage: phpgurukul.com/news-portal-using-python-django-and-mysql Affected Version: <= v1.0 BUG Author: Ravi Sharma 漏洞详情 Vulnerability Type: Stored Cross-Site Scripting (XSS) via Unrestricted SVG File Upload Affected URL: - http://127.0.0.1:8000/AdminProfile - http://127.0.0.1:8000/AddSubadmin - http://127.0.0.1:8000/ViewSubadmin/9 Vulnerable Parameter: in and 漏洞文件 File Name: Path: , 漏洞类型 CWE: CWE-79, CWE-434, CWE-80 Severity Level: 8.7 (HIGH) 根因分析 Lack of File Type Validation Profile Picture Update - ADMIN_PROFILE_UPDATE Function Subadmin Profile Update - SUBADMIN_PROFILE_UPDATE Function 安全缺陷 No file extension validation No MIME type verification No content sanitization No verification of file type 影响 Allows SVG files with embedded JavaScript to be stored and rendered 漏洞细节 Description: Multiple Stored Cross-Site Scripting (XSS) vulnerabilities due to lack of validation, sanitization, and restriction of file types. 修复建议 1. Disallow Dangerous File Types: Block uploads of executable formats; use strict allowlist. 2. Enforce Proper Content-Type Handling: Validate file content using server-side MIME type checks. 3. Sanitize SVG Files: Remove , event handlers, and external references. 4. Serve Uploaded Files Safely: Serve uploads from a separate domain. 5. Implement Content Security Policy (CSP): Use a restrictive CSP. 6. Disable Inline JavaScript Execution 7. Conduct Security Code Review