AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Moderate 63 Bitcoin

Harden JSON parsing

Public commit record

What the developer wrote

Authored by Nicolas Dorier

28/100 · Opaque
Harden JSON parsing
✓ Subject identifies a change! No meaningful explanatory body! Opaque security-relevant change
The short version

What changed, and why it matters

This commit replaces many uses of the standard Newtonsoft JSON parser with a new, stricter 'JsonParser' helper across the BTCPay Server codebase. The new parser prevents date-looking strings from being silently turned into real dates, rejects JSON that contains extra trailing content, and limits how deeply nested JSON can be. These changes are defensive hardening: they reduce the chance that stored data changes its meaning after being saved and reloaded, and they block unusually deep JSON that could be used to exhaust server resources. The commit does not by itself fix a specific, known exploit, but it closes several risky parsing behaviors.

Recommended action

Treat this as a security hardening patch and include it in the next maintenance release. Review remaining JObject.Parse/JToken.Parse/JArray.Parse usages not covered by the commit, and ensure that MaxDepth exceptions at call sites are handled safely (some catch blocks currently swallow exceptions, which could mask malformed input). Monitor for any regressions in plugins or migrations that previously relied on date-string coercion.

Security signals we found

01

New strict JSON parser wrapper with DateParseHandling.None to prevent unintended date coercion

02

Enforced MaxDepth default of 64 to mitigate deeply nested JSON denial-of-service

03

Rejection of trailing non-comment JSON tokens to prevent smuggling/concatenation issues

04

Wide replacement of JObject.Parse/JToken.Parse/JArray.Parse across 48 files

05

Added unit test asserting round-trip fidelity of date-like metadata and depth limits

06

No explicit CVE, advisory, or researcher attribution in commit or supplied references

Risk score

Why this scored 63/100

Our methodology →
Potential impact 18/30
Exploitability 12/25
Stealth signal 8/15
Affected reach 14/15
Confidence 7/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.