Skip to content

Gogs has a Denial of Service in repository/wiki file listing web pages

Moderate severity GitHub Reviewed Published Jun 19, 2026 in gogs/gogs • Updated Jun 22, 2026

Package

gomod gogs.io/gogs (Go)

Affected versions

<= 0.14.2

Patched versions

0.14.3

Description

Summary

A malicious user with rights to create a new file on a repository or wiki page can trigger a denial of service condition in which the pages containing the listing of files will return HTTP error 500 and render the web interface unusable for the repository or wiki.

Details

The issue is present in file internal/route/repo/wiki.go and internal/route/repo/view.go where the pages try to recover commit information. If errors are returned while recovering commit information, the page will return a 500 error and stop rendering, resulting in a denial of service.
In view.go the issue occurs at line 56 while a slightly different issue occurs in wiki.go at line 174 where commits[0] is dereferenced without checking if it contains value.
It is possible to trigger issues in assigning the correct value to variable commits by using a specific string as part of the page title.
The issue is linked to the fact that file names can contain special characters such as *, ?, [, ], etc. that will be interpreted as git's pathspec instead of a simple string. So crafting a name containing an incomplete pathspec sequence will trigger this error.

PoC

As a proof of concept consider the file name "[] and how it affects repository and wiki pages.
In the following images it is shown how pages are created, the error shown in the web page right after creation and the error as logged in the console.

repo_creation

Figure 1: Creation of malicious file in repository

repo_error_web

Figure 2: Malicious file in repository causes error 500

repo_error_console

Figure 3: Console error caused by malicious file in repository

wiki_creation

Figure 4: Creation of malicious file in wiki

wiki_error_web

Figure 5: Malicious file in wiki causes error 500

wiki_error_console

Figure 6: Console error caused by malicious file in wiki

Impact

The repository and wiki pages will not render when files named with the payload are present in the repository or in the wiki.
This condition will be present as long as the malicious file is present in the repository or wiki. The issue will not cause a DoS condition when using the server via CLI.

References

@unknwon unknwon published to gogs/gogs Jun 19, 2026
Published to the GitHub Advisory Database Jun 22, 2026
Reviewed Jun 22, 2026
Last updated Jun 22, 2026

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
High
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H

EPSS score

Weaknesses

Improper Input Validation

The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. Learn more on MITRE.

CVE ID

CVE-2025-64719

GHSA ID

GHSA-3qq3-668m-v9mj

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.