Pan saves some files as executable

Bug #374097 reported by Paul Crawford
310
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pan (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

This is a report of a serious security problem I found with pan 0.132, it affects all releases Ubuntu including 9.04 (and also with Pan 0.133 as shipped with Fedora-10).

The problem is that Pan obeys the original yEnc standard which preserves file permissions, thus allowing malware to be saved as executable (typically the somefilename.avi.exe sort of Trojan). So far this appears to be a Windows-only threat, but of course that could change.

The discussion of this resulted in the proposed patch to disable the preservation of file permission mask, as covered here:

http://<email address hidden>/msg05572.html

Hopefully the Ubuntu team will implement this very soon, but following here is how I did it:

Of course, you should *think* carefully about following *any* system wide commands that involve 'sudo', and ensure you understand any commands before trying them!

First I installed Pan from the Ubuntu repository as a typical user would. I set it up with my news server (news.virginmedia.com with article time-out set to 2 weeks in my case) and tested that it works.

Then I installed the packages needed to build Pan, first the libraries from the repository:

sudo apt-get install libpcre++-dev libgmime-2.0-2-dev libgtkspell-dev

Then I downloaded the pan 0.133 source (you could replace the wget step by using a web browser to check it is the correct pan site, of course):

 cd ~/Documents
 wget http://pan.rebelbase.com/download/releases/0.133/source/pan-0.133.tar.gz
 tar -xf pan-0.133.tar.gz
 cd pan-0.133/

Then configure and build the basic version of pan 0.133 with this:

 ./configure
 make

After a couple of minutes, hopefully it will have built correctly. Then I edited the decoder source file to apply the fix:

 gedit pan/tasks/decoder.cc

Go to line 137 (e.g. Ctrl+I and enter 137) and add the IGNMODE step so it looks like this code section:

      UUSetMsgCallback (this, uu_log);
      UUSetOption (UUOPT_DESPERATE, 1, NULL); // keep incompletes; they're useful to par2
      UUSetOption (UUOPT_IGNMODE, 1, NULL); // don't save file as executable
      UUSetBusyCallback (this, uu_busy_poll, 500); // .5 secs busy poll?

Save decoder.cc (e.g. Ctrl+S) and then build the new version with:

 make

This should be much quicker. Finally, it can be installed with this:

 sudo cp /usr/bin/pan /usr/bin/pan-0.132
 sudo cp pan/gui/pan /usr/bin/pan

If you start pan the menu Help -> About should now report Pan 0.133

Paul Crawford (psc-sat)
description: updated
visibility: private → public
Revision history for this message
Paul Crawford (psc-sat) wrote :

Changed visibility back to private, as maybe less trouble all round if Ubuntu fixes it as an package update, rather than lots of folk trying this themselves.

visibility: public → private
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Marked public as the upstream discussion is public.

visibility: private → public
Changed in pan (Ubuntu):
status: New → Confirmed
Changed in pan (Ubuntu):
importance: Undecided → Low
Revision history for this message
Paul Crawford (psc-sat) wrote :

OK I agree it is low priority (given you have to try and run the resulting download afterwards) but given it is a very simple fix that also would work on the Ubuntu patched version of 0.132, then why not?

Revision history for this message
Paul Crawford (psc-sat) wrote :

Another reminder that this should be patched! We are now on 10.04 LTS release, have gone from 0.132 to 0.133, so it seems daft to *still* allow malware to be saved with execute permissions!

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Paul, thanks for the reminder. It seems that upstream is not particularly interested in this patch. This issue has been triaged as having a 'Low' severity. The Ubuntu Security team normally will group several Low severity items together in one update or fix them along with a higher severity issue.

If you are able and would like this to be addressed in Ubuntu before then, please feel free to prepare a debdiff for the package by following https://wiki.ubuntu.com/SecurityTeam/UpdateProcedures#Preparing%20an%20update.

To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Other bug subscribers

Remote bug watches

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