CVE-2023-40582

9.8 CRITICAL

📋 TL;DR

CVE-2023-40582 is a command injection vulnerability in find-exec utility versions before 1.0.3 that allows attackers to execute arbitrary shell commands by controlling input parameters. This affects all users of vulnerable find-exec versions who process untrusted input. Attackers can achieve remote code execution with the privileges of the running process.

💻 Affected Systems

Products:
  • find-exec
Versions: All versions prior to 1.0.3
Operating Systems: All platforms where find-exec runs (Linux, macOS, Windows via WSL)
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability exists when processing user-controlled parameters. Default installations are vulnerable if they accept external input.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise via remote code execution, allowing attackers to install malware, exfiltrate data, or pivot to other systems.

🟠

Likely Case

Local privilege escalation or execution of arbitrary commands in the context of the vulnerable application.

🟢

If Mitigated

No impact if input validation and proper escaping are implemented, or if only trusted input is processed.

🌐 Internet-Facing: HIGH - If find-exec is exposed to untrusted network input, attackers can exploit remotely without authentication.
🏢 Internal Only: MEDIUM - Internal systems may still be vulnerable if processing untrusted input from internal sources.

🎯 Exploit Status

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

Command injection vulnerabilities are typically easy to exploit. The advisory provides technical details but no public exploit code.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 1.0.3

Vendor Advisory: https://github.com/shime/find-exec/security/advisories/GHSA-95rp-6gqp-6622

Restart Required: No

Instructions:

1. Update find-exec: npm update find-exec -g 2. Verify version: find-exec --version 3. Ensure version is 1.0.3 or higher

🔧 Temporary Workarounds

Input validation and sanitization

all

Implement strict input validation to only allow expected characters and sanitize all user input before passing to find-exec.

# Example: Validate input contains only alphanumeric characters
if [[ ! "$input" =~ ^[a-zA-Z0-9]+$ ]]; then
    echo "Invalid input"
    exit 1
fi

🧯 If You Can't Patch

  • Restrict find-exec usage to only process input from trusted, validated sources
  • Implement network segmentation and access controls to limit who can interact with vulnerable systems

🔍 How to Verify

Check if Vulnerable:

Check find-exec version: find-exec --version. If version is below 1.0.3, system is vulnerable.

Check Version:

find-exec --version

Verify Fix Applied:

After updating, verify version is 1.0.3 or higher: find-exec --version

📡 Detection & Monitoring

Log Indicators:

  • Unusual command execution patterns
  • Suspicious shell commands in find-exec process logs
  • Multiple failed parameter validation attempts

Network Indicators:

  • Unexpected outbound connections from find-exec processes
  • Command and control traffic patterns

SIEM Query:

process.name:"find-exec" AND (cmdline:*;* OR cmdline:*&* OR cmdline:*|* OR cmdline:*`*)

🔗 References

📤 Share & Export