CVE-2018-20303 in Gogsinfo

Summary

by MITRE

In pkg/tool/path.go in Gogs before 0.11.82.1218, a directory traversal in the file-upload functionality can allow an attacker to create a file under data/sessions on the server, a similar issue to CVE-2018-18925.

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 05/23/2026

The vulnerability identified as CVE-2018-20303 affects the Gogs git repository management system and represents a directory traversal flaw within the file upload functionality. This security weakness exists in the pkg/tool/path.go component of Gogs versions prior to 0.11.82.1218, making installations of these older versions susceptible to unauthorized file creation on the server. The vulnerability specifically allows attackers to manipulate file paths during upload operations to place files in the data/sessions directory, which contains sensitive session information and can be exploited to compromise user authentication states.

The technical implementation of this directory traversal vulnerability stems from insufficient input validation and path sanitization within the file upload handling code. When users upload files through the web interface, the application fails to properly validate or sanitize the file paths provided by the client, allowing malicious actors to include directory traversal sequences such as ../ in their file names or paths. This flaw directly maps to CWE-22, which describes improper limitation of a pathname to a restricted directory, commonly known as directory traversal or path traversal attacks. The vulnerability creates a scenario where an attacker can write arbitrary files to the server filesystem, potentially leading to session hijacking, persistent backdoors, or other malicious activities that compromise the integrity of the entire system.

The operational impact of CVE-2018-20303 extends beyond simple unauthorized file creation, as the targeted data/sessions directory contains critical session management files that control user authentication states and access permissions. Attackers exploiting this vulnerability can manipulate session data to impersonate legitimate users, gain persistent access to the system, or disrupt normal authentication processes. The similarity to CVE-2018-18925 indicates that this represents a broader class of vulnerabilities affecting Gogs installations, suggesting that multiple components within the application may be susceptible to similar path traversal attacks. This vulnerability particularly affects organizations using Gogs for code repository management, as it can be leveraged to compromise source code integrity, access sensitive project information, or establish persistent access points within the development infrastructure.

Organizations should implement immediate mitigation strategies including updating to Gogs version 0.11.82.1218 or later, which contains the necessary patches to address the directory traversal vulnerability. System administrators should also consider implementing additional security controls such as restrictive file upload policies, input validation at multiple layers, and monitoring for unusual file creation patterns in the data/sessions directory. The ATT&CK framework categorizes this vulnerability under T1078 Valid Accounts and T1484.1 Domain Policy Modification, as successful exploitation can lead to account compromise and persistent access to the system. Organizations should also review their network segmentation policies and implement proper access controls to limit the potential impact of such vulnerabilities. Regular security audits and vulnerability assessments should be conducted to identify and remediate similar issues in other applications and systems within the organization's infrastructure.

Reservation

12/19/2018

Disclosure

12/19/2018

Moderation

accepted

CPE

ready

EPSS

0.02468

KEV

no

Activities

low

Sources

Interested in the pricing of exploits?

See the underground prices here!