Skip to content

Incomplete JSON parsing => security vulnerability #1576

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

Closed
marcstern opened this issue Sep 27, 2017 · 8 comments
Closed

Incomplete JSON parsing => security vulnerability #1576

marcstern opened this issue Sep 27, 2017 · 8 comments
Assignees
Milestone

Comments

@marcstern
Copy link

marcstern commented Sep 27, 2017

** Content was removed by @zimmerle on 2017-Sep-27

@zimmerle
Copy link
Contributor

Dear @marcstern,

Regardless of the content, do you really think that it is a good idea to publish a possible security bypass on GitHub ?

@zimmerle zimmerle self-assigned this Sep 27, 2017
@victorhora victorhora self-assigned this Sep 27, 2017
@marcstern
Copy link
Author

In this case, there is very few information an attacker can use.
In case you have a vulnerability in your application in a JSON request without JSON object, then ModSecurity doesn't protect you. Point There is no way to use that info to tweak an attack to bypass ModSecurity.
This disclosure doesn't introduce an additional risk

@marcstern
Copy link
Author

I created a (one line) pull request for this: #1577

@marcstern
Copy link
Author

Remark: In my patch, I used an empty ARG name. This looks the most logical approach; however, in a strict environment, you should have a rule forbidding (for non-JSON requests) an empty ARG name.
You obviously have the possibility to fine-tune your rule to not apply it to JSON requests but, if this syntax is totoally usual (but is it really?), then we may use a non-empty name (ex: "unnamed") to not trigger that kind of problem.
Any experience with this syntax (in any direction)?

@zimmerle zimmerle added this to the v3.0.0 feature complete milestone Oct 10, 2017
@marcstern
Copy link
Author

This patch is trivial and has a high value, why not adding it in the 2.9 trunk?

@zimmerle
Copy link
Contributor

I think you meant to make this comment on the related pull request, not in this issue. The pull request can be found at #1577. The pull request is under review, it will be merged once the review is done.

zimmerle pushed a commit that referenced this issue Nov 10, 2017
It also address the issue #1576 and #1577
@zimmerle
Copy link
Contributor

This is already fixed in v3.0. The solution adopted is different from the ticket #1577. In v3 the json parser understands the array structures into array_n format, where "n" is the position of the element. Also, we moved from string concatenation to a stack structure making the implementation more robust. Fix is still pending for v2.

@zimmerle
Copy link
Contributor

Thanks @marcstern.

Merged as part of: 9b6d4b2 and 25e5543.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants