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


Severity

Recommended
0.0
critical
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.43% (75th 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 Learn

Learn about Arbitrary Code Execution vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-GOLANG-GITHUBCOMGOGSGOGSINTERNALDB-3332729
  • 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 github.com/gogs/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 Scores

version 3.1