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

fix typecode decoding DoS #29

Closed
wants to merge 2 commits into from
Closed

fix typecode decoding DoS #29

wants to merge 2 commits into from

Conversation

totaam
Copy link
Contributor

@totaam totaam commented Aug 5, 2021

Without this change, one can generate a bytestream which will effectively DoS the software decoding it: the cython decoder will spin at 100% CPU going through the list decoding loop (or dictionary - the same issues also exists there) forever until the system runs out of memory..

Sorry for the bad news. This looks like a CVE is in order.

@totaam
Copy link
Contributor Author

totaam commented Aug 5, 2021

I've looked at some other implementations and some seem to have implemented it the same way and are therefore also vulnerable.

@aresch aresch mentioned this pull request Aug 6, 2021
aresch added a commit that referenced this pull request Aug 10, 2021
This bug will cause rencode to hang if the invalid typecode is included
in a sequence type (list, dict) since the position will not change and
the loop checking for the termination byte never returns.

This change is a copy of PR #29 with a few aesthetic changes.
@aresch
Copy link
Owner

aresch commented Aug 10, 2021

I've fixed this in 572ff74 with some minor cosmetic changes.

@aresch aresch closed this Aug 10, 2021
@carnil
Copy link

carnil commented Sep 10, 2021

CVE-2021-40839 seems to be assigned to this issue.

@risicle
Copy link

risicle commented Sep 10, 2021

Could we have a release please?

@opoplawski
Copy link

Yes, a release seems very much in order here. Thanks.

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

Successfully merging this pull request may close these issues.

5 participants