CVE-2021-21404
📋 TL;DR
This vulnerability allows attackers to crash Syncthing file synchronization software and its relay server by sending messages with negative length fields. Both Syncthing clients and strelaysrv relay servers are affected. The crash causes denial of service, though Syncthing typically restarts automatically.
💻 Affected Systems
- Syncthing
- strelaysrv
📦 What is this software?
Syncthing by Syncthing
⚠️ Risk & Real-World Impact
Worst Case
Persistent denial of service through repeated crashes, potentially disrupting file synchronization services and relay infrastructure.
Likely Case
Temporary service disruption with automatic restart, causing brief synchronization interruptions.
If Mitigated
Minimal impact with proper patching and network controls in place.
🎯 Exploit Status
Exploit requires sending specially crafted messages to vulnerable endpoints. Public advisory includes technical details.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 1.15.0
Vendor Advisory: https://github.com/syncthing/syncthing/security/advisories/GHSA-x462-89pf-6r5h
Restart Required: Yes
Instructions:
1. Download Syncthing 1.15.0 or later from official sources. 2. Stop Syncthing service. 3. Replace binary with patched version. 4. Restart service. For strelaysrv: update to version included with Syncthing 1.15.0+.
🔧 Temporary Workarounds
Disable relay usage
allConfigure Syncthing to not use relay servers
Edit config.xml: set <relaysEnabled>false</relaysEnabled>
Or use GUI: Settings > Connections > uncheck 'Use relays'
Network filtering
allBlock access to relay servers at network level
Firewall rule: block outbound to relay.syncthing.net:443
Firewall rule: block inbound/outbound to port 22067 (relay protocol)
🧯 If You Can't Patch
- Implement network segmentation to isolate Syncthing traffic
- Monitor for crash/restart patterns and implement rate limiting
🔍 How to Verify
Check if Vulnerable:
Check Syncthing version: syncthing --version. If version is below 1.15.0, system is vulnerable.
Check Version:
syncthing --version
Verify Fix Applied:
Confirm version is 1.15.0 or higher and test relay connectivity remains functional.
📡 Detection & Monitoring
Log Indicators:
- Unexpected Syncthing process crashes
- Restart messages in logs
- Connection errors to relay servers
Network Indicators:
- Malformed packets with negative length fields to port 22067
- Unusual traffic patterns to relay infrastructure
SIEM Query:
process:syncthing AND (event:crash OR event:restart) OR network.dst_port:22067 AND packet_size:<0
🔗 References
- https://github.com/syncthing/syncthing/commit/fb4fdaf4c0a79c22cad000c42ac1394e3ccb6a97
- https://github.com/syncthing/syncthing/releases/tag/v1.15.0
- https://github.com/syncthing/syncthing/security/advisories/GHSA-x462-89pf-6r5h
- https://pkg.go.dev/github.com/syncthing/syncthing
- https://github.com/syncthing/syncthing/commit/fb4fdaf4c0a79c22cad000c42ac1394e3ccb6a97
- https://github.com/syncthing/syncthing/releases/tag/v1.15.0
- https://github.com/syncthing/syncthing/security/advisories/GHSA-x462-89pf-6r5h
- https://pkg.go.dev/github.com/syncthing/syncthing