CVE-2018-20303: Gogs Directory Traversal Vulnerability

gogs.io/gogs Updated 23 Feb 2026

Summary

14/05/2022
Yes i
High
7.5

CVE-2018-20303: Gogs Directory Traversal. Affects gogs.io/gogs versions < 0.11.82.1218. Fixed in 0.11.82.1218. How to fix ↓

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

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

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 a self-hosted Git service that allows users to manage their Git repositories with ease. It is designed to be simple and efficient, providing a user-friendly interface for repository management, issue tracking, and collaboration. However, prior to version 0.11.82.1218, Gogs had a critical vulnerability that exposed its file-upload functionality to directory traversal attacks, allowing unauthorized file creation on the server.

Vulnerability Detail

In pkg/tool/path.go of Gogs versions before 0.11.82.1218, a directory traversal vulnerability exists in the file-upload functionality. This flaw allows attackers to manipulate file paths and create files in unintended directories, specifically under data/sessions on the server. This could lead to unauthorized access to sensitive data or the execution of malicious scripts, posing a significant security risk.

How To Fix

Latest published version: v0.13.3 as of 22 Oct 2026

go get gogs.io/gogs@v0.13.3

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.11.82.1218

This is the first release that contains the fix.

go get gogs.io/gogs@v0.11.82.1218

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, you can restrict file uploads by implementing strict validation on file paths and ensuring that user inputs do not allow directory traversal. This can be done by sanitizing input and checking for patterns that may indicate an attempt to traverse directories.

Conclusion

The Gogs directory traversal vulnerability (CVE-2018-20303) poses a significant risk to users of the software prior to version 0.11.82.1218. It is crucial to update to the patched version to mitigate potential security threats. Additionally, implementing strict input validation can serve as a temporary workaround while ensuring ongoing monitoring for vulnerabilities.

See every vulnerability recorded for gogs.io/gogs →

Share this vulnerability

FAQ

The vulnerability allows for directory traversal in the file-upload functionality, enabling unauthorized file creation on the server.

An attacker could exploit this vulnerability to create files in sensitive directories, potentially leading to data breaches or the execution of malicious code.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

The CVSS score for this vulnerability is 7.5, indicating a high severity level.

Yes, Vulert can monitor and alert you in real-time for open-source vulnerabilities using just the Gopkg.lock file.

Related vulnerabilities

Recent vulnerabilities recorded for gogs.io/gogs.

How To Fix

Latest published version: v0.13.3 as of 22 Oct 2026

go get gogs.io/gogs@v0.13.3

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.11.82.1218

This is the first release that contains the fix.

go get gogs.io/gogs@v0.11.82.1218

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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