Skip to content
XSS Disclosed report Beginner CVE-2022-1464

Cross-site Scripting in Gogs

An attacker could upload a crafted SVG file as an issue attachment, which would execute script when viewed, leading to cross-site scripting. This affects installations that allow SVG uploads as issue attachments.

gogs/gogs

Originally disclosed on huntr

Impact

The malicious user is able to upload a crafted SVG file as the issue attachment to archive XSS. All installations allow uploading SVG (text/xml) files as issue attachments (non-default) are affected.

Patches

Correctly setting the Content Security Policy for the serving endpoint. Users should upgrade to 0.12.7 or the latest 0.13.0+dev.

Workarounds

Disable uploading SVG files (text/xml) as issue attachments.

References

https://huntr.dev/bounties/34a12146-3a5d-4efc-a0f8-7a3ae04b198d/

For more information

If you have any questions or comments about this advisory, please post on https://github.com/gogs/gogs/issues/6919.

From the GitHub Advisory Database (GHSA-ff28-f46g-r9g8, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the application served uploaded SVG files without a Content Security Policy that would prevent embedded scripts from executing.

What the attacker needed

SVG uploads enabled as issue attachments; victim views the malicious attachment

The fix

The issue was fixed by correctly setting the Content Security Policy for the serving endpoint; users should upgrade to version 0.12.7 or later.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A cross-site scripting (XSS) flaw lets an attacker sneak harmful code into a web page that other people view. Here, a user could upload a specially made image file (SVG) that contains hidden code, and when someone opens that attachment, the code runs in their browser. This could let the attacker do things like steal session cookies or act as the victim.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More from gogs/gogs

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.