SB2022060914 - Multiple vulnerabilities in gogs
Published: June 9, 2022 Updated: April 27, 2026
Breakdown by Severity
- Low
- Medium
- High
- Critical
Description
This security bulletin contains information about 4 vulnerabilities.
1) Cross-site scripting (CVE-ID: CVE-2022-31038)
CWE-ID: CWE-79 - Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
CVSSv4: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:U/U:Clear
The disclosed vulnerability allows a remote attacker to perform cross-site scripting (XSS) attacks.
The vulnerability exists due to insufficient sanitization of user-supplied data in the DisplayName. A remote attacker can trick the victim to follow a specially crafted link and execute arbitrary HTML and script code in user's browser in context of vulnerable website.
Successful exploitation of this vulnerability may allow a remote attacker to steal potentially sensitive information, change appearance of the web page, perform phishing and drive-by-download attacks.
2) OS Command Injection (CVE-ID: CVE-2022-1986)
CWE-ID: CWE-78 - Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
CVSSv4: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U/U:Green
The vulnerability allows a remote user to gain SSH access to the server.
The vulnerability exists due to command injection in the file editor when updating a crafted config file into a repository's .git directory in combination with crafted file deletion. A remote user can upload and delete crafted files to gain SSH access to the server.
Only installations with repository upload enabled are vulnerable.
3) Path traversal (CVE-ID: CVE-2022-1992)
CWE-ID: CWE-22 - Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
CVSSv4: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N/E:U/U:Green
The vulnerability allows a remote user to delete and upload arbitrary files.
The vulnerability exists due to path traversal in the file editor when handling repository uploads on Windows. A remote user can supply a crafted pathname to delete and upload arbitrary files.
Only Windows installations with repository upload enabled are vulnerable.
4) Path traversal (CVE-ID: CVE-2022-1993)
CWE-ID: CWE-22 - Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
CVSSv4: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N/E:U/U:Clear
The vulnerability allows a remote user to access unauthorized Git directories.
The vulnerability exists due to path traversal in Git HTTP endpoints when handling crafted HTTP requests. A remote user can send a specially crafted request to access unauthorized Git directories.
Remediation
Install update from vendor's website.
References
- https://github.com/gogs/gogs/security/advisories/GHSA-xq4v-vrp9-vcf2
- https://github.com/gogs/gogs/security/advisories/GHSA-67mx-jc2f-jgjm
- https://github.com/gogs/gogs/security/advisories/GHSA-994f-7g86-qr56
- https://github.com/gogs/gogs/security/advisories/GHSA-6vcc-v9vw-g2x5
- https://github.com/advisories/GHSA-6vcc-v9vw-g2x5