GHSA-3244-8mff-w398 Reflected XSS in Gotify's /docs via import of outdated Swagger UI

Not scored Published

Reflected XSS in Gotify's Swagger UI allows attackers to execute arbitrary JavaScript and potentially take over user accounts via malicious links.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is GHSA-3244-8mff-w398?

GHSA-3244-8mff-w398 is a cross-site scripting vulnerability in github.com/gotify/server, published on 10 Jan 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

Impact

Gotify exposes an outdated instance of the Swagger UI API documentation frontend at /docs which is susceptible to reflected XSS attacks when loading external Swagger config files.

Specifically, the DOMPurify version included with this version of Swagger UI is vulnerable to a rendering XSS incorporating the mutation payload detailed in CVE-2020-26870 which was patched in 2021. This is further tracked in the GitHub Advisory Database as GHSA-QRMM-W75W-3WPX.

An attacker can execute arbitrary JavaScript and potentially take over the account of the user that clicked the link. Keep in mind, the Gotify UI won't natively expose such a malicious link, so an attacker has to get the user to open the malicious link in a context outside of Gotify.

Patches

The vulnerability has been fixed in version 2.2.3.

References

https://github.com/gotify/server/pull/541

Which versions are affected by GHSA-3244-8mff-w398?

4 open source packages ship an affected version, including github.com/gotify/server and github.com/gotify/server/v2.

PackageAffectedFixed in
github.com/gotify/server GoAll versionsNone
github.com/gotify/server GoAll versions2.2.3
github.com/gotify/server GoAll versions2.2.3
github.com/gotify/server/v2 GoAll versions2.2.3

How do I fix GHSA-3244-8mff-w398?

Upgrade github.com/gotify/server to 2.2.3 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is GHSA-3244-8mff-w398 being exploited?

There is no known exploitation of GHSA-3244-8mff-w398 in the wild and no public exploit code.

Sources

Also known as GO-2023-1471.

Is GHSA-3244-8mff-w398 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free