Fix a buffer overflow when decompressing solv pages#622
Closed
ppisar wants to merge 1 commit into
Closed
Conversation
repopagestore_load_page_range() and repopagestore_read_or_setup_pages() functions called unchecked_decompress_buf() on compressed data which were just loaded from a solv file without validating them with check_decompress_buf(). If the solv file was maliously crafted to decompress beyond REPOPAGE_BLOBSIZE-byte-sized stack-allocated buffer (e.g. 100lllll byte with high lllll counter at the end of the buffer), or a backreference was pointing out of the output buffer (e.g. a reference at the beginning of the buffer with high offset pointing before a start of the buffer), unchecked_decompress_buf() would read or write out of the output buffer, causing a buffer overflow. Trival fix would be calling check_decompress_buf() before unchecked_decompress_buf() as repopagestore_decompress_page() already does. Instead, this patch uses repopagestore_decompress_page() to do the check and decompression in a single step. Acknowledgement: Aisle Research CVE-2026-48864 https://bugzilla.redhat.com/show_bug.cgi?id=2460425
Contributor
Author
|
This pull request was discussed privately with libsolv maintainer before lifting an embargo on this vulnerability. The maintainer rejected it with an explanation that solv file parser is designed for speed and not for parsing nontrusted input. |
Member
|
Yes. Closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
repopagestore_load_page_range() and
repopagestore_read_or_setup_pages() functions called unchecked_decompress_buf() on compressed data which were just loaded from a solv file without validating them with check_decompress_buf().
If the solv file was maliously crafted to decompress beyond REPOPAGE_BLOBSIZE-byte-sized stack-allocated buffer (e.g. 100lllll byte with high lllll counter at the end of the buffer), or a backreference was pointing out of the output buffer (e.g. a reference at the beginning of the buffer with high offset pointing before a start of the buffer), unchecked_decompress_buf() would read or write out of the output buffer, causing a buffer overflow.
Trival fix would be calling check_decompress_buf() before unchecked_decompress_buf() as repopagestore_decompress_page() already does.
Instead, this patch uses repopagestore_decompress_page() to do the check and decompression in a single step.
Acknowledgement: Aisle Research
CVE-2026-48864
https://bugzilla.redhat.com/show_bug.cgi?id=2460425