-
Notifications
You must be signed in to change notification settings - Fork 807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stack exhaustion parsing a JSON file #282
Comments
|
This is caused due to an unlimited parsing depth when parsing JSON arrays; this allows the |
Indeed. It takes a less than 100kb json file to crash the library, which is bad if you are receiving untrusted inputs. Is there any plans to limit the parsing depth? |
|
I have no idea since I'm not the maintainer. I think I could throw a patch together to fix the root cause, though. |
|
The fix is in pull request #283. |
|
Fixed in #284 |
Including a rather critical bugfix for Jansson; see akheron/jansson#282.
|
Hi folks. We have reports on FreeBSD that the change in #284 causes a regression on large flat JSON files. The report is https://bugs.FreeBSD.org/209492. Any recommendations? |
|
@junovitch would be awesome if you could a) open a separate issue with b) a sample attached for testing and c) link to the exact patch applied by FreeBSD. |
The fix limits recursion depths when parsing arrays and objects. The limit is configurable via the `JSON_PARSER_MAX_DEPTH` setting within `jansson_config.h` and is set by default to 2048. Update the RFC conformance document to note the limit; the RFC allows limits to be set by the implementation so nothing has actually changed w.r.t. conformance state. Reported by Gustavo Grieco.
Hi,
A crash caused by stack exhaustion parsing a JSON was found. It affects, at least version 2.5 as well as the last git revision (and maybe others). To reproduce using jshon:
The text was updated successfully, but these errors were encountered: