refactor: Limit JSON array size (#7112)

This commit is contained in:
Alex Kremer
2026-05-13 13:42:05 +01:00
committed by Bart
parent 62b942f1cc
commit 158b84812c
2 changed files with 50 additions and 13 deletions

View File

@@ -6,6 +6,13 @@
namespace xrpl {
/** Maximum JSON object nesting depth permitted during parsing. */
inline constexpr std::size_t kMAX_PARSED_JSON_DEPTH = 64;
/** Maximum number of elements permitted in any JSON array field during parsing.
Requests exceeding this limit are rejected with an invalidParams error. */
inline constexpr std::size_t kMAX_PARSED_JSON_ARRAY_SIZE = 512;
/** Holds the serialized result of parsing an input JSON object.
This does validation and checking on the provided JSON.
*/