java
java copied to clipboard
Null parsing accepts bad input
Various places in this library that parse null will see 'n' and then skip the next three characters without validating that the next three characters are 'u' 'l' 'l'. So this is parsed as null: nope.
See for example https://github.com/json-iterator/java/blob/master/src/main/java/com/jsoniter/IterImplObject.java#L10-L12
public static final String readObject(JsonIterator iter) throws IOException {
byte c = IterImpl.nextToken(iter);
switch (c) {
case 'n':
IterImpl.skipFixedBytes(iter, 3);
return null;
Edit: also note that this same issue is present for true and false.
Hello, I'm new to open-source contribution and I would like to help. Are you working on this? if not, can you please assign this to me?
I’m not working on this, please feel free.
@mtdowling thanks 👍
@mtdowling I'm new to open source and I would love to give it a try(even if it does not help).
Hey, we are a team of 5 university students working on contributing to OSS projects. We would love to work on this issue if it is still unassigned. Thank you for your time.