Описание
syncthing vulnerable to Cross-site Scripting (XSS) in Web GUI
Impact
-
A compromised instance with shared folders could sync malicious files which contain arbitrary HTML and JavaScript in the name. If the owner of another device looks over the shared folder settings and moves the mouse over the latest sync, a script could be executed to change settings for shared folders or add devices automatically.
-
Adding a new device with a malicious name could embed HTML or JavaScript inside parts of the page.
Risk
As long as trusted devices are used, the risk is low. Additionally, the web GUI is not used that often in daily use which reduces the likelihood of exploitation.
Details
1. Field "Latest Change"
- Open the web GUI at http://127.0.0.1:8384/.
- Create/Delete a file named
<img src=a onerror=alert(123)>and sync it to the other instance. - Move your mouse over the latest change to trigger the tooltip.
Web browser source
Corresponding code in the project
File gui/default/index.html:
File gui/default/syncthing/core/tooltipDirective.js:
The attribute html should not be set to true or input sanitized.
2. Field "Shared With"
- Open the web GUI at http://127.0.0.1:8384/.
- Create a device with the following name
fedora 1"'><h1>Headline</h1><img src=x><script>alert(1)</script>. - Add the device to another instance and share a folder.
- Move your mouse over the malicious device name to trigger the tooltip.
Web browser source
Corresponding code in the project
File gui/default/index.html:
File gui/default/syncthing/core/tooltipDirective.js:
The attribute html should not be set to true or input sanitized.
HTML Injection in "Edit Folder"

Ссылки
- https://github.com/syncthing/syncthing/security/advisories/GHSA-9rp6-23gf-4c3h
- https://nvd.nist.gov/vuln/detail/CVE-2022-46165
- https://github.com/syncthing/syncthing/commit/73c52eafb6566435dffd979c3c49562b6d5a4238
- https://github.com/syncthing/syncthing/commit/f5e5af391a6583047c64ef8c51642003a79b75cf
- https://github.com/syncthing/syncthing/releases/tag/v1.23.5
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/IRYGBFJPVBW6PPTETNIBWQJE4HJSA5PJ
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XEBWSQVGHSTR4ZO7LVVEMPEGMV2DS5XR
Пакеты
github.com/syncthing/syncthing
< 1.23.5
1.23.5
Связанные уязвимости
Syncthing is an open source, continuous file synchronization program. In versions prior to 1.23.5 a compromised instance with shared folders could sync malicious files which contain arbitrary HTML and JavaScript in the name. If the owner of another device looks over the shared folder settings and moves the mouse over the latest sync, a script could be executed to change settings for shared folders or add devices automatically. Additionally adding a new device with a malicious name could embed HTML or JavaScript inside parts of the page. As a result the webUI may be subject to a stored cross site scripting attack. This issue has been addressed in version 1.23.5. Users are advised to upgrade. Users unable to upgrade should avoid sharing folders with untrusted users.
Syncthing is an open source, continuous file synchronization program. In versions prior to 1.23.5 a compromised instance with shared folders could sync malicious files which contain arbitrary HTML and JavaScript in the name. If the owner of another device looks over the shared folder settings and moves the mouse over the latest sync, a script could be executed to change settings for shared folders or add devices automatically. Additionally adding a new device with a malicious name could embed HTML or JavaScript inside parts of the page. As a result the webUI may be subject to a stored cross site scripting attack. This issue has been addressed in version 1.23.5. Users are advised to upgrade. Users unable to upgrade should avoid sharing folders with untrusted users.
Syncthing is an open source, continuous file synchronization program. ...