-
-
Notifications
You must be signed in to change notification settings - Fork 459
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
Buffer over-read causes segmentation fault in pic_parameter_set::dump #418
Comments
Thank you. |
Hi, thanks for the quick response and fix! It would be highly appreciated if you could request a CVE for this issue (or let me know if you want me to handle it). Template for Mitre
Feel free to change or modify anything you feel is wrong! |
Thank you. I've sent the CVE request. Will update this once the number is published. |
CVE-2023-43887 was assigned to this. |
Where did you send the request for this CVE? [1] https://www.cve.org/CVERecord?id=CVE-2023-43887 |
It is online now. |
Maybe v1.0.6~v1.0.10 is also affected? |
Summary
There is a segmentation fault caused by a buffer over-read on pic_parameter_set::dump due to an incorrect value of num_tile_columns or num_tile_rows.
Tested with:
./dec265 -d poc
Crash output:
Analysis
While executing
decoder_context::read_pps_NAL
, parameters are read inInside the function, there is a check when setting
num_tile_columns
in case it goes overDE265_MAX_TILE_COLUMNS
, which is 10.After exiting due to reading more than
DE265_MAX_TILE_COLUMNS
, the headers are dumped by callingdump
:In
dump
, the following code is executed to dump the tile column boundaries:As previously shown,
num_tile_columns
while be set to a higher number thanDE265_MAX_TILE_COLUMNS
.colBd
is defined as:int colBd [ DE265_MAX_TILE_COLUMNS+1 ];
Therefore, that loop will go over
colBd
and will print all the data pointed by the values found after the limits ofcolBd
in memory until the end of the loop or the next memory address is invalid.Impact
If using a carefully crafted exploit, the impact could be an information leak without a crash.
Patch
In order to prevent this, the
success
value should be checked before printing the information:Another possibility could be to perform length checks inside the
dump
function to handle the case:Other notes
The same issue occurs with
num_tile_rows
.The text was updated successfully, but these errors were encountered: