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: Potential Vulnerability in bzip2 Library #1370

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tabudz
Copy link

@tabudz tabudz commented Feb 18, 2025

This PR fixes a security vulnerability in inflate() that was cloned from zlib but did not receive the security patch applied in zlib. The original issue was reported and fixed under https://gitlab.com/federicomenaquintero/bzip2/-/commit/74de1e2e6ffc9d51ef9824db71a8ffee5962cdbc.

This PR applies the same patch as the one in zlib to eliminate the vulnerability.

References
https://nvd.nist.gov/vuln/detail/CVE-2019-12900
https://gitlab.com/federicomenaquintero/bzip2/-/commit/74de1e2e6ffc9d51ef9824db71a8ffee5962cdbc

nSelectors is used in a loop from 0 to nSelectors to access selectorMtf
which is
	UChar    selectorMtf[BZ_MAX_SELECTORS];
so if nSelectors is bigger than BZ_MAX_SELECTORS it'll do an invalid memory
access

Fixes out of bounds access discovered while fuzzying karchive
@@ -9,3 +9,6 @@ ORIGIN
Author: Mark Wielaard <[email protected]>
Date: Sat Jul 13 17:17:58 2019 +0200
Prepare for 1.0.8 release.

local vulnerability fix:
- Fix CVE-2019-12900
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GH shows something is missing in this file.

Copy link

@nobkd nobkd Feb 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's an End Of File (EOF) without newline marker, to be able to tell it apart from EOF with newline. Nothing's missing.

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

Successfully merging this pull request may close these issues.

3 participants