Summary: | mail-client/mutt <= 1.5.12 temp file issue (CVE-2006-529[78]) | ||||||
---|---|---|---|---|---|---|---|
Product: | Gentoo Security | Reporter: | Sune Kloppenborg Jeppesen (RETIRED) <jaervosz> | ||||
Component: | Vulnerabilities | Assignee: | Gentoo Security <security> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | normal | CC: | agriffis, ferdy, net-mail+disabled | ||||
Priority: | High | ||||||
Version: | unspecified | ||||||
Hardware: | All | ||||||
OS: | Linux | ||||||
URL: | http://marc.theaimsgroup.com/?l=mutt-dev&m=115999486426292&w=2 | ||||||
Whiteboard: | B? [noglsa] vorlon | ||||||
Package list: | Runtime testing required: | --- | |||||
Bug Depends on: | 178003 | ||||||
Bug Blocks: | |||||||
Attachments: |
|
Description
Sune Kloppenborg Jeppesen (RETIRED)
![]() OWL has a large patch reworking tmp file handling in mutt: http://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/mutt/mutt-1.4.2.1-owl-tmp.diff opening the bug since the mail can be found at <http://marc.theaimsgroup.com/?l=mutt-dev&m=115999486426292&w=2> <http://secunia.com/advisories/22613/> CC'ing maintainers Ubuntu announcement can be found at http://www.ubuntu.com/usn/usn-373-1 so there should be patches available too Pulling in herd for advise/bumping. Ok, I've digged in the recent mutt commits and the only reference to temp files / security is the attached one. I'll apply it later today if any of you can ACK the patch. - ferdy Created attachment 102446 [details, diff]
paranoid-temp-file.patch
Proposed patch from upstream.
That patch is being applied in mail-client/mutt-1.5.13-r2. If it is not enough to fix this bug please state so and I'll try to get in touch with upstream. - ferdy Vorlon is this patch enough? could someone pls verify the patch? (tavis/...?) mutt-1.5.14 is in the tree now (with this patch included too). I haven't seen more patches related to this bug. Is this bug still considered valid? Do I have to do anything else? - ferdy Tavis please advise. Tavis please advise. Tavis please advise. Tavis please advise. > char tmpfile[POSIX_PATH_MAX] = "/tmp/muttXXXXXX";
> char tmpfile2[POSIX_PATH_MAX];
> char *extension = "foo";
> // mkstemp should come first
> fd = mkstemp(tmpfile);
> sprintf(tmpfile2, "%s.%s", tmpfile, extension);
> rename(tmpfile, tmpfile2);
rename() is not vulnerable to a symlink attack, unlike open(). The race conditions explained in the mail needs other successful attacks, or administrator misconfigurations. Non-issue for me.
For the O_EXCL which doesn't work on NFS, that may be a weakness, but this would affect all other apps using O_EXCL. It's not mutt specific and it can't simply be solved. Furthermore, /tmp on a NFS... sounds... eccentric. (why not, but in that case it is also a misconfiguration since that will affect many applications). Non-issue for me.
I'm an addicted mutt user and despite of that, I think we can close this bug as Invalid.
mmm after a deeper look to the mailing list, the syscall to rename() should be checked (return value equals 0 or -1). Indeed, if the files are: -rw------- 1 falco falco 0 Jun 9 23:46 muttjlNOGW -rw-r--r-- 1 foo foo 5 Jun 9 23:46 muttjlNOGW.foo Then the rename() call fails, mutt continues, and read/write from/to the crafted muttjlNOGW.foo file. Yes, that's a bug (another user could view the mails). Not a security issue (DoS, code exec, or so). according to the CVE refs, this affects versions 1.5.12 and earlier, and we have version .13 stable and versions .14 and .15 unstable in the tree, so what should we do here? Ferdy/Aggrifis/net-mail, please advise. I just commited mutt-1.5.16. There is no point in stabling .15 so I'd go for .16 myself once arch people deem it appropiate. We can start removing vulnerable unused versions though. - ferdy Handling stable marking on bug #178003 finally closing without GLSA wrt the discussion on bug 178003, feel free to reopen if you disagree. |