Skip to content
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

net.minidev.json.parser.ParseException: Malicious payload, having non natural depths. #154

Closed
brad302 opened this issue Jun 29, 2023 · 8 comments

Comments

@brad302
Copy link

brad302 commented Jun 29, 2023

As I'm sure you're aware, this package is used by Talend by two key components, tExtractJSONFields and tFileInputJSON.

We're currently upgrading to Talend V8 which brings with it v2.4.9 of this package after having been on v2.4.7 for quite some time.

Can I ask why that exception was introduced because at present, it's halting our upgrade. We have a seemingly innocuous sized JSON structure that is now failing because of the package upgrade.

My question is, how can we possibly overcome it? It's quite the issue.

Thanks

Brad

@brad302 brad302 changed the title net.minidev.json.parser.ParseException: Malicious payload, having non natural depths, parsing stoped on [ at position 187301. net.minidev.json.parser.ParseException: Malicious payload, having non natural depths. Jun 29, 2023
@shoothzj
Copy link
Collaborator

shoothzj commented Jun 29, 2023

@brad302 I think it has been discussed this in #131 (comment)
Could you please provide us the case? We can add an argument to customize this limit if need.
cc @UrielCh

@shoothzj
Copy link
Collaborator

seemingly innocuous sized JSON structure

I think this error only occurs when json size very large. Could you please provide a minimal reproduced case?

@brad302
Copy link
Author

brad302 commented Jun 30, 2023

seemingly innocuous sized JSON structure

I think this error only occurs when json size very large. Could you please provide a minimal reproduced case?

Yep, have attached one.

When I say "innocuous" I mean, I would expect it to be able to be processed. I consider the payload to be large enough but I have seen much larger.

Let me know how you go. Thanks
payload.zip

@shoothzj
Copy link
Collaborator

shoothzj commented Jul 1, 2023

@brad302 @UrielCh
I hava created a draft pr #155 for this issue. PTAL

@brad302
Copy link
Author

brad302 commented Jul 4, 2023

What are the chances of having the default value substantially increased? My issue is, when this new version is released, there's nothing to say that Talend will follow suit and provide the ability to enter a value and override the default.

It may be a big ask but something like 2000 (rather than 400) would help a lot. I'd say that would still alleviate any issues relating to a DDOS attack but not sure if it would then re-expose the CVE.

Happy to get your thoughts.

@UrielCh
Copy link
Contributor

UrielCh commented Jul 5, 2023

If a real non-malicious application needs more, adding a flag to drop this security may be a better choice, and increasing the current 400 to more like 1000, is fine, 400 never blew up any stack, and 1000 is still kind of okay.

@UrielCh
Copy link
Contributor

UrielCh commented Jul 7, 2023

discussions are in progress in the draft #155

@shoothzj
Copy link
Collaborator

shoothzj commented May 8, 2024

I think we can close this issue now, see #156 to drop the limit.

@shoothzj shoothzj closed this as completed May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants