Closed litios closed 1 year ago
Thank you. I have fixed this in a way similar to your first patch, just reordering it a bit to match the code for reading vps, sps, and slice headers.
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! Thanks.
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? According to [1] the CVE is reserved, but no information are available yet.
[1] https://www.cve.org/CVERecord?id=CVE-2023-43887 [2] https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-43887
According to [1] the CVE is reserved, but no information are available yet.
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
.