CVE-2020-35380: Panic due to improper input validation in github.com/tidwall/gjson
Summary
CVE-2020-35380: Panic due to improper input validation in Get in github.com/tidwall/gjson. Affects github.com/tidwall/gjson versions < 1.6.4. Fixed in 1.6.4. How to fix ↓
Also tracked for
- golang-github-tidwall-gjson · Debian:11
The same CVE-2020-35380 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
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.
No signup required · Results in about 60 seconds
Background
The package github.com/tidwall/gjson is a Go library that provides a fast and simple way to access JSON data. It offers various functions for retrieving values from JSON objects, such as Get, GetBytes, GetMany, GetManyBytes, Result.Array, Result.Get, Result.Map, Result.Value, and squash. This vulnerability affects versions prior to 1.6.4.
Vulnerability Detail
The vulnerability in github.com/tidwall/gjson arises from improper bounds checking during JSON parsing. Maliciously crafted JSON objects can trigger an out-of-bounds panic. If an application parses user input using this library, an attacker could exploit this vulnerability to cause a denial of service. The lack of proper input validation allows an attacker to manipulate the JSON input in a way that triggers the panic.
How To Fix
Latest published version: v1.20.0 as of 23 Oct 2026
go get github.com/tidwall/gjson@v1.20.0
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
1.6.4
This is the first release that contains the fix.
go get github.com/tidwall/gjson@v1.6.4
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no known workaround for this vulnerability. It is recommended to update to the fixed version of the package as soon as possible.
Conclusion
The vulnerability in github.com/tidwall/gjson can be exploited by providing malicious JSON input to an application, causing it to panic and crash. To mitigate this vulnerability, developers should update to version 1.6.4 or later of the package. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for github.com/tidwall/gjson →
FAQ
The vulnerability can be used as a denial of service vector, causing the affected application to panic and crash.
Versions prior to 1.6.4 are affected by this vulnerability.
No, this vulnerability requires the attacker to have the ability to provide malicious JSON input to the application.
There are no known instances of this vulnerability being exploited in the wild at this time.
You can use the Vulert Playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. It analyzes your Gopkg.lock file and provides real-time alerts for open-source vulnerabilities.
References
Related vulnerabilities
Recent vulnerabilities recorded for github.com/tidwall/gjson.