<div dir="ltr">Thanks for the sneak peek.<br><br>I'd suggest adding a security section to the JEP, when the time comes. Most input to this JSON parsing API will probably be untrusted, and this is an area where "last mover advantage" can be helpful. As a user, the progression I've seen in other JSON parsers was a first wave of "serialization gadget" exploits providing RCE, followed by a wave of denial-of-service vulnerabilities. As a user, I'd love to know that these issues have all been considered up front:<br><br>- Serialization gadgets (no object mapping, so not an issue?)<br>- Sane limits (and maybe configurability) for:<br>  - Max object / array nesting depth<br>  - Max key (field name) length<br>  - Max value length (strings)<br>  - Max value length (numbers)<br>  - Max overall document size (maybe less of a problem if there are no Json.parse() methods for streams or files?)<br><br><div>If you want to avoid the configurability aspect, it should be possible to find defaults which are relatively safe and do not impact 99% of users (e.g. who realistically uses JSON nested over 1k levels deep?).</div><div><br></div><div><br></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, May 16, 2025 at 7:26 PM Raffaello Giulietti <<a href="mailto:raffaello.giulietti@oracle.com">raffaello.giulietti@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Since the parser is specified to be lazy, the backing store needs to be <br>
immutable.<br>
<br>
<br>
On 2025-05-16 18:52, Markus KARG wrote:<br>
> When instead allowing the <br>
> general interface CharSequence, *any* kind of text source can be parsed, <br>
> for example, an off-heap located direct CharBuffer, without the need to <br>
> explicitly copy its content into a temporary in-memory String <br>
> representation, upfront to parsing. More flexible, more speed, less <br>
> memory, less GC. :-)<br>
> <br>
</blockquote></div>