CVE-2024-38448
📋 TL;DR
CVE-2024-38448 is a command injection vulnerability in GNU Global's htags tool that allows arbitrary code execution when processing untrusted database paths. Attackers can inject shell metacharacters through the dbpath parameter to execute commands with the privileges of the htags process. This affects all users who process untrusted input with GNU Global versions through 6.6.12.
💻 Affected Systems
- GNU Global
⚠️ 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.
- Review the CVE details at NVD
- Check vendor security advisories for your specific version
- Test if the vulnerability is exploitable in your environment
- Consider updating to the latest version as a precaution
⚠️ Risk & Real-World Impact
Worst Case
Full system compromise with root privileges if htags runs as privileged user, allowing complete control over the affected system.
Likely Case
Arbitrary code execution with the privileges of the user running htags, potentially leading to data theft, lateral movement, or persistence.
If Mitigated
Limited impact if htags runs with minimal privileges and processes only trusted input sources.
🎯 Exploit Status
Exploitation requires ability to control dbpath parameter. No public exploit code available yet, but vulnerability is straightforward to weaponize.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 6.6.13 or later
Vendor Advisory: https://lists.gnu.org/archive/html/bug-global/2024-05/msg00009.html
Restart Required: No
Instructions:
1. Download latest GNU Global from official sources. 2. Compile and install following standard build procedures. 3. Replace existing global/htags binaries with patched versions.
🔧 Temporary Workarounds
Input validation and sanitization
allValidate and sanitize all input passed to htags dbpath parameter
# Example shell wrapper that sanitizes input
#!/bin/bash
sanitized_path=$(echo "$1" | sed "s/[^a-zA-Z0-9._\/-]//g")
htags -d "$sanitized_path"
Run with minimal privileges
linuxExecute htags with non-privileged user account to limit impact
sudo -u nonprivileged_user htags -d "$path"
🧯 If You Can't Patch
- Avoid processing untrusted input with htags. Only use trusted, validated database paths.
- Implement strict input validation in wrapper scripts or applications calling htools.
🔍 How to Verify
Check if Vulnerable:
Check GNU Global version: global --version. If version is 6.6.12 or earlier, system is vulnerable.
Check Version:
global --version | head -1
Verify Fix Applied:
Verify version is 6.6.13 or later: global --version | grep -q '6\.6\.1[3-9]\|6\.6\.\d{2,}\|6\.7' && echo 'Patched'
📡 Detection & Monitoring
Log Indicators:
- Unusual shell commands in htags process logs
- Unexpected process spawns from htags execution
- Error logs containing shell metacharacters in path parameters
Network Indicators:
- Outbound connections from htags process to unexpected destinations
- DNS requests for command and control domains from build systems
SIEM Query:
process_name:"htags" AND (command_line:"*;*" OR command_line:"*`*" OR command_line:"*$(*" OR command_line:"*||*" OR command_line:"*&&*")
🔗 References
- https://cvs.savannah.gnu.org/viewvc/global/global/htags/htags.c?revision=1.236&view=markup
- https://lists.gnu.org/archive/html/bug-global/2024-05/msg00009.html
- https://cvs.savannah.gnu.org/viewvc/global/global/htags/htags.c?revision=1.236&view=markup
- https://lists.gnu.org/archive/html/bug-global/2024-05/msg00009.html