-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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 Heap buffer out of bounds write in start_decoder
(GHSL-2023-167/CVE-2023-45677
)
#1555
Closed
Conversation
This file contains 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
…7/CVE-2023-45677`)
(See comment at #1554 (comment) ) |
sezero
added a commit
to sezero/SDL_mixer
that referenced
this pull request
Dec 11, 2023
Based on the patches by Jaroslav Lobačevski (@JarLob) submitted to mainstream at: nothings/stb#1554 and nothings/stb#1555 GHSL-2023-166/CVE-2023-45676: Multi-byte write heap buffer overflow in start_decoder() GHSL-2023-167/CVE-2023-45677: Heap buffer out of bounds write in start_decoder()
icculus
pushed a commit
to libsdl-org/SDL_mixer
that referenced
this pull request
Dec 11, 2023
Based on the patches by Jaroslav Lobačevski (@JarLob) submitted to mainstream at: nothings/stb#1554 and nothings/stb#1555 GHSL-2023-166/CVE-2023-45676: Multi-byte write heap buffer overflow in start_decoder() GHSL-2023-167/CVE-2023-45677: Heap buffer out of bounds write in start_decoder()
sezero
added a commit
to libsdl-org/SDL_mixer
that referenced
this pull request
Dec 11, 2023
Based on the patches by Jaroslav Lobačevski (@JarLob) submitted to mainstream at: nothings/stb#1554 and nothings/stb#1555 GHSL-2023-166/CVE-2023-45676: Multi-byte write heap buffer overflow in start_decoder() GHSL-2023-167/CVE-2023-45677: Heap buffer out of bounds write in start_decoder() (cherry picked from commit 6673679)
sezero
added a commit
to icculus/SDL_sound
that referenced
this pull request
Dec 11, 2023
Based on the patches by Jaroslav Lobačevski (@JarLob) submitted to mainstream at: nothings/stb#1554 and nothings/stb#1555 GHSL-2023-166/CVE-2023-45676: Multi-byte write heap buffer overflow in start_decoder() GHSL-2023-167/CVE-2023-45677: Heap buffer out of bounds write in start_decoder()
sezero
added a commit
to sezero/libxmp
that referenced
this pull request
Dec 11, 2023
Based on the patches by Jaroslav Lobačevski (@JarLob) submitted to mainstream at: nothings/stb#1554 and nothings/stb#1555 GHSL-2023-166/CVE-2023-45676: Multi-byte write heap buffer overflow in start_decoder() GHSL-2023-167/CVE-2023-45677: Heap buffer out of bounds write in start_decoder()
sezero
added a commit
to libsdl-org/SDL_mixer
that referenced
this pull request
Dec 11, 2023
sezero
added a commit
to libsdl-org/SDL_mixer
that referenced
this pull request
Dec 11, 2023
sezero
added a commit
to icculus/SDL_sound
that referenced
this pull request
Dec 11, 2023
sezero
added a commit
to sezero/stb
that referenced
this pull request
Dec 12, 2023
Based on the patches by Jaroslav Lobačevski (@JarLob) submitted to mainstream at: nothings#1554 and nothings#1555 Also see nothings#1552 and nothings#1553 GHSL-2023-166/CVE-2023-45676: Multi-byte write heap buffer overflow in start_decoder() GHSL-2023-167/CVE-2023-45677: Heap buffer out of bounds write in start_decoder() GHSL-2023-165/CVE-2023-45675: 0 byte write heap buffer overflow in start_decoder()
sezero
added a commit
to sezero/stb
that referenced
this pull request
Dec 12, 2023
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.
A crafted file may trigger out of bounds write in
f->vendor[len] = (char)'\0';
[1]. The root cause is that iflen
read instart_decoder
[2] is a negative number andsetup_malloc
[3] successfully allocates memory in that case [4], but memory write is done with a negative indexlen
[1].Same vulnerability exists in
setup_temp_malloc
at [5]Similarly if
len
isINT_MAX
the integer overflowlen+1
happens inf->vendor = (char*)setup_malloc(f, sizeof(char) * (len+1));
[1] andf->comment_list[i] = (char*)setup_malloc(f, sizeof(char) * (len+1));
[6]. This case however allows writing multiple times past the end of the internalf->alloc.alloc_buffer
buffer.Impact
This issue may lead to code execution.
Resources
To reproduce the issue: