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;