Back to Blog
high SEVERITY7 min read

How Denial of Service via Malformed JSON happens in Go and how to fix it

CVE-2026-32285 is a high-severity Denial of Service vulnerability in the Go library `github.com/buger/jsonparser` v1.1.1, triggered by crafted malformed JSON input. The fix is a dependency upgrade to v1.1.2 in `go.mod` and `go.sum`, which tightens input handling without affecting valid JSON processing. Any Go application that parses untrusted JSON through this library is potentially exposed until the upgrade is applied.

O
By Orbis AppSec
Published August 26, 2026Reviewed August 26, 2026

Answer Summary

CVE-2026-32285 is a Denial of Service (DoS) vulnerability (CWE-400: Uncontrolled Resource Consumption) in the Go library `github.com/buger/jsonparser` v1.1.1, where specially crafted malformed JSON input can cause the parser to consume excessive resources or crash. The fix is to upgrade the dependency from v1.1.1 to v1.1.2 in `go.mod` and `go.sum`. This patch tightens the library's handling of malformed input, preventing an attacker from exploiting the parser to exhaust server resources. Applications that parse user-supplied JSON through this library should apply the upgrade immediately.

Vulnerability at a Glance

cweCWE-400
fixUpgrade github.com/buger/jsonparser from v1.1.1 to v1.1.2 in go.mod and go.sum
riskAn attacker can send crafted malformed JSON to exhaust server resources or crash the application
languageGo
root causebuger/jsonparser v1.1.1 fails to safely handle certain malformed JSON byte sequences, leading to uncontrolled resource consumption
vulnerabilityDenial of Service via malformed JSON input

How Denial of Service via Malformed JSON Happens in Go and How to Fix It

The Vulnerability at a Glance

Field Detail
CVE CVE-2026-32285
Severity High
Library github.com/buger/jsonparser
Affected version v1.1.1
Fixed version v1.1.2
CWE CWE-400: Uncontrolled Resource Consumption
Fix file go.mod, go.sum

Introduction

The go.mod file in this repository listed github.com/buger/jsonparser v1.1.1 as an indirect dependency — quietly pulled in as part of the broader dependency tree. While indirect dependencies often go unnoticed, they carry the same security obligations as direct ones. In this case, buger/jsonparser v1.1.1 contains a high-severity Denial of Service vulnerability (CVE-2026-32285) that can be triggered by feeding the parser deliberately malformed JSON input.

For developers building services that accept user-supplied data — API payloads, webhook bodies, configuration uploads — this is exactly the kind of silent exposure that can turn a routine request into an outage.


The Vulnerability Explained

What is buger/jsonparser?

github.com/buger/jsonparser is a popular, high-performance Go library for parsing JSON without the overhead of encoding/json. It operates directly on raw []byte slices, making it fast — but also meaning it must be especially careful about how it handles unexpected or malformed byte sequences.

The Root Cause: Uncontrolled Resource Consumption on Malformed Input

In buger/jsonparser v1.1.1, certain malformed JSON byte sequences can cause the parser to enter a state where it consumes disproportionate CPU or memory resources — or panics entirely — before returning an error. This falls squarely under CWE-400: Uncontrolled Resource Consumption.

The vulnerable dependency declaration in go.mod looked like this:

// go.mod (before fix)
github.com/buger/jsonparser v1.1.1 // indirect

And the corresponding hash in go.sum:

github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=

How Could This Be Exploited?

Consider a service that accepts a JSON body from an HTTP client and passes it — directly or indirectly — through buger/jsonparser. An attacker could craft a request body containing a malformed JSON payload specifically designed to trigger the vulnerable code path. For example:

// Hypothetical usage in a dependent component
jsonparser.Get(userSuppliedBody, "field")

If userSuppliedBody contains a malformed structure that exercises the bug in v1.1.1 — such as deeply nested incomplete objects, invalid Unicode escape sequences, or truncated number tokens — the parser can stall or crash the goroutine handling that request.

In a high-traffic service, an attacker sending a stream of such requests could:

  1. Exhaust goroutine pool resources, causing legitimate requests to queue and time out.
  2. Trigger a panic in the parsing goroutine, which — if not recovered — crashes the entire service process.
  3. Cause memory pressure if the parser allocates buffers proportional to malformed input size before failing.

Because buger/jsonparser is listed as an indirect dependency here, the exact call site depends on which direct dependency pulls it in. However, the vulnerability is present in the binary regardless of call depth.

Real-World Impact

Any endpoint in this application that processes untrusted JSON — even indirectly — could be a vector. A single unauthenticated HTTP request with a crafted body is all that's needed to trigger the condition. No authentication bypass, no privilege escalation — just availability destruction.


The Fix

The fix is a targeted, minimal dependency upgrade: github.com/buger/jsonparser from v1.1.1 to v1.1.2.

Before and After: go.mod

- github.com/buger/jsonparser v1.1.1 // indirect
+ github.com/buger/jsonparser v1.1.2 // indirect

Before and After: go.sum

  github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
  github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
+ github.com/buger/jsonparser v1.1.2 h1:frqHqw7otoVbk5M8LlE/L7HTnIq2v9RX6EJ48i9AxJk=
+ github.com/buger/jsonparser v1.1.2/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=

Why Both Files Need to Change

Go modules use two files to pin dependencies:

  • go.mod: Declares the required version. Changing v1.1.1 to v1.1.2 here tells the Go toolchain to resolve the new version.
  • go.sum: Contains cryptographic hashes (h1: entries) that verify the integrity of downloaded modules. The new version's hash must be added to authenticate the upgrade. Note that the old entries remain — Go keeps them for auditability — and the new v1.1.2 hashes are appended.

What v1.1.2 Changes

Version 1.1.2 of buger/jsonparser tightens the parser's handling of malformed input by adding proper bounds and error checks on the problematic byte-sequence paths. Crucially, the fix is backward compatible: valid JSON input is parsed identically to v1.1.1, so no application behavior changes for well-formed data.


Prevention & Best Practices

1. Treat Indirect Dependencies as First-Class Security Concerns

The // indirect comment in go.mod can create a false sense of distance. As shown here, an indirect dependency's vulnerability is just as exploitable as a direct one. Include all dependencies — direct and indirect — in your vulnerability scanning.

2. Use Software Composition Analysis (SCA) in CI

Tools like Trivy, govulncheck, and Dependabot can automatically flag vulnerable versions of Go modules:

# Scan your Go project with govulncheck
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...

# Or with Trivy
trivy fs --scanners vuln .

In this case, Trivy flagged the CVE-2026-32285 pattern against the go.mod file.

3. Validate and Limit JSON Input Before Parsing

Even with a patched parser, defense-in-depth means you should:

// Limit request body size before any parsing
http.MaxBytesReader(w, r.Body, 1<<20) // 1 MB max

// Read body with limit
body, err := io.ReadAll(r.Body)
if err != nil {
    http.Error(w, "request too large", http.StatusRequestEntityTooLarge)
    return
}

This prevents a class of resource-exhaustion attacks independent of parser behavior.

4. Fuzz-Test Your JSON Parsing Code

Go's built-in fuzzing support can help uncover parser edge cases before they become CVEs:

func FuzzParseConfig(f *testing.F) {
    f.Add([]byte(`{"key":"value"}`))
    f.Fuzz(func(t *testing.T, data []byte) {
        // Should never panic
        jsonparser.Get(data, "key")
    })
}

5. Follow OWASP Guidance on Input Validation

The OWASP Input Validation Cheat Sheet recommends validating all input for type, length, format, and range before processing — a principle that applies directly to JSON parsing pipelines.


Key Takeaways

  • // indirect doesn't mean safe: github.com/buger/jsonparser was an indirect dependency, but its vulnerability was fully exploitable. Every entry in go.mod is a security responsibility.
  • CVE-2026-32285 is triggered by malformed input, not by valid JSON: This means normal application testing won't expose it — only adversarial or fuzz inputs will.
  • Both go.mod and go.sum must be updated together: Updating only go.mod without the corresponding go.sum hash will cause build failures; both changes are required for a complete, verifiable fix.
  • The v1.1.1 → v1.1.2 upgrade is a drop-in fix: The API surface of buger/jsonparser is unchanged; no calling code needs modification.
  • SCA tooling (Trivy) caught what code review would miss: This vulnerability lives entirely in a version string — a single character difference between v1.1.1 and v1.1.2. Automated scanning is the only reliable way to catch this class of issue at scale.

How Orbis AppSec Detected This

  • Source: User-influenced input entering any code path that invokes github.com/buger/jsonparser functions (e.g., jsonparser.Get(), jsonparser.ArrayEach()) with untrusted byte slices.
  • Sink: The malformed-input parsing routines inside github.com/buger/jsonparser v1.1.1, reachable through the indirect dependency declared in go.mod.
  • Missing control: No version constraint preventing the use of the vulnerable v1.1.1 release; no input sanitization or size enforcement upstream of the parser call.
  • CWE: CWE-400 — Uncontrolled Resource Consumption
  • Fix: The dependency declaration in go.mod was updated from github.com/buger/jsonparser v1.1.1 to v1.1.2, with the corresponding cryptographic hash added to go.sum.

Orbis AppSec automatically detected this vulnerability and opened a pull request with the fix. Try Orbis AppSec on your repositories to find and fix issues like this automatically.


Conclusion

CVE-2026-32285 is a reminder that high-severity vulnerabilities don't always look dramatic in a diff. A single version number change — v1.1.1 to v1.1.2 in go.mod — is the difference between a service that can be taken offline by a crafted HTTP request and one that handles malformed input safely. The fix is minimal, backward-compatible, and verifiable through Go's module hash system.

For Go developers, the lesson is clear: your dependency tree is your attack surface. Keep it scanned, keep it current, and treat every // indirect entry with the same scrutiny as your direct dependencies.


References

Frequently Asked Questions

What is a Denial of Service vulnerability in a JSON parser?

A DoS vulnerability in a JSON parser means that specially crafted malformed input can cause the parser to loop indefinitely, consume excessive CPU/memory, or panic — making the application unavailable to legitimate users.

How do you prevent DoS via JSON parsing in Go?

Keep JSON parsing libraries up to date, enforce input size limits before parsing, and use fuzz testing to discover edge cases in parser behavior.

What CWE is Denial of Service via malformed JSON?

CWE-400: Uncontrolled Resource Consumption, which covers cases where an application does not properly limit the resources consumed when processing input.

Is input length limiting enough to prevent this DoS vulnerability?

Length limiting reduces risk but is not sufficient on its own — certain malformed structures can trigger the bug in very small payloads. The definitive fix is upgrading to v1.1.2.

Can static analysis detect this type of vulnerability?

Yes — tools like Trivy and similar software composition analysis (SCA) scanners can detect known vulnerable versions of dependencies like buger/jsonparser in go.mod files.

View the Security Fix

Check out the pull request that fixed this vulnerability

View PR #491

Related Articles

high

How Sensitive Data Exposure happens in Zotero plugins and how to fix it

A high-severity data exposure vulnerability in `Zotero.ts` automatically transmitted complete document metadata—including private notes, attachment paths, and tags—to external LLM services without user consent. The fix replaces broad `item.toJSON()` serialization with explicit field selection, sending only essential bibliographic data.

high

How missing dependency update cooldowns happen in GitHub Dependabot configurations and how to fix it

A semgrep scan flagged `.github/dependabot.yml` for lacking a cooldown period, meaning Dependabot would immediately propose updates to brand-new package versions across npm, Bundler, and Docker ecosystems. The fix adds a `cooldown: default-days: 7` block to every `package-ecosystem` entry, forcing a one-week waiting period before newly published releases are considered — reducing exposure to malicious or unstable package drops.

high

How dependabot-missing-cooldown happens in GitHub Actions/Node.js and how to fix it

The repository's `.github/dependabot.yml` had no cooldown period configured, meaning Dependabot could immediately propose updates to newly published package versions with zero time for the community to flag malware or instability. The fix adds a `cooldown` block with `default-days: 7` to both the `npm` and `github-actions` ecosystems, forcing a 7-day waiting period before new releases are surfaced as update PRs.

high

How Path Traversal Happens in TensorFlow's Data Service and How to Fix It

TensorFlow's data service dispatcher validated dataset IDs against forward-slash traversal attacks but overlooked backslash characters on non-Windows platforms, allowing attackers to escape the root directory. A targeted fix adds explicit backslash validation across all platforms, closing a high-severity path traversal vulnerability in the snapshot management system.

critical

How Unbounded WebSocket Message Handling Causes Resource Exhaustion in Node.js and How to Fix It

The WebSocketCrossServerAdapter class in a popular Node.js WebSocket library lacked any rate limiting on inbound messages, allowing attackers to flood Redis nodes and WebSocket servers with high-volume traffic. The fix introduces a configurable `rateLimit` option that caps messages per connection per second, preventing resource exhaustion while preserving legitimate functionality.

critical

How Remote Code Execution Happens in Handlebars Template Compilation and How to Fix It

CVE-2026-33937 is a critical remote code execution vulnerability in Handlebars.js that allows attackers to execute arbitrary code by passing maliciously crafted Abstract Syntax Tree (AST) objects to the compile() function. The vulnerability was patched in version 4.7.9, and we've upgraded to protect against this threat vector.