Skip to main content
Feedback

JSON Threat Protection Policy

The json-threat-protection policy validates a JSON request body by specifying limits for various JSON structures such as arrays, field names, and string values. When an invalid request is detected (the limit is reached), the request is considered a threat and rejected with a 400 BAD REQUEST.

Timing

On RequestOn Request Content
X

Configuration

PropertyRequiredDescriptionTypeDefault
maxEntriesnoMaximum number of entries allowed for a JSON object. For example, { "a":{ "b":1, "c":2, "d":3 }}, a has three entries.integer (-1 to specify no limit)100
maxArraySizenoMaximum number of elements allowed in an array.integer (-1 to specify no limit)100
maxDepthnoMaximum depth of JSON structure. For example, { "a":{ "b":{ "c":true }}} has a depth of three.integer (-1 to specify no limit)100
maxNameLengthnoMaximum string length allowed for a JSON property name.integer (-1 to specify no limit)100
maxValueLengthnoMaximum string length allowed for a JSON property value.integer (-1 to specify no limit)500

Errors

HTTP status code

CodeMessage
400Received in the following cases:
Invalid JSON structure, maximum depth exceeded, maximum JSON entries exceeded, maximum JSON array size exceeded, maximum JSON field name length exceeded, maximum JSON field value length exceeded
On this Page