CVE-2022-1928: Stored Cross-site Scripting in gitea
4.4
CVSS Score
3.0
Basic Information
CVE ID
GHSA ID
EPSS Score
0.27465%
CWE
Published
5/30/2022
Updated
1/30/2023
KEV Status
No
Technology
Go
Technical Details
CVSS Vector
CVSS:3.0/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| code.gitea.io/gitea | go | < 1.16.9 | 1.16.9 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The patch (65e0688) modifies the ServeData function in routers/common/repo.go to add PDF-specific header handling. Before the fix, PDF files were served without the correct Content-Type (application/octet-stream) and without a restrictive Content-Security-Policy, enabling XSS if a malicious PDF with embedded scripts was uploaded. The vulnerability matches the CWE-79 description of improper input neutralization during web page generation, and the commit directly addresses this by adding security headers for PDFs.