Arbitrary Code Execution Affecting gogs.io/gogs/internal/db package, versions <0.13.0-rc.1


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
97.84% (100th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-GOLANG-GOGSIOGOGSINTERNALDB-3332731
  • published27 Feb 2023
  • disclosed27 Feb 2023
  • creditcokebeer

Introduced: 27 Feb 2023

CVE-2022-2024  (opens in a new tab)
CWE-94  (opens in a new tab)

How to fix?

Upgrade gogs.io/gogs/internal/db to version 0.13.0-rc.1 or higher.

Overview

Affected versions of this package are vulnerable to Arbitrary Code Execution via file upload, due to improper validation of the tree_path parameter. An attacker can set tree_path=/.Git/ (note the capital 'G') to upload files into the .git directory. This is a special case of the vulnerability described in CVE-2022-0415.

NOTE: This vulnerability is only exploitable on case insensitive operating systems or container environments configured to be case insensitive.

CVSS Base Scores

version 3.1