CVE-2019-20787

9.8 CRITICAL

📋 TL;DR

CVE-2019-20787 is an integer overflow vulnerability in Teeworlds game servers when computing tilemap sizes. This allows remote attackers to cause denial of service or potentially execute arbitrary code by sending specially crafted network packets. Anyone running vulnerable Teeworlds servers (version <0.7.4) is affected.

💻 Affected Systems

Products:
  • Teeworlds
Versions: All versions before 0.7.4
Operating Systems: Linux, Windows, macOS
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects Teeworlds servers, not clients. All default configurations are vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete server compromise and potential lateral movement in the network.

🟠

Likely Case

Denial of service causing server crashes and disruption of game services.

🟢

If Mitigated

Limited to denial of service if exploit attempts are blocked at network perimeter.

🌐 Internet-Facing: HIGH - Game servers are typically internet-facing and accept connections from untrusted clients.
🏢 Internal Only: MEDIUM - Internal servers could still be exploited by malicious insiders or compromised internal systems.

🎯 Exploit Status

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

Exploitation requires sending specially crafted network packets to vulnerable servers. No authentication required.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.7.4 and later

Vendor Advisory: https://www.teeworlds.com/forum/viewtopic.php?pid=123860

Restart Required: Yes

Instructions:

1. Download Teeworlds 0.7.4 or later from official website. 2. Stop the Teeworlds server. 3. Replace the binary with the patched version. 4. Restart the server.

🔧 Temporary Workarounds

Network Isolation

linux

Restrict access to Teeworlds servers using firewall rules to only trusted IP addresses.

iptables -A INPUT -p tcp --dport 8303 -s trusted_ip -j ACCEPT
iptables -A INPUT -p tcp --dport 8303 -j DROP

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate Teeworlds servers from critical systems
  • Deploy network-based intrusion detection to monitor for exploit attempts

🔍 How to Verify

Check if Vulnerable:

Check Teeworlds server version. If version is less than 0.7.4, it is vulnerable.

Check Version:

teeworlds_srv --version

Verify Fix Applied:

Verify server is running version 0.7.4 or later and test connectivity with game clients.

📡 Detection & Monitoring

Log Indicators:

  • Server crash logs
  • Unexpected termination of teeworlds_srv process

Network Indicators:

  • Unusual packet patterns to port 8303
  • Large tilemap-related network traffic

SIEM Query:

process_name="teeworlds_srv" AND event_type="process_termination"

🔗 References

📤 Share & Export