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 Dependabot Missing Cooldown happens in GitHub Actions and how to fix it

A high-severity misconfiguration in `.github/dependabot.yml` left this Node.js library without a cooldown period, meaning Dependabot would immediately propose updates to newly published packages — including potentially malicious or unstable ones. The fix adds a `cooldown` block with `default-days: 7` to both the `npm` and `github-actions` package ecosystem entries, introducing a mandatory 7-day waiting period before any new package version is surfaced as an update candidate.

critical

How CSRF Protection Failures Happen in FastAPI and How to Fix Them

A critical CORS misconfiguration in `backend/main.py` allowed cookies to be sent alongside wildcard-origin requests, violating the CORS specification and opening the door to cross-site request forgery attacks. The fix conditionally disables `allow_credentials` when the allowed origins list contains a wildcard, bringing the configuration into compliance with browser security rules. This change closes a subtle but dangerous gap that could have let attackers on sibling subdomains forge authenticate

critical

How Missing Rate Limiting Happens in Node.js SSE Handlers and How to Fix It

A critical missing rate-limiting control in `src/sse/handlers/chat.js` allowed any caller to flood the SSE chat endpoint with unlimited requests, risking server resource exhaustion, denial of service, and runaway AI provider API costs. The fix introduces a per-IP sliding-window rate limiter that caps requests at 60 per minute and returns HTTP 429 on violations. Because the endpoint was publicly reachable and only validated API keys — not request frequency — exploitation required nothing more tha

medium

How Denial of Service via Catastrophic Backtracking happens in Node.js and how to fix it

CVE-2026-4867 is a Denial of Service vulnerability in path-to-regexp 0.1.12 where malformed URL parameters can trigger catastrophic backtracking in the library's regular expression engine, allowing an attacker to hang or crash a Node.js application with a single crafted request. The fix upgrades path-to-regexp to version 0.1.13, which patches the vulnerable regex patterns. This change was applied via a package-level override to ensure the patched version is used throughout the entire dependency

high

How Denial of Service via Exponential-Time Complexity happens in Node.js and how to fix it

CVE-2026-13149 is a high-severity Denial of Service vulnerability in the `brace-expansion` npm package, where crafted input strings trigger exponential-time processing that can freeze or crash a Node.js application. The fix upgrades `brace-expansion` from `2.0.2` to `2.1.4` and `minimatch` from `5.1.6` to `5.1.9`, along with npm `overrides` to ensure the patched versions are used throughout the entire dependency tree.

critical

How Unrestricted File Upload happens in Node.js/Express and how to fix it

A critical unrestricted file upload vulnerability was discovered in `mainsystem/routes/admin/profile.js`, where the avatar upload endpoint accepted any file type without validation. An authenticated attacker could upload a malicious server-side script to a web-accessible directory and execute arbitrary code on the server. The fix adds MIME type filtering, an allowlist of safe image formats, and a 2 MB file size limit to the multer middleware.