CVE-2021-45329: Cross-site Scripting in Gitea
6.1
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.70321%
CWE
Published
2/10/2022
Updated
2/3/2023
KEV Status
No
Technology
Go
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
github.com/go-gitea/gitea | go | < 1.5.1 | 1.5.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The XSS vulnerability stemmed from improper validation
of user-supplied URLs in repository settings. The PR #4710 added enhanced URL validation
(blocking localhost and dangerous schemes), indicating the UpdateRepoPost
handler in routers/repo/setting.go
processed these URLs without adequate validation
. The validation.IsValidURL
function in older versions lacked proper scheme whitelisting, allowing XSS payloads via javascript:
URIs. These functions directly handled the vulnerable input field processing and validation
.