CVE-2024-38448

9.1 CRITICAL

📋 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

Products:
  • GNU Global
Versions: All versions through 6.6.12
Operating Systems: Linux, Unix-like systems, macOS, Windows (via Cygwin/MSYS)
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability triggers when processing untrusted input via the -d (dbpath) parameter. Default usage may not be vulnerable unless processing untrusted sources.

⚠️ 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

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.

🌐 Internet-Facing: MEDIUM - Requires htags to be exposed to untrusted input, which is less common for internet-facing services.
🏢 Internal Only: HIGH - Developers and build systems frequently process untrusted code repositories, making internal exploitation more likely.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

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

all

Validate 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

linux

Execute 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

📤 Share & Export