Critical Unpatched Flaws Disclosed in Popular Gogs Open-Source Git Service

Teilen:

Four unpatched security flaws, including three critical ones, have been disclosed in the Gogs open-source, self-hosted Git service that could enable an authenticated attacker to breach susceptible instances, steal or wipe source code, and even plant backdoors.

The vulnerabilities, according to SonarSource researchers Thomas Chauchefoin and Paul Gerste, are listed below –

  • CVE-2024-39930 (CVSS score: 9.9) – Argument injection in the built-in SSH server
  • CVE-2024-39931 (CVSS score: 9.9) – Deletion of internal files
  • CVE-2024-39932 (CVSS score: 9.9) – Argument injection during changes preview
  • CVE-2024-39933 (CVSS score: 7.7) – Argument injection when tagging new releases

Successful exploitation of the first three shortcomings could permit an attacker to execute arbitrary commands on the Gogs server, while the fourth flaw allows attackers to read arbitrary files such as source code, and configuration secrets.

In other words, by abusing the issues, a threat actor could read source code on the instance, modify any code, delete all code, target internal hosts reachable from the Gogs server, and impersonate other users and gain more privileges.

That said, all four vulnerabilities require that the attacker be authenticated. Furthermore, triggering CVE-2024-39930 necessitates that the built-in SSH server is enabled, the version of the env binary used, and the threat actor is in possession of a valid SSH private key.

“If the Gogs instance has registration enabled, the attacker can simply create an account and register their SSH key,” the researchers said. “Otherwise, they would have to compromise another account or steal a user’s SSH private key.”

Gogs instances running on Windows are not exploitable, as is the Docker image. However, those running on Debian and Ubuntu are vulnerable due to the fact that the env binary supports the “–split-string” option.

Gogs Open-Source Git Service

According to data available on Shodan, around 7,300 Gogs instances are publicly accessible over the internet, with nearly 60% of them located in China, followed by the U.S., Germany, Russia, and Hong Kong.

It’s currently not clear how many of these exposed servers are vulnerable to the aforementioned flaws. SonarSource said it does not have any visibility into whether these issues are being exploited in the wild.

The Swiss cybersecurity firm also pointed out that the project maintainers “did not implement fixes and stopped communicating” after accepting its initial report on April 28, 2023.

In the absence of an update, users are recommended to disable the built-in SSH server, turn off user registration to prevent mass exploitation, and consider switching to Gitea. SonarSource has also released a patch that users can apply, but noted it hasn’t been extensively tested.

The disclosure comes as cloud security firm Aqua discovered that sensitive information such as access tokens and passwords once hard-coded could remain permanently exposed even after removal from Git-based source code management (SCM) systems.

Dubbed phantom secrets, the issue stems from the fact that they cannot be discovered by any of the conventional scanning methods – most of which look for secrets using the “git clone” command – and that certain secrets are accessible only via “git clone –mirror” or cached views of SCM platforms, highlighting the blind spots that such scanning tools may miss.

“Commits remain accessible through ‘cache views’ on the SCM,” security researchers Yakir Kadkoda and Ilay Goldman said. “Essentially, the SCM saves the commit content forever.”

“This means that even if a secret containing commit is removed from both the cloned and mirrored versions of your repository, it can still be accessed if someone knows the commit hash. They can retrieve the commit content through the SCM platform’s GUI and access the leaked secret.”

Ravie Lakshmanan

Kommentar verfassen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

lade-bild
London, GB
10:47 pm, Feb. 1, 2025
Wetter-Symbol 2°C
L: -0° | H: 3°
aufgelockerte Bewölkung
Luftfeuchtigkeit: 92 %
Druck: 1025 mb
Wind: 6 mph ESE
Windböe: 7 mph
UV-Index: 0
Niederschlag: 0 mm
Wolken: 39%
Regen Chance: 0%
Sichtbarkeit: 10 km
Sonnenaufgang: 7:38 am
Sonnenuntergang: 4:49 pm
TäglichStündlich
Tägliche VorhersageStündliche Vorhersage
Tomorrow 9:00 pm
Wetter-Symbol
-0° | 3°°C 0 mm 0% 7 mph 92 % 1025 mb 0 mm/h
Mo. Feb. 03 9:00 pm
Wetter-Symbol
3° | 10°°C 0 mm 0% 7 mph 95 % 1025 mb 0 mm/h
Di. Feb. 04 9:00 pm
Wetter-Symbol
7° | 10°°C 1 mm 100% 12 mph 93 % 1026 mb 0 mm/h
Mi. Feb. 05 9:00 pm
Wetter-Symbol
4° | 8°°C 0.7 mm 70% 9 mph 89 % 1044 mb 0 mm/h
Do. Feb. 06 9:00 pm
Wetter-Symbol
2° | 7°°C 0 mm 0% 9 mph 86 % 1044 mb 0 mm/h
Tomorrow 12:00 am
Wetter-Symbol
2° | 3°°C 0 mm 0% 4 mph 92 % 1025 mb 0 mm/h
Tomorrow 3:00 am
Wetter-Symbol
2° | 3°°C 0 mm 0% 4 mph 89 % 1024 mb 0 mm/h
Tomorrow 6:00 am
Wetter-Symbol
2° | 2°°C 0 mm 0% 6 mph 83 % 1022 mb 0 mm/h
Tomorrow 9:00 am
Wetter-Symbol
3° | 3°°C 0 mm 0% 5 mph 75 % 1022 mb 0 mm/h
Tomorrow 12:00 pm
Wetter-Symbol
7° | 7°°C 0 mm 0% 7 mph 60 % 1023 mb 0 mm/h
Tomorrow 3:00 pm
Wetter-Symbol
7° | 7°°C 0 mm 0% 7 mph 55 % 1022 mb 0 mm/h
Tomorrow 6:00 pm
Wetter-Symbol
5° | 5°°C 0 mm 0% 4 mph 72 % 1024 mb 0 mm/h
Tomorrow 9:00 pm
Wetter-Symbol
4° | 4°°C 0 mm 0% 4 mph 76 % 1025 mb 0 mm/h
Name Preis24H (%)
Bitcoin(BTC)
€97,032.76
-1.86%
Ethereum(ETH)
€3,024.77
-5.41%
XRP(XRP)
€2.79
-5.24%
Fesseln(USDT)
€0.96
0.00%
Solana(SOL)
€207.66
-7.04%
USDC(USDC)
€0.96
-0.01%
Dogecoin(DOGE)
€0.296977
-6.49%
Shiba Inu(SHIB)
€0.000017
-5.62%
Pepe(PEPE)
€0.000012
-12.10%
Nach oben scrollen