|
|
Rar: CmdExtract::UnstoreFile integer truncation memory corruption | |
| Project Member Reported by taviso@google.com, Oct 1 2015 | Back to list | |
The attached file crashes in CmdExtract::UnstoreFile because the signed int64 DestUnpSize is truncated to an unsigned 32bit integer. Perhaps CmdExtract::ExtractCurrentFile should sanity check Arc.FileHead.UnpSize early. I observed this crash in Avast Antivirus, but the origin of the code appears to be the unrar source distribution. I imagine many other antiviruses will be affected, and presumably WinRAR and other archivers. This bug is subject to a 90 day disclosure deadline. If 90 days elapse without a broadly available patch, then the bug report will automatically become visible to the public.
Project Member
Comment 1
by
taviso@google.com,
Oct 1 2015
,
Oct 1 2015
Response from maintainer: Hello, Thank you! You are right, it is needed to add: if (Arc.FileHead.PackSize<0) Arc.FileHead.PackSize=0; if (Arc.FileHead.UnpSize<0) Arc.FileHead.UnpSize=0; in the beginning of CmdExtract::ExtractCurrentFile. Initially I wanted to fix it earlier in Archive::ReadHeader15, but then decided that I prefer to see real negative values in archive listing to understand that archive is corrupt. Also unrar.dll calls CmdExtract::ExtractCurrentFile directly and can pass invalid values from user program, so it is better to fix them here. Eugene
,
Oct 1 2015
Maintainer says "I already updated WinRAR 5.30 beta 4 build on the site and of course we'll include it to next beta or release. Now I would not like to openly publish all technical details though, to not help hackers to use this bug. Maybe only something general like: RAR could crash when unpacking .rar archives with corrupt file headers." I've requested that unrarsrc be updated, and asked about advisories.
,
Oct 1 2015
Fixed in unrarsrc-5.3.5, still considering options for informing downstream users (like Avast, and probably many other antiviruses).
,
Dec 9 2015
I think this issue is as resolved as it's going to be. There are probably other consumers, but at this point keeping this issue restricted is just getting in the way. |
||
| ► Sign in to add a comment | ||