CVE-2025-65267

9.0 CRITICAL

📋 TL;DR

This vulnerability allows attackers to upload malicious SVG avatar images containing JavaScript payloads in ERPNext and Frappe Framework. When an administrator clicks to view the avatar, the JavaScript executes, enabling stored cross-site scripting attacks. All organizations using affected versions of ERPNext or Frappe Framework are at risk.

💻 Affected Systems

Products:
  • ERPNext
  • Frappe Framework
Versions: ERPNext v15.83.2 and earlier, Frappe Framework v15.86.0 and earlier
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: All deployments with avatar upload functionality enabled are vulnerable. The vulnerability requires an attacker to upload a malicious SVG file and an administrator to click the image link.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full compromise of the ERPNext instance through administrator account takeover, leading to data theft, privilege escalation, and complete system control.

🟠

Likely Case

Administrator account compromise leading to unauthorized access, data manipulation, and potential privilege escalation within the ERP system.

🟢

If Mitigated

Limited impact with proper input validation and content security policies in place, potentially blocking malicious SVG execution.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires user interaction (administrator clicking the image) but the SVG payload creation is straightforward. Public proof-of-concept exists in the GitHub repository.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: ERPNext v15.83.3+, Frappe Framework v15.86.1+

Vendor Advisory: https://github.com/frappe/erpnext

Restart Required: No

Instructions:

1. Update ERPNext to v15.83.3 or later. 2. Update Frappe Framework to v15.86.1 or later. 3. Verify the patch by testing SVG upload functionality.

🔧 Temporary Workarounds

Disable SVG Avatar Uploads

all

Temporarily disable SVG file uploads for avatar images until patching is complete.

Modify Frappe Framework configuration to restrict avatar uploads to non-SVG formats only.

Implement Content Security Policy

all

Add Content Security Policy headers to prevent inline script execution from SVG files.

Add 'Content-Security-Policy: script-src 'self'' header to web server configuration.

🧯 If You Can't Patch

  • Implement strict input validation to sanitize SVG files before processing.
  • Restrict avatar upload permissions to trusted users only and monitor upload activity.

🔍 How to Verify

Check if Vulnerable:

Check if current ERPNext version is v15.83.2 or earlier, or Frappe Framework is v15.86.0 or earlier.

Check Version:

bench version

Verify Fix Applied:

Verify installation of ERPNext v15.83.3+ or Frappe Framework v15.86.1+ and test SVG upload functionality.

📡 Detection & Monitoring

Log Indicators:

  • Unusual SVG file uploads
  • Multiple failed avatar upload attempts
  • Administrator account login from unexpected locations

Network Indicators:

  • HTTP requests containing malicious SVG payloads in uploads
  • Unusual outbound connections after avatar view

SIEM Query:

source="web_logs" AND (uri_path="/api/method/upload_file" OR uri_path CONTAINS "/files/") AND file_extension="svg" AND size>100KB

🔗 References

📤 Share & Export