Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/vulndb: potential Go vuln in github.com/syncthing/syncthing: GHSA-9rp6-23gf-4c3h #1830

Closed
GoVulnBot opened this issue Jun 6, 2023 · 1 comment

Comments

@GoVulnBot
Copy link

In GitHub Security Advisory GHSA-9rp6-23gf-4c3h, there is a vulnerability in the following Go packages or modules:

Unit Fixed Vulnerable Ranges
github.com/syncthing/syncthing 1.23.5 < 1.23.5

Cross references:

See doc/triage.md for instructions on how to triage this report.

modules:
    - module: github.com/syncthing/syncthing
      versions:
        - fixed: 1.23.5
      packages:
        - package: github.com/syncthing/syncthing
summary: syncthing vulnerable to Cross-site Scripting (XSS) in Web GUI
description: "## Impact\n\n1. A compromised instance with shared folders could sync malicious files which contain arbitrary HTML and JavaScript in the name.\nIf 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.\n\n2. Adding a new device with a malicious name could embed HTML or JavaScript inside parts of the page.\n\n## Risk\n\nAs long as trusted devices are used, the risk is low.\nAdditionally, the web GUI is not used that often in daily use which reduces the likelihood of exploitation.\n\n## Details\n\n### 1. Field \"Latest Change\"\n\n* Open the web GUI at [http://127.0.0.1:8384/](http://127.0.0.1:8384/).\n* Create/Delete a file named ```<img src=a onerror=alert(123)>``` and sync it to the other instance.\n* Move your mouse over the latest change to trigger the tooltip.\n\n<img width=\"834\" alt=\"latest-change\" src=\"https://user-images.githubusercontent.com/9484134/205084362-20a8ec13-a88d-469f-bdf1-e5291c20f4c1.png\">\n\n##### Web browser source\n```html\n<span tooltip=\"\" data-original-title=\"\\&quot;><img src=a onerror=alert(123)> @ 2022-11-30 16:58:43\"\n    aria-describedby=\"tooltip409527\">\n    <!-- ngIf: !folderStats[folder.id].lastFile.deleted --><span translate=\"\"\n        translate-value-file=\"&quot;><img src=a onerror=alert(123)>\" ng-if=\"!folderStats[folder.id].lastFile.deleted\"\n        class=\"ng-scope\">Updated \"&gt;&lt;img src=a onerror=alert(123)&gt;</span>\n    <!-- end ngIf: !folderStats[folder.id].lastFile.deleted -->\n    <!-- ngIf: folderStats[folder.id].lastFile.deleted -->\n</span>\n<div class=\"tooltip fade top in\" role=\"tooltip\" id=\"tooltip409527\"\n    style=\"top: 446.033px; left: 318.3px; display: block;\">\n    <div class=\"tooltip-arrow\" style=\"left: 50%;\"></div>\n    <div class=\"tooltip-inner\">\\\"&gt;<img src=\"a\" onerror=\"alert(123)\"> @ 2022-11-30 16:58:43</div>\n</div>\n```\n\n##### Corresponding code in the project \n\nFile ````gui/default/index.html````:\n```html\n<tr ng-if=\"folder.type != 'sendonly' && folder.type != 'receiveencrypted' && folderStats[folder.id].lastFile && folderStats[folder.id].lastFile.filename\">\n    <th><span class=\"fas fa-fw fa-exchange-alt\"></span>&nbsp;<span translate>Latest Change</span></th>\n    <td class=\"text-right\">\n        <span tooltip data-original-title=\"{{folderStats[folder.id].lastFile.filename}} @ {{folderStats[folder.id].lastFile.at | date:'yyyy-MM-dd HH:mm:ss'}}\">\n        <span translate translate-value-file=\"{{folderStats[folder.id].lastFile.filename | basename}}\" ng-if=\"!folderStats[folder.id].lastFile.deleted\">Updated {%file%}</span>\n        <span translate translate-value-file=\"{{folderStats[folder.id].lastFile.filename | basename}}\" ng-if=\"folderStats[folder.id].lastFile.deleted\">Deleted {%file%}</span>\n        </span>\n    </td>\n</tr>\n```\n\nFile ````gui/default/syncthing/core/tooltipDirective.js````:  \n```javascript\nangular.module('syncthing.core')\n    .directive('tooltip', function () {\n        return {\n            restrict: 'A',\n            link: function (scope, element, attributes) {\n                $(element).tooltip({\n                    html: 'true'\n                });\n            }\n        };\n    });\n```\n\nThe attribute ```html``` should not be set to ```true``` or input sanitized.\n\n### 2. Field \"Shared With\"\n\n* Open the web GUI at [http://127.0.0.1:8384/](http://127.0.0.1:8384/).\n* Create a device with the following name ```fedora 1\"'><h1>Headline</h1><img src=x><script>alert(1)</script>```.\n* Add the device to another instance and share a folder.\n* Move your mouse over the malicious device name to trigger the tooltip.\n \n<img width=\"608\" alt=\"shared-with-1\" src=\"https://user-images.githubusercontent.com/9484134/205084172-8cab2d0e-3257-46d5-be81-41fbd7228e0c.png\">\n\n\n##### Web browser source  \n\n```html\n<span tooltip=\"\" data-original-title=\"fedora 1&quot;'><h1>Headline</h1><img src=x><script>alert(1)</script>  \"\n    ng-bind-html=\"sharesFolder(folder)\" class=\"ng-binding\" aria-describedby=\"tooltip348410\">fedora 1\"'&gt;<h1>Headline\n    </h1><img src=\"x\"></span>\n<div class=\"tooltip fade top\" role=\"tooltip\" id=\"tooltip348410\" style=\"top: 0px; left: 0px; display: block;\">\n    <div class=\"tooltip-arrow\" style=\"left: 50%;\"></div>\n    <div class=\"tooltip-inner\">fedora 1\"'&gt;<h1>Headline</h1><img src=\"x\">\n        <script>alert(1)</script>\n    </div>\n</div>\n```\n\n##### Corresponding code in the project \n\nFile ````gui/default/index.html````:\n\n```html\n<tr>\n    <th><span class=\"fas fa-fw fa-share-alt\"></span>&nbsp;<span translate>Shared With</span></th>\n    <td class=\"text-right\">\n        <span tooltip data-original-title=\"{{sharesFolder(folder)}} {{folderHasUnacceptedDevices(folder) ? '<br/>(<sup>1</sup>' + ('The remote device has not accepted sharing this folder.' | translate) + ')' : ''}} {{folderHasPausedDevices(folder) ? '<br/>(<sup>2</sup>' + ('The remote device has paused this folder.' | translate) + ')' : ''}}\" ng-bind-html=\"sharesFolder(folder)\"></span>\n    </td>\n</tr>\n```\n\nFile ````gui/default/syncthing/core/tooltipDirective.js````:  \n\n```javascript\nangular.module('syncthing.core')\n    .directive('tooltip', function () {\n        return {\n            restrict: 'A',\n            link: function (scope, element, attributes) {\n                $(element).tooltip({\n                    html: 'true'\n                });\n            }\n        };\n    });\n```\n\nThe attribute ```html``` should not be set to ```true``` or input sanitized.\n\n##### HTML Injection in \"Edit Folder\"\n\n<img width=\"672\" alt=\"shared-with-2\" src=\"https://user-images.githubusercontent.com/9484134/205084067-b33f8536-e350-4de1-86f6-3d4a12a683c3.png\">\n"
cves:
    - CVE-2022-46165
ghsas:
    - GHSA-9rp6-23gf-4c3h
references:
    - advisory: https://github.com/syncthing/syncthing/security/advisories/GHSA-9rp6-23gf-4c3h
    - fix: https://github.com/syncthing/syncthing/commit/f5e5af391a6583047c64ef8c51642003a79b75cf
    - web: https://github.com/syncthing/syncthing/releases/tag/v1.23.5
    - advisory: https://github.com/advisories/GHSA-9rp6-23gf-4c3h

@tatianab
Copy link
Contributor

tatianab commented Jun 7, 2023

Duplicate of #1835

@tatianab tatianab marked this as a duplicate of #1835 Jun 7, 2023
@tatianab tatianab closed this as completed Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants