CVE-2024-42640

9.8 CRITICAL

📋 TL;DR

CVE-2024-42640 is an unauthenticated remote code execution vulnerability in angular-base64-upload versions prior to 0.1.21. Attackers can upload arbitrary files to the server via demo/server.php and execute them through demo/uploads, achieving full server compromise. This affects all deployments using vulnerable versions of this unsupported library.

💻 Affected Systems

Products:
  • angular-base64-upload
Versions: All versions prior to 0.1.21
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects deployments with demo/server.php accessible. The library is no longer maintained by the original developer.

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete server takeover allowing data theft, lateral movement, ransomware deployment, and persistent backdoor installation.

🟠

Likely Case

Server compromise leading to data exfiltration, cryptocurrency mining, or use as attack infrastructure.

🟢

If Mitigated

Limited impact if proper file upload validation and execution restrictions are in place.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation is straightforward with public proof-of-concept available. No authentication required.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.1.21

Vendor Advisory: https://github.com/adonespitogo/angular-base64-upload

Restart Required: No

Instructions:

1. Update angular-base64-upload to version 0.1.21 or later. 2. Remove demo/server.php if not needed. 3. Verify demo/uploads directory has proper access controls.

🔧 Temporary Workarounds

Remove demo files

all

Delete the vulnerable demo/server.php file and demo/uploads directory

rm -rf demo/server.php
rm -rf demo/uploads

Restrict file uploads

linux

Implement strict file type validation and disable execution in upload directories

chmod -R 644 demo/uploads/*
find demo/uploads -type f -name '*.php' -delete

🧯 If You Can't Patch

  • Remove or block access to demo/server.php endpoint
  • Implement web application firewall rules to block file uploads to demo/uploads

🔍 How to Verify

Check if Vulnerable:

Check if demo/server.php exists and is accessible. Test if you can upload files to demo/uploads directory.

Check Version:

Check package.json for angular-base64-upload version

Verify Fix Applied:

Verify angular-base64-upload version is 0.1.21 or later. Confirm demo/server.php is removed or inaccessible.

📡 Detection & Monitoring

Log Indicators:

  • HTTP POST requests to demo/server.php
  • File creation in demo/uploads directory
  • Execution of uploaded files from demo/uploads

Network Indicators:

  • Unusual outbound connections from server after file upload
  • Traffic patterns matching known exploit payloads

SIEM Query:

source="web_server" AND (uri="/demo/server.php" OR uri CONTAINS "/demo/uploads/")

🔗 References

📤 Share & Export