Security update for rar/unrar (CVE-2007-0855)

Bug #84657 reported by Martin Meredith
10
Affects Status Importance Assigned to Milestone
Edgy Backports
Fix Released
Undecided
Unassigned
rar (Debian)
Fix Released
Unknown
rar (Gentoo Linux)
Fix Released
Medium
rar (Ubuntu)
Fix Released
Undecided
Martin Meredith
Breezy
Invalid
Undecided
Unassigned
Dapper
Won't Fix
Undecided
Unassigned
Edgy
Won't Fix
Undecided
Unassigned
Feisty
Fix Released
Undecided
Martin Meredith
unrar-nonfree (Debian)
Fix Released
Unknown
unrar-nonfree (Ubuntu)
Fix Released
Undecided
Martin Meredith
Breezy
Invalid
Undecided
Unassigned
Dapper
Fix Released
Undecided
Unassigned
Edgy
Won't Fix
Undecided
Unassigned
Feisty
Fix Released
Undecided
Martin Meredith

Bug Description

Packager unrar-nonfree is affected with CVE-2007-0855

Package uploaded to feisty, changes need to be made also in dapper, edgy, and edgy-backports

CVE References

Revision history for this message
Martin Meredith (mez) wrote :

Attached is patch for 3.5.4 (edgy and dapper)

Changed in unrar-nonfree:
status: Unconfirmed → Fix Committed
Martin Meredith (mez)
description: updated
Revision history for this message
Martin Meredith (mez) wrote :

as rar is also affected, but binary only - what is the procedure for updating dapper and edgy (and possibly breezy too as thats still not OBSOLETE)

Revision history for this message
Martin Meredith (mez) wrote :

Patch for breezy unrar-nonfreee

Changed in rar:
status: Unconfirmed → Fix Committed
Revision history for this message
Kees Cook (kees) wrote :

Seem the multi-byte actions should only happen if the entire range passes IS_VM_MEM()? Instead of:

+ if (IS_VM_MEM(Addr))
+ {
+ ((byte *)Addr)[0]=(byte)Value;
+ ((byte *)Addr)[1]=(byte)(Value>>8);
+ ((byte *)Addr)[2]=(byte)(Value>>16);
+ ((byte *)Addr)[3]=(byte)(Value>>24);

Does this make more sense:

+ if (IS_VM_MEM(Addr) &&
+ IS_VM_MEM(&((byte*)Addr[3]))
+ {
+ ((byte *)Addr)[0]=(byte)Value;
+ ((byte *)Addr)[1]=(byte)(Value>>8);
+ ((byte *)Addr)[2]=(byte)(Value>>16);
+ ((byte *)Addr)[3]=(byte)(Value>>24);

Changed in rar:
status: Unknown → Fix Released
Changed in unrar-nonfree:
status: Unknown → Fix Released
Revision history for this message
Martin Meredith (mez) wrote :

Quote from email

All these changes in rarvm.cpp code are related to endianness issue
on big endian computers. So users may notice these fixes only on big
endian machine.

Besides, I forgot to mention that real vulnerability was fixed
in GetPassword function in consio.cpp. So if you use 3.6.x version
of this function, please upgrade it to 3.7.3 code.

Revision history for this message
Martin Meredith (mez) wrote :

So, it seems that the real issue is in consio.cpp and wasnt in 3.7.2 ...

Patch attached for 3.5.4

Revision history for this message
Martin Meredith (mez) wrote :

unrar-nonfree 3.7.3 approved for backporting to edgy (This is to replace the currently backported version of unrar-nonfree, which includes the security issue, not to work as a security fix (this will be done in the usual process)

Revision history for this message
Martin Meredith (mez) wrote :

rar 1:3.7b1-0ubuntu11 (typo on upload for XubuntuY!) approved for backporting to edgy (This is to replace the currently backported version of rar, which includes the security issue, not to work as a security fix)

Changed in edgy-backports:
status: Unconfirmed → In Progress
Revision history for this message
Martin Meredith (mez) wrote :

Clean patch for 3.5.4 (as advised by debian Security team)

Revision history for this message
Kees Cook (kees) wrote :

Hi! Thanks for getting this collected. So as I understand it, for breezy, dapper, edgy, this binary blob package needs to just be put into the archives, is that correct? Have you tested it for those architectures?

Revision history for this message
Martin Meredith (mez) wrote :

Kees, for "rar" this is true, however, it needs a small modification to use the statically linked binary (as we found out in debian!) the package rar-3.7b1-2 in debian has the neccessary changes.

Regarding unrar - it's the above patch (http://librarian.launchpad.net/6412402/fix_cve_3.5.4_clean) that needs to be applied to dapper and edgy. I've got a breezy patch in the works

Kees Cook (kees)
Changed in rar:
status: Fix Committed → Fix Released
Kees Cook (kees)
Changed in rar:
status: Unconfirmed → Confirmed
status: Unconfirmed → Confirmed
status: Unconfirmed → Confirmed
Changed in unrar-nonfree:
assignee: nobody → mez
status: Fix Committed → Fix Released
Changed in rar:
assignee: nobody → mez
Revision history for this message
Kees Cook (kees) wrote :

For unrar-nonfree, the patches don't apply to earlier versions. :(

 consio.cpp: In function 'void GetPasswordText(char*, int)':
 consio.cpp:125: error: 'strncpyz' was not declared in this scope
 consio.cpp: In function 'bool GetPassword(PASSWORD_TYPE, const char*, char*, int)':
 consio.cpp:171: error: 'ASIZE' was not declared in this scope

For the rar package, it looks like a good bit of time will be needed to do all the orig.tar.gz's, etc. At the moment, I don't have time to get these sorted out. If someone can generate (tested) debdiffs for each of the stable releases, I can get them uploaded.

Changed in unrar-nonfree:
status: Unconfirmed → Confirmed
status: Unconfirmed → Fix Released
status: Fix Released → Confirmed
status: Unconfirmed → Confirmed
Revision history for this message
Martin Meredith (mez) wrote : Re: [Bug 84657] Re: Security update for rar/unrar (CVE-2007-0855)

Yeah, I just realised about the patch myself... need to pull in changes
in rardefs.hpp and strfn.{cpp,hpp} too

On Thu, 2007-02-15 at 18:51 +0000, Kees Cook wrote:
> For unrar-nonfree, the patches don't apply to earlier versions. :(
>
> consio.cpp: In function 'void GetPasswordText(char*, int)':
> consio.cpp:125: error: 'strncpyz' was not declared in this scope
> consio.cpp: In function 'bool GetPassword(PASSWORD_TYPE, const char*, char*, int)':
> consio.cpp:171: error: 'ASIZE' was not declared in this scope
>
> For the rar package, it looks like a good bit of time will be needed to
> do all the orig.tar.gz's, etc. At the moment, I don't have time to get
> these sorted out. If someone can generate (tested) debdiffs for each of
> the stable releases, I can get them uploaded.
>
>
> ** Changed in: rar (Ubuntu Breezy)
> Status: Unconfirmed => Confirmed
>
> ** Changed in: rar (Ubuntu Dapper)
> Status: Unconfirmed => Confirmed
>
> ** Changed in: rar (Ubuntu Edgy)
> Status: Unconfirmed => Confirmed
>
> ** Changed in: unrar-nonfree (Ubuntu Feisty)
> Assignee: (unassigned) => Martin Meredith
> Status: Fix Committed => Fix Released
>
> ** Changed in: rar (Ubuntu Feisty)
> Assignee: (unassigned) => Martin Meredith
>
> ** Changed in: unrar-nonfree (Ubuntu Breezy)
> Status: Unconfirmed => Confirmed
>
> ** Changed in: unrar-nonfree (Ubuntu Dapper)
> Status: Unconfirmed => Fix Released
>
> ** Changed in: unrar-nonfree (Ubuntu Dapper)
> Status: Fix Released => Confirmed
>
> ** Changed in: unrar-nonfree (Ubuntu Edgy)
> Status: Unconfirmed => Confirmed
>

Revision history for this message
Martin Pitt (pitti) wrote :

 * Trying to backport unrar-nonfree...
  - <unrar-nonfree_3.7.3.orig.tar.gz: downloading from librarian>
  - <unrar-nonfree_3.7.3-1.diff.gz: downloading from librarian>
  - <unrar-nonfree_3.7.3-1.dsc: downloading from librarian>
I: Extracting unrar-nonfree_3.7.3-1.dsc ... done.
I: Building backport of unrar-nonfree-3.7.3 as 1:3.7.3-1~edgy1 ... done.

Changed in edgy-backports:
status: In Progress → Fix Released
Revision history for this message
Marco Rodrigues (gothicx) wrote :

Breezy support is over.. Today it's Breezy End Of Life!

Changed in unrar-nonfree:
status: Confirmed → Rejected
Changed in rar:
status: Confirmed → Rejected
Changed in rar:
status: Unknown → Fix Released
Revision history for this message
William Grant (wgrant) wrote :

Edgy is EOL.

Changed in rar:
status: Confirmed → Won't Fix
Changed in unrar-nonfree:
status: Confirmed → Won't Fix
Martin Meredith (mez)
Changed in unrar-nonfree (Ubuntu Dapper):
status: Confirmed → Fix Released
Steve Beattie (sbeattie)
tags: added: patch-needswork
Changed in rar (Gentoo Linux):
importance: Unknown → Medium
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Thank you for reporting this bug to Ubuntu. dapper has reached EOL
(End of Life) and is no longer supported. As a result, this bug
against dapper is being marked "Won't Fix". Please see
https://wiki.ubuntu.com/Releases for currently supported Ubuntu
releases.

Please feel free to report any other bugs you may find.

Changed in rar (Ubuntu Dapper):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.