CVE-2024-39931: Gogs allows deletion of internal files in github.com/gogs/gogs

github.com/gogs/gogs Updated 02 Oct 2025

Summary

09/07/2024
No i
Critical
9.9

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

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.

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

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 →

Share this vulnerability

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.

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback