-
Notifications
You must be signed in to change notification settings - Fork 44
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
Memory-leak bug in printfileinfo, in printinfo.c #60
Comments
It appears that a CVE has been assigned to this issue: CVE-2022-24599 |
Fixed by:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There exists one Memory-leak bug in printfileinfo, in printinfo.c, which allows an attacker to leak the address of heap or libc via a crafted file.
To reproduce with the attached poc file:
poc.zip
Heap address leak:
./sfinfo ./heapleak_poc.aiff
Result(See the output of Copyright):
Libc address leak:
./sfinfo ./libleak_poc.aiff
Result(See the output of Copyright):
This vulnerability can be triggered anywhere the printfileinfo function is called, for example, sfconvert.
The poc.py will help you to calculate the address, which is test on Ubuntu 20.04, python2.
Usage of poc.py:
The audiofile project is built with:
Descrtption of the Vulnerability:
First, the printfileinfo function calls the copyrightstring function to get data:
Second, the copyrightstring function obtains copyright information from the file and returns a string pointer:
However, it forgets to use memset or zero bytes to prevent the Memory-Leak Vulnerability.
Most importantly, the attacker can control the length of the memcpy when copying the copyright string, in the afReadMisc function, in Miscellaneous.cpp:
The text was updated successfully, but these errors were encountered: