CVE-2022-1884CWE-78

Remote Command Execution in gogs/gogs

Critical · published November 15, 2024

CVSS v3.0
10.0
EPSS
2%
Percentile
78.8
In the wild
Unconfirmed
What it is

🚨 A crafty little vulnerability lets attackers potentially execute commands remotely! If you’re running gogs versions <=0.12.7 on Windows, this one’s for you! 🔥 Picture a delivery driver who can slip into a secure room because no one checks the delivery instructions. This vulnerability lets attackers upload files directly to the .git directory without proper validation, just like that driver sneaking in through a back door! If exploited, an attacker could take control of your server, rewriting the `.git/config` file and executing arbitrary commands. This is about as dangerous as it gets—imagine giving a stranger the keys to your entire operation!

Put simply

Picture a delivery driver who can slip into a secure room because no one checks the delivery instructions. This vulnerability lets attackers upload files directly to the .git directory without proper validation, just like that driver sneaking in through a back door! This remote command execution vulnerability occurs due to improper validation of the `tree_path` parameter during file uploads in gogs. By setting `tree_path=.git.`, an attacker can upload malicious files that could lead to executing commands on the server.

What to do

If exploited, an attacker could take control of your server, rewriting the `.git/config` file and executing arbitrary commands. This is about as dangerous as it gets—imagine giving a stranger the keys to your entire operation! Immediately upgrade to gogs version 0.12.8 or later to patch this vulnerability. Additionally, ensure that any file upload mechanisms include strict validation to prevent unauthorized access to sensitive directories. It's crucial to review your settings for `core.sshCommand` as well. You've got this! By taking these steps, you can secure your system and earn your security hero badge! 🛡️

The record
Technical detail
CVSS v3.0
10.0 · CRITICAL
Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.01841 · 78.8th percentile
Weakness
CWE-78 · Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Published
2024-11-15T10:53Z
EPSS history
Timeline
  • 15 NOV 10:53Z
    Remote Command Execution in gogs/gogs
    cvelistv5