CVE-2022-24278

7.5 HIGH

📋 TL;DR

CVE-2022-24278 is a directory traversal vulnerability in convert-svg-core that allows attackers to read arbitrary files on the server by uploading specially crafted SVG files. This affects applications using convert-svg-core for SVG processing, particularly web applications that accept user-uploaded SVG files. The vulnerability stems from improper sanitization of SVG tags that can contain path traversal sequences.

💻 Affected Systems

Products:
  • convert-svg-core
Versions: All versions before 0.6.4
Operating Systems: All operating systems running Node.js
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects applications that process SVG files using the vulnerable convert-svg-core package. The vulnerability requires SVG file input to be processed.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete server file system disclosure including sensitive configuration files, credentials, and source code, potentially leading to full system compromise.

🟠

Likely Case

Unauthorized access to application files, configuration data, and potentially sensitive user data stored on the server.

🟢

If Mitigated

Limited file access restricted to the application's directory if proper file permissions and sandboxing are implemented.

🌐 Internet-Facing: HIGH - Web applications accepting SVG uploads are directly exposed to exploitation attempts from the internet.
🏢 Internal Only: MEDIUM - Internal applications could be exploited by authenticated users or through other attack vectors.

🎯 Exploit Status

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

Exploitation requires the ability to upload or provide SVG files to the vulnerable application. The vulnerability is well-documented with public proof-of-concept examples available.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.6.4 and later

Vendor Advisory: https://github.com/neocotic/convert-svg/security/advisories/GHSA-7vpr-3q9h-5hx6

Restart Required: No

Instructions:

1. Update convert-svg-core to version 0.6.4 or later using npm update convert-svg-core. 2. Verify the update with npm list convert-svg-core. 3. Test SVG processing functionality after update.

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Implement server-side validation to reject SVG files containing suspicious path traversal patterns before processing.

// Example Node.js validation: if (svgContent.includes('..') || svgContent.includes('/etc') || svgContent.includes('/var')) { rejectFile(); }

File Processing Sandbox

linux

Run SVG processing in a containerized or sandboxed environment with restricted file system access.

docker run --read-only -v /tmp:/tmp:ro node-app

🧯 If You Can't Patch

  • Disable SVG file upload functionality entirely in the application
  • Implement strict file type validation and only allow trusted, pre-verified SVG files

🔍 How to Verify

Check if Vulnerable:

Check package.json for convert-svg-core version: grep -A2 -B2 convert-svg-core package.json

Check Version:

npm list convert-svg-core

Verify Fix Applied:

Verify installed version is 0.6.4 or higher: npm list convert-svg-core | grep convert-svg-core

📡 Detection & Monitoring

Log Indicators:

  • Unusual file access patterns from SVG processing, multiple failed SVG upload attempts, error logs showing path traversal attempts

Network Indicators:

  • Large SVG file uploads containing encoded path traversal sequences, unusual outbound file transfers following SVG processing

SIEM Query:

source="application.logs" AND ("convert-svg" OR "svg processing") AND (".." OR "/etc" OR "/var" OR "path traversal")

🔗 References

📤 Share & Export