CVE-2021-21404
JSON

7.5high

Crash due to malformed relay protocol message

Severity
7.5high CVSS:3.1 by GitHub_M
Exploit likelihood
1.97% (higher than 81% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-x462-89pf-6r5hBIT-SYNCTHING-2021-21404GO-2022-0888

Description

Syncthing is a continuous file synchronization program. In Syncthing before version 1.15.0, the relay server `strelaysrv` can be caused to crash and exit by sending a relay message with a negative length field. Similarly, Syncthing itself can crash for the same reason if given a malformed message from a malicious relay server when attempting to join the relay. Relay joins are essentially random (from a subset of low latency relays) and Syncthing will by default restart when crashing, at which point it's likely to pick another non-malicious relay. This flaw is fixed in version 1.15.0.

Affected

Product or packageVersionsReported by
syncthing syncthing< 1.15.0, before 1.15.0CVE List, NVD
github.com/syncthing/syncthing (Go)before 1.15.0GitHub Advisory Database, Go Vulnerability Database
syncthing (Bitnami)before 1.15.0Bitnami Vulnerability Database

All scores

GitHub_M7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHub7.5low CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD5.0medium CVSS:2.0AV:N/AC:L/Au:N/C:N/I:N/A:P
Bitnami Vulnerability Databasehigh rating

Classification

What each source says

CVE List

Syncthing is a continuous file synchronization program. In Syncthing before version 1.15.0, the relay server `strelaysrv` can be caused to crash and exit by sending a relay message with a negative length field. Similarly, Syncthing itself can crash for the same reason if given a malformed message from a malicious relay server when attempting to join the relay. Relay joins are essentially random (from a subset of low latency relays) and Syncthing will by default restart when crashing, at which point it's likely to pick another non-malicious relay. This flaw is fixed in version 1.15.0.

GitHub Advisory Database
Impact
  1. syncthing can be caused to crash and exit if sent a malformed relay protocol message message with a negative length field.

  2. The relay server strelaysrv can be caused to crash and exit if sent a malformed relay protocol message with a negative length field.

At no point is sensitive data exposed or liable to be altered due to this issue. Sensitive data is never exposed to relay operators. Syncthing itself would need to be lured to connect to a malicious relay server in order to exploit the issue.

Patches

Fixed in version 1.15.0.

Workarounds
  1. No known workaround for strelaysrv.

  2. syncthing can be configured to not use relays, or to only use specific, trusted relays. If Syncthing is used in a closed environment or with relaying disabled, i.e., it does not communicate with unknown relays, Syncthing is not vulnerable.

For more information

If you have any questions or comments about this advisory, please discuss it on the forum.

Thanks to Wojciech Paciorek for discovering and reporting this issue.

Go Vulnerability Database

Crash due to malformed relay protocol message in github.com/syncthing/syncthing

NVD (es)

Syncthing es un programa de sincronización de archivos continua.&#xa0;En Syncthing versiones anteriores a 1.15.0, el servidor de retransmisión "strelaysrv" puede causar un bloqueo y salida mediante el envío de un mensaje de retransmisión con un campo de longitud negativa.&#xa0;De manera similar, Syncthing en sí puede presentar un fallo por la misma razón si recibe un mensaje malformado de un servidor de retransmisión malicioso al intentar unirse a la retransmisión.&#xa0;Las uniones de retransmisiones son esencialmente aleatorias (de un subconjunto de retransmisiones de baja latencia) y Syncthing se reiniciará por defecto cuando se bloquee, momento en el que es probable que elija otra retransmisión no maliciosa.&#xa0;Este fallo es corregido en la versión 1.15.0

References

Sources

SourceRecordLicence
CVE ListCVE-2021-21404 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-x462-89pf-6r5h changed 2026-07-08CC-BY-4.0
Go Vulnerability DatabaseGO-2022-0888 changed 2026-03-03CC-BY-4.0
NVDCVE-2021-21404 changed 2026-06-17Public domain
Bitnami Vulnerability DatabaseBIT-SYNCTHING-2021-21404 changed 2026-09-08Apache-2.0