CVE-2020-35380: Denial of Service in GJSON

github.com/tidwall/gjson Updated 02 Oct 2025

Summary

23/06/2021
Yes i
High
7.5

CVE-2020-35380: Denial of service in GJSON. Affects github.com/tidwall/gjson versions < 1.6.4. Fixed in 1.6.4. How to fix ↓

Also tracked for

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.

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

GJSON is a Go package that provides a fast and easy way to extract values from JSON documents. It is commonly used in Go applications for parsing and manipulating JSON data. However, versions before 1.6.4 of GJSON are vulnerable to a denial of service attack. This vulnerability arises from improper bounds checking during JSON parsing, allowing maliciously crafted JSON objects to trigger an out-of-bounds panic. If an application parses user input using GJSON, an attacker can exploit this vulnerability to cause a denial of service, potentially impacting the availability of the application.

Vulnerability Detail

The vulnerability (CVE-2020-35380) in GJSON before version 1.6.4 allows attackers to cause a denial of service by providing crafted JSON input. The issue originates from improper bounds checking during JSON parsing, leading to an out-of-bounds panic. By exploiting this vulnerability, an attacker can send specially crafted JSON objects that trigger the out-of-bounds panic, causing the application to crash or become unresponsive. This can be used as a vector for denial of service attacks, impacting the availability of the affected application.

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

As a temporary workaround, developers can implement additional input validation and sanitization measures to mitigate the risk of this vulnerability. This can involve validating JSON input for correctness and ensuring it adheres to expected formats and structures. By implementing strict input validation, developers can reduce the likelihood of encountering maliciously crafted JSON that triggers the vulnerability.

Conclusion

In conclusion, the GJSON package before version 1.6.4 is vulnerable to a denial of service attack due to improper bounds checking during JSON parsing. This can be exploited by providing crafted JSON input, leading to an out-of-bounds panic and potential application crashes or unresponsiveness. To mitigate this vulnerability, it is crucial to update to GJSON version 1.6.4 or later and implement proper input validation. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for github.com/tidwall/gjson →

Share this vulnerability

FAQ

This vulnerability allows attackers to cause a denial of service by exploiting improper bounds checking during JSON parsing. It can lead to application crashes or unresponsiveness, impacting the availability of the affected application.

You can use the Vulert Playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Simply provide your Gopkg.lock file, and Vulert will analyze it for any open-source vulnerabilities, including this one.

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

At the time of this report, there are no known public exploits specifically targeting this vulnerability. However, it is still crucial to address the issue promptly by updating to the fixed version of GJSON.

If your application is affected by this vulnerability, it is recommended to update the GJSON package to version 1.6.4 or later. Additionally, consider implementing input validation and sanitization measures to further mitigate the risk.

Related vulnerabilities

Recent vulnerabilities recorded for github.com/tidwall/gjson.

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 →

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