CVE-2021-23427

8.6 HIGH

📋 TL;DR

This vulnerability in elFinder.NetCore allows attackers to extract arbitrary files from the server due to insufficient path validation in the ExtractAsync function. All versions of the package are affected, potentially exposing sensitive server files to unauthorized users.

💻 Affected Systems

Products:
  • elFinder.NetCore
Versions: All versions
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Any system using elFinder.NetCore with the vulnerable ExtractAsync function is affected regardless of configuration.

📦 What is this software?

⚠️ 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 compromise through extraction of sensitive configuration files, credentials, or source code leading to further attacks.

🟠

Likely Case

Unauthorized access to sensitive files containing application data, configuration secrets, or user information.

🟢

If Mitigated

Limited file access restricted by proper input validation and file system permissions.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires access to the file extraction functionality but is straightforward once access is obtained.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Check package repository for latest version

Vendor Advisory: https://github.com/gordon-matt/elFinder.NetCore/security/advisories

Restart Required: Yes

Instructions:

Update elFinder.NetCore package to latest version via NuGet
Rebuild and redeploy application
Test file extraction functionality

🔧 Temporary Workarounds

Disable file extraction

all

Temporarily disable the ExtractAsync functionality in the FileSystemDriver

Modify FileSystemDriver.cs to remove or comment out ExtractAsync method

Implement input validation

all

Add path traversal validation before file extraction

Add validation: if (path.Contains("..") || Path.IsPathRooted(path)) throw new SecurityException();

🧯 If You Can't Patch

  • Implement strict file system permissions to limit accessible directories
  • Deploy web application firewall with path traversal rules

🔍 How to Verify

Check if Vulnerable:

Check if elFinder.NetCore package is installed and version is not latest

Check Version:

Check project's packages.config or .csproj file for elFinder.NetCore version

Verify Fix Applied:

Test file extraction with malicious paths to ensure validation is working

📡 Detection & Monitoring

Log Indicators:

  • Multiple failed file extraction attempts
  • Unusual file access patterns from single user

Network Indicators:

  • HTTP requests with ../ patterns in file extraction parameters

SIEM Query:

source="web_server" AND (uri="*extract*" AND (param="*../*" OR param="*..\\*"))

🔗 References

📤 Share & Export