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

Fail earlier on coercions from "too big" BigInteger into fixed-size types (int, long, short) #488

Closed
cowtowncoder opened this issue Oct 16, 2018 · 2 comments
Milestone

Comments

@cowtowncoder
Copy link
Member

(note: offshoot of FasterXML/jackson-databind#2157)

There is a potential Denial-of-Service attack vector in which attacker may include long BigIntegers, with size like 1 million digits (which is still feasible to send), targeted at processing that expects one of Java's fixed-length "small" integer types (int, long most commonly), and cause asymmetrically high processing load. This because JDK's conversion from BigInteger to these types is surprisingly slow; and because Jackson tries to retain accuracy

cowtowncoder added a commit that referenced this issue Oct 16, 2018
@cowtowncoder
Copy link
Member Author

Note to self: first patch covers cases where int, long are expected for _parseSlowInt(). But it was suggested cases for float and double (from JSON integer) should also be handled -- this is probably true, but I need to make sure I understand where this code path comes from, and then apply appropriately.

cowtowncoder added a commit that referenced this issue Oct 20, 2018
…r to avoid drastic performance issue as per suggestions by @wujimin
cowtowncoder added a commit that referenced this issue Oct 30, 2018
@cowtowncoder cowtowncoder modified the milestones: 2.9.0, 2.9.8 Oct 30, 2018
@cowtowncoder
Copy link
Member Author

I think I will consider first part done; if and when potential gaps are found let's create new issues.

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

1 participant