LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-06-2009, 09:57 AM   #1
Mreimer
LQ Newbie
 
Registered: Jan 2009
Posts: 3

Rep: Reputation: 1
Exclamation Possible hole caused by default /etc/mailcap in Slackware 12.2


Hello,

Slackware 12.2 comes with a /etc/mailcap file, which forwards some mime-types to xdg-open.

The /etc/mailcap file is used by Firefox and other Mozilla-based software, to detect the default application, for viewing this kind of file.

xdg-open is made to detect the default viewing application, based on the settings in the window manager.

By spoofing the mime-type of a "dangerous" file, this makes it easy for an attacker to get this file executed. Firefox gets told by the webserver, that a PDF file has to be viewed and offers to open it with xdg-open. If the user clicks "OK" (and many users won't have a closer look at the filename of the document!), then xdg-open now detects the real content-type and executes the .desktop file.

It would be even possible to deliver and open a "real" PDF file in a second stage, so the user never knows that he got fooled.

I've written a demonstration page for the case "application/pdf used for .desktop file". Other combinations would be possible!

http://prefbar.mozdev.org/testxdgopen.html

Recommended workaround: Delete /etc/mailcap and get sure it stays deleted. It gets recreated with any reinstall or update of the xdg-utils package, so maybe it would be a good idea to uninstall this package!

For people, which have their own custom mailcap file: Have a look at your /etc/mailcap file! The xdg-utils package adds the probably dangerous items without telling the user about the change!

I already sent a short mail to security(at)slackware.com, three days ago, in hope this will be fixed.

Last edited by Mreimer; 01-06-2009 at 10:44 AM.
 
Old 01-06-2009, 10:18 AM   #2
sahko
Senior Member
 
Registered: Sep 2008
Distribution: Slackware
Posts: 1,041

Rep: Reputation: Disabled
I would rather recommend not installing xdg-utils.
The mailcap file is far more important than it.
 
Old 01-06-2009, 10:37 AM   #3
Mreimer
LQ Newbie
 
Registered: Jan 2009
Posts: 3

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by sahko View Post
I would rather recommend not installing xdg-utils.
The mailcap file is far more important than it.
The mailcap file is created by the xdg-utils package, in slackware 12.2, and it only contains the items, pointing some types to xdg-open. If someone has a self-created mailcap file, then he should have a look at it, after updating to Slackware 12.2! The xdg-utils package adds the probably dangerous items to this file, without telling the user about this change. Those people, who never touched "/etc/mailcap", may delete it or move it to mailcap.off.
 
Old 01-06-2009, 10:54 AM   #4
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018
Thanks for the heads-up Mreimer. Today was the first time I'd ever looked at the xdg-utils stuff after being curious about statguy's Thunderbird topic. My gut reaction was to dislike the entire xdg/mime setup completely, but I hadn't considered the security implications. I think I'll just yank the whole thing out of my box, see what it breaks and take it from there.
 
Old 01-06-2009, 11:40 AM   #5
sahko
Senior Member
 
Registered: Sep 2008
Distribution: Slackware
Posts: 1,041

Rep: Reputation: Disabled
Quote:
Originally Posted by Mreimer View Post
The mailcap file is created by the xdg-utils package, in slackware 12.2, and it only contains the items, pointing some types to xdg-open.
Oh that would explain why i aint got one. Thanks.
 
Old 01-06-2009, 11:51 AM   #6
Chuck56
Member
 
Registered: Dec 2006
Location: Colorado, USA
Distribution: Slackware
Posts: 930

Rep: Reputation: 479Reputation: 479Reputation: 479Reputation: 479Reputation: 479
Is this the same year old vulnerability that applies to xfg-utils-1.0.2-r1?

http://seclists.org/fulldisclosure/2008/Jan/0591.html

Slackware 12.2 uses xdg-utils-1.0.2 which appears to be a later release.
 
Old 01-06-2009, 12:51 PM   #7
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
And anyone still thinks Manuel Reimer has a love for Slackware? If you find out a potential vulnerability you mention this to the party responsible for fixing it (in this case Pat V. of Slackware, Inc.) and make sure the hole gets patched before running around yelling "FIRE FIRE". See this external bug tracker, ##slackware IRC channel and now on this public forum. Full disclosure is the disgrace of the person revealing the issue without giving the distro or the software developer a chance to do something about it.

Eric
 
Old 01-06-2009, 01:40 PM   #8
Mreimer
LQ Newbie
 
Registered: Jan 2009
Posts: 3

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by Alien Bob View Post
And anyone still thinks Manuel Reimer has a love for Slackware?
I think so, others may have a different opinion.

I'm no professional security researcher! So far, I only read advisories, but didn't know how they are created.

The first thing of all, I did, was to mail Patrick, but I also wanted to tell the freedesktop.org-Team about the hole, as I was unsure how many distributions really use xdg-open in their mailcap file. I hoped they could publish a security advisory and so to inform all relevant distributions. That was the reason for the bug report.

It definetly was a bad idea to post to this forum. The post resulted from the fact, that freedesktop.org publishes bugs, even when marked with "security". And so the exploit was out in the wild. So my next thought was: Try to tell as much users as possible about the issue, so they can fix their systems. Yes, a silly idea.

I vote for immediately deleting this topic as soon as possible. I already mailed the forum webmaster, but if someone else is able to lock this thread, please do so.
 
Old 01-06-2009, 03:38 PM   #9
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
Nobody should delete anything. I object to deleting relevant information.
 
Old 01-06-2009, 03:54 PM   #10
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018
I'm still grateful to Manuel for making me aware of the issue. Whatever your opinion of the pros and cons of full disclosure, the simple fact is that my system is now secure thanks to Manuel making me aware of the problem, allowing me to take remedial steps until an official update comes out.

Now, if there was no way to mitigate the issue, then that would be an entirely different thing and needs to be handled more carefully.

Reading Manuel's original post, he did say that he reported the problem to security@slackware.com three days ago. If the team wished him to keep it quiet in order to give them time to work on it, it would appear that they've had a couple of days in which to ask him to do so. It really doesn't seem fair to portray him as the devil here. Looks more like a failure to communicate than anything else.
 
Old 01-06-2009, 04:22 PM   #11
chess
Member
 
Registered: Mar 2002
Location: 127.0.0.1
Distribution: Slackware and OpenBSD
Posts: 740

Rep: Reputation: 190Reputation: 190
Quote:
Originally Posted by GazL View Post
Reading Manuel's original post, he did say that he reported the problem to security@slackware.com three days ago. If the team wished him to keep it quiet in order to give them time to work on it, it would appear that they've had a couple of days in which to ask him to do so.
That might be true except for the fact that I'm not sure he even gave Pat and the Slackware Security Team 24 hours between Saturday and Sunday to respond before going public.

If, as you say, he reported it three days ago, that would have been Saturday, January 3. It seems Manuel posted about this issue on a.o.l.s[1] and in some random forum[2] on Sunday, January 4.

Not even giving Pat and the Slackware Security Team 24 hours to respond, much less over a weekend, before publicly posting all over the internet seems to be jumping the gun a bit.



[1] http://groups.google.com/group/alt.o...76d36498e88a6#

[2] http://www.jlaforums.com/viewtopic.php?t=6396497
 
Old 01-06-2009, 04:45 PM   #12
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018
Quote:
Originally Posted by chess View Post
That might be true except for the fact that I'm not sure he even gave Pat and the Slackware Security Team 24 hours between Saturday and Sunday to respond before going public.

If, as you say, he reported it three days ago, that would have been Saturday, January 3. It seems Manuel posted about this issue on a.o.l.s[1] and in some random forum[2] on Sunday, January 4.

Not even giving Pat and the Slackware Security Team 24 hours to respond, much less over a weekend, before publicly posting all over the internet seems to be jumping the gun a bit.



[1] http://groups.google.com/group/alt.o...76d36498e88a6#

[2] http://www.jlaforums.com/viewtopic.php?t=6396497

I still have mixed feelings on the issue of disclosure, I can see both sides of the argument, but yes, if he didn't give the team a chance to respond at all then that's different.
 
Old 01-06-2009, 04:58 PM   #13
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Mreimer View Post
I only read advisories, but didn't know how they are created.
You might want to get an idea from ye aulde RFP Labs Full Disclosure Policy (RFPolicy) v2.0?


Quote:
Originally Posted by Mreimer View Post
It definetly was a bad idea to post to this forum.
No it isn't. Apart from debatable timing issues anyone disagreeing could do worse than zazen with Schneier's Full Disclosure of Security Vulnerabilities a 'Damned Good Idea': "I much prefer a world where I have all the information I need to assess and protect my own security." Full Disclosure just requires following a guideline. All it means is you promise to tell everybody (no exceptions) everything (no exceptions) for the benefit of all (no exceptions). But it's a guideline. So it's all voluntary.


Quote:
Originally Posted by Mreimer View Post
I vote for immediately deleting this topic as soon as possible. I already mailed the forum webmaster, but if someone else is able to lock this thread, please do so.
Unless content adversely affects the good LQ atmosphere or violates the LQ Rules I see no reason to close this thread.
 
Old 01-07-2009, 10:03 PM   #14
shadowsnipes
Senior Member
 
Registered: Sep 2005
Distribution: Slackware
Posts: 1,443

Rep: Reputation: 73
Thanks for the notice about this. It really isn't smart to have xdg-open used in a mailcap file. It doesn't just affect mozilla apps; It affects double clicking on files in file managers (such as dolphin) as well. You don't need to remove /etc/mailcap, however; Just comment out or delete the xdg-open entries.

Granted, I think it is foolish to assume that a file is a what file extension says it is (if there is one). Even if it is a .gif file, it could have a zip file or mp3 embedded in it and so on. But at least if your mailcap file specifies a good app for a mime type, then that app can just crash and burn when it discovers that the file you are trying to load isn't really what it extension says it is. Of course, depending on how it crashes you could have another security hole (specific to the application). The important thing for people to do is to first have some good sense on who/where they download files from and how they check if they are good. Overall layered System security is always a must as well.

Perhaps a good approach for Slackware would be to ship good mailcap file with everything commented out. What I mean by "good mailcap file" is to include mimetype handlers for most common extensions with programs to handle them that are included in Slackware. The admin can then just uncomment the ones they like/change them. This would probably be easier for people than creating the file from a blank slate, yet it still keeps Slackware "vanilla" fresh from the install.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rox and mailcap merchtemeagle Slackware 0 06-01-2006 07:28 PM
file mailcap prob... khuti2005 Linux - Newbie 0 10-13-2005 07:21 AM
/etc/mailcap not there nomad438 Slackware 3 07-05-2004 03:25 PM
setting default samba server to on caused boot hang (suse 9) memphisSuseUser Linux - Software 1 02-15-2004 10:35 AM
Slackware 9.1, rescue disk, security hole? luis002001 Linux - Security 5 10-17-2003 11:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration