CVE-2020-24361

9.8 CRITICAL

📋 TL;DR

CVE-2020-24361 is a critical remote code execution vulnerability in SNMPTT (SNMP Trap Translator) that allows attackers to execute arbitrary shell commands via EXEC, PREXEC, or unknown_trap_exec directives. This affects organizations using SNMPTT for SNMP trap processing, particularly those with untrusted SNMP trap sources. The vulnerability stems from improper input validation when processing SNMP trap data.

💻 Affected Systems

Products:
  • SNMPTT (SNMP Trap Translator)
Versions: All versions before 1.4.2
Operating Systems: Linux, Unix-like systems, Windows (if compiled from source)
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability exists when EXEC, PREXEC, or unknown_trap_exec directives are configured in snmptt.conf. Default configurations may not use these directives, but many production deployments do.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise with root/administrator privileges, allowing attackers to install malware, exfiltrate data, pivot to other systems, or establish persistent backdoors.

🟠

Likely Case

Unauthorized command execution with SNMPTT process privileges, potentially leading to service disruption, data manipulation, or lateral movement within the network.

🟢

If Mitigated

Limited impact with proper network segmentation, SNMP source validation, and least privilege configurations restricting SNMPTT's execution capabilities.

🌐 Internet-Facing: HIGH - SNMPTT often processes traps from external monitoring systems or devices, making internet-facing instances particularly vulnerable to exploitation.
🏢 Internal Only: MEDIUM - Internal SNMPTT instances are still vulnerable to attacks from compromised internal devices or malicious insiders, though attack surface is reduced.

🎯 Exploit Status

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

Exploitation requires sending specially crafted SNMP traps to the vulnerable SNMPTT instance. No authentication is needed if SNMPTT is configured to accept traps from the attacker's source.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 1.4.2 and later

Vendor Advisory: http://www.snmptt.org/changelog.shtml

Restart Required: Yes

Instructions:

1. Download SNMPTT 1.4.2 or later from http://www.snmptt.org/download.shtml
2. Stop SNMPTT service: 'systemctl stop snmptt' or equivalent
3. Backup current configuration files
4. Install new version following distribution-specific package management or compilation instructions
5. Restart SNMPTT service: 'systemctl start snmptt' or equivalent

🔧 Temporary Workarounds

Disable vulnerable directives

linux

Remove or comment out EXEC, PREXEC, and unknown_trap_exec directives from snmptt.conf file

sed -i 's/^EXEC/#EXEC/g' /etc/snmp/snmptt.conf
sed -i 's/^PREXEC/#PREXEC/g' /etc/snmp/snmptt.conf
sed -i 's/^unknown_trap_exec/#unknown_trap_exec/g' /etc/snmp/snmptt.conf

Restrict SNMP trap sources

linux

Configure SNMPTT to only accept traps from trusted sources using firewall rules or SNMPTT configuration

iptables -A INPUT -p udp --dport 162 -s trusted_ip -j ACCEPT
iptables -A INPUT -p udp --dport 162 -j DROP

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate SNMPTT systems from untrusted networks
  • Run SNMPTT with minimal privileges using a dedicated non-root user account

🔍 How to Verify

Check if Vulnerable:

Check SNMPTT version: 'snmptt --version' or 'rpm -q snmptt' or 'dpkg -l | grep snmptt'. If version is below 1.4.2, check if EXEC/PREXEC/unknown_trap_exec directives exist in configuration: 'grep -E "^(EXEC|PREXEC|unknown_trap_exec)" /etc/snmp/snmptt.conf'

Check Version:

snmptt --version 2>&1 | head -1

Verify Fix Applied:

Verify SNMPTT version is 1.4.2 or higher: 'snmptt --version'. Test by sending a test SNMP trap with shell metacharacters to verify they are properly escaped.

📡 Detection & Monitoring

Log Indicators:

  • Unusual command execution in SNMPTT logs
  • Suspicious SNMP trap patterns with shell metacharacters
  • Failed command execution attempts in system logs

Network Indicators:

  • SNMP traps containing shell metacharacters or command injection patterns
  • Unexpected outbound connections from SNMPTT host

SIEM Query:

source="snmptt.log" AND ("EXEC" OR "PREXEC" OR "unknown_trap_exec") AND ("$" OR "|" OR ";" OR "`" OR "&" OR "(" OR ")")

🔗 References

📤 Share & Export