Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 231292 - <net-misc/openssh-5.1_p1-r1 do_authloop() Format String Privilege Escalation
Summary: <net-misc/openssh-5.1_p1-r1 do_authloop() Format String Privilege Escalation
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Gentoo Security
URL: http://article.gmane.org/gmane.comp.s...
Whiteboard: A1 [glsa]
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-09 12:21 UTC by Matthias Geerdsen (RETIRED)
Modified: 2014-05-11 13:56 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
openssh-auth1.c-formatstring.patch (openssh-auth1.c-formatstring.patch,628 bytes, patch)
2008-07-09 16:35 UTC, Robert Buchholz (RETIRED)
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Geerdsen (RETIRED) gentoo-dev 2008-07-09 12:21:18 UTC
quick copy and paste before I forget...

bannedit pointed us to the following post on f-d:


Mrdkaaa Security Advisory 080709-001

Package : OpenSSH
Date    : July 09, 2008

1. Details

[openssh-5.0p1/auth1.c]

   234  static void
   235  do_authloop(Authctxt *authctxt)

   345                          len = buffer_len(&loginmsg);
   346                          buffer_append(&loginmsg, "\0", 1);
   347                          msg = buffer_ptr(&loginmsg);

   354                          packet_disconnect(msg);

[openssh-5.0p1/packet.c]

  1377  void
  1378  packet_disconnect(const char *fmt,...)

  1392          va_start(args, fmt);
  1393          vsnprintf(buf, sizeof(buf), fmt, args);
  1394          va_end(args);

2. Analysis

  100% lame

3. Detection

  -rwsr-sr-x 1 root root 678832 2008-07-09 03:47 /tmp/sh
  root     pts/1    1.3.3.7          03:48    0.00s  0.00s  0.00s /tmp/sh

[...]
Comment 1 Tomas Hoger 2008-07-09 13:45:48 UTC
According to upstream discussion, this requires fairly crafted conditions:

http://marc.info/?l=openssh-unix-dev&m=121560026002907&w=2
Comment 2 Robert Buchholz (RETIRED) gentoo-dev 2008-07-09 16:35:20 UTC
Created attachment 159960 [details, diff]
openssh-auth1.c-formatstring.patch

djm committed this patch upstream.

We have "UsePrivilegeSeparation" default to "yes" by default, and I do not know all our PAM modules, and if any of them would allow output of attacker-controlled data.
Comment 3 Pierre-Yves Rofes (RETIRED) gentoo-dev 2008-09-19 21:14:34 UTC
What's the status here? Which version includes the patch? If we have a stable version in the tree, I'd be in favor of bypassing the policy and closing this one without GLSA, due to the extremely unlikely conditions required to exploit this.
Comment 4 SpanKY gentoo-dev 2008-10-26 07:24:07 UTC
openssh-5.1_p1 has the fix already ... i'm not aware of any regressions specific to that version, so stabilizing it should be OK ...
Comment 5 Christian Hoffmann (RETIRED) gentoo-dev 2008-10-26 11:26:37 UTC
Thanks. So, let's get this stable.

Arches, please test and stabilize:
  =net-misc/openssh-5.1_p1-r1
Target keywords: alpha amd64 arm hppa ia64 m68k ppc ppc64 s390 sh sparc x86

I'm assuming that vapier is OK with -r1 being stabled, according to ChangeLog it's just a fix for a build-time warning though (bug 235594).
Comment 6 Markus Meier gentoo-dev 2008-10-26 18:34:56 UTC
amd64/x86 stable
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2008-10-26 23:34:30 UTC
Stable for HPPA.
Comment 8 Brent Baude (RETIRED) gentoo-dev 2008-10-27 19:58:51 UTC
ppc64 done
Comment 9 Raúl Porcel (RETIRED) gentoo-dev 2008-10-30 09:52:47 UTC
alpha/ia64/sparc stable
Comment 10 Brent Baude (RETIRED) gentoo-dev 2008-10-30 15:35:22 UTC
ppc done
Comment 11 Tobias Heinlein (RETIRED) gentoo-dev 2008-11-05 08:47:15 UTC
(In reply to comment #3)
> What's the status here? Which version includes the patch? If we have a stable
> version in the tree, I'd be in favor of bypassing the policy and closing this
> one without GLSA, due to the extremely unlikely conditions required to exploit
> this.
> 

Actually I'd still like to send a GLSA. Request filed, I'll draft it then.
Comment 12 GLSAMaker/CVETool Bot gentoo-dev 2014-05-11 13:56:26 UTC
This issue was resolved and addressed in
 GLSA 201405-06 at http://security.gentoo.org/glsa/glsa-201405-06.xml
by GLSA coordinator Mikle Kolyada (Zlogene).