4.2. ParserLimits
The ParserLimits structure provides 11 configurable threat mitigations:
Parameter | Default | Purpose |
|---|---|---|
| 250 | Maximum recursion depth — prevents billion-laugh expansion |
| 10 MB | Maximum scalar string length — DoS prevention |
| 100,000 | Maximum sequence element count |
| 10 MB | Maximum total mapping size |
| 50 | Maximum alias chain depth — recursive cycle protection |
|
| Whether duplicate mapping keys are accepted |
| customizable |
Restricts which tag handles ( |
| customizable |
Explicit rejection of dangerous tags (e.g., |
|
| Whether non-conformant input is rejected or best-effort parsed |
| explicit | Character encoding validation for comments |
| standard | Newline normalization in literal scalars |