CVE-2019-20787
📋 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
- Teeworlds
📦 What is this software?
Leap by Opensuse
Teeworlds by Teeworlds
⚠️ 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.
🎯 Exploit Status
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
linuxRestrict 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
- http://lists.opensuse.org/opensuse-security-announce/2020-04/msg00044.html
- http://lists.opensuse.org/opensuse-security-announce/2020-04/msg00045.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/AVYG7CCPS5F3OPOQMJKVNXTQ7BXSEX2V/
- https://www.teeworlds.com/forum/viewtopic.php?pid=123860
- http://lists.opensuse.org/opensuse-security-announce/2020-04/msg00044.html
- http://lists.opensuse.org/opensuse-security-announce/2020-04/msg00045.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/AVYG7CCPS5F3OPOQMJKVNXTQ7BXSEX2V/
- https://www.teeworlds.com/forum/viewtopic.php?pid=123860