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

Alternative fix for CVE-2022-24795 #242

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

skazi0
Copy link

@skazi0 skazi0 commented May 12, 2022

This is a "hybrid" of #240, brianmario/yajl-ruby#211 and robohack/yajl@166b384

Using abort() to avoid heap corruption/infinite loop while not adding new requirements for clients of this library and/or complex error handling mechanisms.

The buffer reallocation could cause heap corruption because of `need`
overflow for large inputs. In addition, there's a possible infinite loop
in case `need` reaches zero.

The fix is to `abort()` if the loop ends with lower value of `need` than
when it started.
@Neustradamus
Copy link

A long time ago, I have done a ticket:

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.

2 participants