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

Merge pull request #7743 from NicolasDorier/harden-json-parsing

Public commit record

What the developer wrote

Authored by Nicolas Dorier

73/100 · Adequate
Merge pull request #7743 from NicolasDorier/harden-json-parsing

Harden JSON parsing against date coercion and excessive nesting
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit replaces many direct JSON parsing calls across BTCPay Server with a new, stricter helper called JsonParser. The helper prevents two specific problems: it no longer turns strings that look like dates into real date values automatically, and it limits how deeply nested JSON structures can be. These changes reduce the risk that an attacker could craft unusual JSON data that causes the server to misinterpret values or crash during processing. The commit also adds a test showing that deeply nested and date-like strings are handled safely.

Recommended action

Treat this as a worthwhile hardening patch. Review whether any callers still bypass JsonParser, and confirm that the default MaxDepth of 64 is sufficient for all production data shapes. Consider backporting to supported release branches because it changes parsing semantics for stored blobs and external JSON inputs.

Security signals we found

01

Replaces permissive Newtonsoft.Json parsing with a hardened wrapper

02

Disables automatic date string coercion (DateParseHandling.None)

03

Enforces explicit maximum JSON nesting depth (default 64)

04

Adds round-trip safety test for date-like strings and deep nesting

05

Updates coding conventions to mandate JsonParser usage

06

Touches blob serialization/deserialization paths for invoices, payments, payouts, and store configs

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.