Overview
Recently, NSFOCUS CERT detected that Gogs issued a security bulletin and fixed the Gogs remote command execution vulnerability (CVE-2024-56731); Due to the incomplete CVE-2024-39931 fix, an authenticated attacker can delete files in the .git directory through symbolic links and execute arbitrary commands on the Gogs instance using the account permissions specified by RUN_USER in the configuration, thereby accessing and modifying the code of any user hosted on the same instance. The CVSS score is 10.0, affected users should take protective measures as soon as possible.
Gogs (Go Git Service) is a self-service Git service developed in the Go language, designed to build a simple, stable and scalable code hosting platform in the easiest way.
Reference link: https://github.com/gogs/gogs/security/advisories/GHSA-wj44-9vcg-wjq7
Scope of Impact
Affected versions
- Gogs <= 0.13.2
Unaffected version
- Gogs >= 0.13.3
Mitigation
Official upgrade
At present, the official has released a new version to fix this vulnerability. It is recommended that affected users upgrade their protection in time. Download link: https://github.com/gogs/gogs/releases
Other protective measures
If the relevant users are temporarily unable to perform upgrade operations, the following measures can be used for temporary relief:
1. Set in the Gogs configuration file app.ini to turn off the user registration function
[service] DISABLE_REGISTRATION = true |
Note: The Gog service needs to be restarted for the configuration to take effect.
2. Use security devices to detect whether the vulnerability interface has malicious file content or malicious operations on the .git directory
3. Restrict access to the system based on actual business conditions
Statement
This advisory is only used to describe a potential risk. NSFOCUS does not provide any commitment or promise on this advisory. NSFOCUS and the author will not bear any liability for any direct and/or indirect consequences and losses caused by transmitting and/or using this advisory. NSFOCUS reserves all the rights to modify and interpret this advisory. Please include this statement paragraph when reproducing or transferring this advisory. Do not modify this advisory, add/delete any information to/from it, or use this advisory for commercial purposes without permission from NSFOCUS.
About NSFOCUS
NSFOCUS, a pioneering leader in cybersecurity, is dedicated to safeguarding telecommunications, Internet service providers, hosting providers, and enterprises from sophisticated cyberattacks.
Founded in 2000, NSFOCUS operates globally with over 4000 employees at two headquarters in Beijing, China, and Santa Clara, CA, USA, and over 50 offices worldwide. It has a proven track record of protecting over 25% of the Fortune Global 500 companies, including four of the five largest banks and six of the world’s top ten telecommunications companies.
Leveraging technical prowess and innovation, NSFOCUS delivers a comprehensive suite of security solutions, including the Intelligent Security Operations Platform (ISOP) for modern SOC, DDoS Protection, Continuous Threat Exposure Management (CTEM) Service and Web Application and API Protection (WAAP). All the solutions and services are augmented by the Security Large Language Model (SecLLM), ML, patented algorithms and other cutting-edge research achievements developed by NSFOCUS.