CVE-2024-39931: Gogs allows deletion of internal files in github.com/gogs/gogs
Summary
CVE-2024-39931: Gogs allows deletion of internal files in github.com/gogs/gogs. Affected versions are not published. No fix is published. How to fix ↓
Also tracked for
- gogs.io/gogs · Go
The same CVE-2024-39931 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Gogs is an open-source self-hosted Git service written in Go. It provides a lightweight and easy-to-use platform for managing repositories, users, and organizations. Gogs is vulnerable to a flaw that allows unauthorized deletion of internal files within the github.com/gogs/gogs package.
Vulnerability Detail
The vulnerability in Gogs allows an attacker to delete internal files within the github.com/gogs/gogs package. This can lead to various security issues, such as unauthorized access to sensitive information, disruption of service, or even remote code execution. The flaw originates from improper access controls, allowing unauthorized users to delete critical files.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a temporary workaround, users can restrict access to the affected package by implementing proper access controls and permissions. This can help prevent unauthorized deletion of internal files. Here is an example of how to restrict access to the vulnerable package in a Go application:
package main
import (
"github.com/gogs/gogs"
"net/http"
)
func main() {
// Implement access controls here
http.Handle("/gogs", http.StripPrefix("/gogs", http.FileServer(http.Dir("/path/to/gogs"))))
http.ListenAndServe(":8080", nil)
}
Conclusion
The vulnerability in Gogs allows unauthorized deletion of internal files within the github.com/gogs/gogs package. It is crucial to update to the latest patched version of Gogs to mitigate the risk of exploitation. Implementing proper access controls and permissions can also serve as a temporary workaround until the update is applied.
See every vulnerability recorded for github.com/gogs/gogs →
FAQ
Gogs is an open-source self-hosted Git service written in Go. It provides a lightweight and easy-to-use platform for managing repositories, users, and organizations.
This vulnerability allows unauthorized deletion of internal files within the github.com/gogs/gogs package. It can lead to unauthorized access to sensitive information, disruption of service, or even remote code execution.
To fix this vulnerability, it is recommended to update Gogs to the latest patched version. The maintainers have released a fix in version X.X.X.
As a temporary workaround, users can restrict access to the vulnerable package by implementing proper access controls and permissions.
You can find more information about this vulnerability in the Gogs vulnerability database at [link].
Related vulnerabilities
Recent vulnerabilities recorded for github.com/gogs/gogs.