CVE-2020-36565: Directory Traversal Vulnerability in github.com/labstack/echo/v4

github.com/labstack/echo/v4 Updated 02 Oct 2025

Summary

14/04/2021
Yes i
Moderate
5.3

CVE-2020-36565: Directory traversal on Windows in github.com/labstack/echo/v4. Affects github.com/labstack/echo/v4 versions < 4.1.18-0.20201215153152-4422e3b66b9f. Fixed in 4.1.18-0.20201215153152-4422e3b66b9f. 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 Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The package github.com/labstack/echo/v4 is a Go package that provides a web framework for building web applications and APIs. It offers various features such as routing, middleware, and static file serving. The vulnerability affects the static file handler functionality on Windows, where improper sanitization of user input allows for directory traversal. This means that an attacker can exploit this vulnerability to read files outside of the target directory that the server has permission to read.

Vulnerability Detail

The directory traversal vulnerability in github.com/labstack/echo/v4 on Windows occurs due to the lack of proper sanitization of user input. This allows an attacker to manipulate the file path and access files outside of the intended directory. By exploiting this vulnerability, an attacker can potentially gain unauthorized access to sensitive files, which may lead to further compromise of the system. The vulnerability is specific to Windows operating systems and affects versions of the package prior to 4.1.18-0.20201215153152-4422e3b66b9f.

How To Fix

Minimum fixed version

4.1.18-0.20201215153152-4422e3b66b9f

This is the first release that contains the fix.

go get github.com/labstack/echo/v4@v4.1.18-0.20201215153152-4422e3b66b9f

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

Workaround

If updating the package is not immediately feasible, a temporary workaround can be implemented by manually sanitizing user input to prevent directory traversal. This can be done by validating and restricting user input to ensure it only contains valid characters and does not include any path traversal sequences. Here is an example of how to sanitize user input in Go:

import (
	"github.com/labstack/echo/v4"
	"net/http"
)

func main() {
	e := echo.New()
	e.GET("/static/*", func(c echo.Context) error {
		filePath := c.Param("*")
		// Sanitize filePath to prevent directory traversal
		// ... rest of the code
	})

	http.ListenAndServe(":8080", e)
}

Conclusion

The directory traversal vulnerability in github.com/labstack/echo/v4 on Windows can be exploited by an attacker to read files outside of the intended directory. It is crucial to update the package to the patched version or implement the provided workaround to mitigate the risk. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for github.com/labstack/echo/v4 →

Share this vulnerability

FAQ

This vulnerability allows an attacker to read files outside of the target directory that the server has permission to read. Depending on the files that can be accessed, this can potentially lead to unauthorized disclosure of sensitive information.

Yes, this vulnerability is specific to Windows operating systems. Other operating systems are not affected.

There are no known instances of this vulnerability being exploited in the wild at the time of this report. However, it is important to promptly apply the necessary fixes to prevent potential exploitation.

Yes, this vulnerability can be exploited remotely by sending malicious requests to the affected server.

Yes, a patch has been released for this vulnerability in version 4.1.18-0.20201215153152-4422e3b66b9f of the github.com/labstack/echo/v4 package.

Related vulnerabilities

Recent vulnerabilities recorded for github.com/labstack/echo/v4.

How To Fix

Minimum fixed version

4.1.18-0.20201215153152-4422e3b66b9f

This is the first release that contains the fix.

go get github.com/labstack/echo/v4@v4.1.18-0.20201215153152-4422e3b66b9f

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