xfocus logo xfocus title
首页 焦点原创 安全文摘 安全工具 安全漏洞 焦点项目 焦点论坛 关于我们
English Version

OpenSSH Kerberos 4 TGT/AFS Token存在缓冲溢出漏洞


发布时间:2002-04-23
更新时间:2002-04-23
严重程度:
威胁程度:远程管理员权限
错误类型:边界检查错误
利用方式:服务器模式

BUGTRAQ ID:4560

受影响系统
OpenSSH OpenSSH 2.1
OpenSSH OpenSSH 2.1.1
   + Conectiva Linux 5.1
   + S.u.S.E. Linux 7.0 alpha
   + S.u.S.E. Linux 7.0 i386
   + S.u.S.E. Linux 7.0 ppc
   + S.u.S.E. Linux 7.0 sparc
OpenSSH OpenSSH 2.2
   + Conectiva Linux 6.0
   + NetBSD NetBSD 1.5
OpenSSH OpenSSH 2.3
   + EnGarde Secure Linux 1.0.1
   - S.u.S.E. Linux 6.4 alpha
   - S.u.S.E. Linux 6.4 i386
   - S.u.S.E. Linux 6.4 ppc
   - S.u.S.E. Linux 7.0 alpha
   - S.u.S.E. Linux 7.0 i386
   - S.u.S.E. Linux 7.0 ppc
   - S.u.S.E. Linux 7.0 sparc
OpenSSH OpenSSH 2.5
OpenSSH OpenSSH 2.5.1
   + NetBSD NetBSD 1.5.1
   - SCO Open Server 5.0
   - SCO Open Server 5.0.1
   - SCO Open Server 5.0.2
   - SCO Open Server 5.0.3
   - SCO Open Server 5.0.4
   - SCO Open Server 5.0.5
   - SCO Open Server 5.0.6
   - SCO Open Server 5.0.6 a
OpenSSH OpenSSH 2.5.2
   - Caldera OpenUnix 8.0
   - Caldera UnixWare 7.1.1
   - Wirex Immunix OS 6.2
OpenSSH OpenSSH 2.9 p2
   + Caldera OpenLinux Server 3.1
   + Caldera OpenLinux Server 3.1.1
   + Caldera OpenLinux Workstation 3.1
   + Caldera OpenLinux Workstation 3.1.1
   - Conectiva Linux ecommerce
   - Conectiva Linux graficas
   - Conectiva Linux 5.0
   + Conectiva Linux 7.0
   + FreeBSD FreeBSD 4.4 -RELENG
   + Immunix Immunix OS 7.0
   + MandrakeSoft Corporate Server 1.0.1
   + MandrakeSoft Linux Mandrake 7.1
   + MandrakeSoft Linux Mandrake 7.2
   + MandrakeSoft Linux Mandrake 8.0
   + MandrakeSoft Linux Mandrake 8.0 ppc
   + MandrakeSoft Linux Mandrake 8.1
   + MandrakeSoft Single Network Firewall 7.2
   + RedHat Linux 7.0
   + RedHat Linux 7.1
   + RedHat Linux 7.2
   - S.u.S.E. Linux 7.1 alpha
   - S.u.S.E. Linux 7.1 ppc
   - S.u.S.E. Linux 7.1 sparc
   - S.u.S.E. Linux 7.1 x86
   - S.u.S.E. Linux 7.2 i386
   - S.u.S.E. Linux 7.3 i386
   - S.u.S.E. Linux 7.3 ppc
   - S.u.S.E. Linux 7.3 sparc
   + Trustix Secure Linux 1.1
   + Trustix Secure Linux 1.2
   + Trustix Secure Linux 1.5
OpenSSH OpenSSH 2.9 p1
OpenSSH OpenSSH 2.9
OpenSSH OpenSSH 2.9.9
   + NetBSD NetBSD 1.5.2
OpenSSH OpenSSH 3.0.1
OpenSSH OpenSSH 3.0.2
   + FreeBSD FreeBSD 4.5 -RELEASE
   + FreeBSD FreeBSD 4.5 -STABLEpre2002-03-07
   + OpenPKG OpenPKG 1.0
OpenSSH OpenSSH 3.1
详细描述
如果在OpenSSH中的SSHD在编译的时候支持Kerberos/AFS并在sshd_config文件中支持KerberosTgtPassing 或者AFSTokenPassing,以上情况下,SSHD存在远程缓冲溢出,可导致获得ROOT权限,TICKET和TOKEN传递默认不允许。

测试代码
测试程序:

http://online.securityfocus.com/data/vulnerabilities/exploits/tgt-x86linux.tar

解决方案
采用如下补丁:OpenSSH OpenSSH 2.1:

Niels Provos Patch ossh-afs-krb4.patch
http://online.securityfocus.com/data/vulnerabilities/patches/vulnerabilities/patches/ossh-afs-krb4.patch

OpenSSH OpenSSH 2.1.1:

Niels Provos Patch ossh-afs-krb4.patch
http://online.securityfocus.com/data/vulnerabilities/patches/vulnerabilities/patches/ossh-afs-krb4.patch

OpenSSH OpenSSH 2.2:

Niels Provos Patch ossh-afs-krb4.patch
http://online.securityfocus.com/data/vulnerabilities/patches/vulnerabilities/patches/ossh-afs-krb4.patch

OpenSSH OpenSSH 2.3:

Niels Provos Patch ossh-afs-krb4.patch
http://online.securityfocus.com/data/vulnerabilities/patches/vulnerabilities/patches/ossh-afs-krb4.patch

OpenSSH OpenSSH 2.5:

Niels Provos Patch ossh-afs-krb4.patch
http://online.securityfocus.com/data/vulnerabilities/patches/vulnerabilities/patches/ossh-afs-krb4.patch

OpenSSH OpenSSH 2.5.1:

Niels Provos Patch ossh-afs-krb4.patch
http://online.securityfocus.com/data/vulnerabilities/patches/vulnerabilities/patches/ossh-afs-krb4.patch

OpenSSH OpenSSH 2.5.2:

Niels Provos Patch ossh-afs-krb4.patch
http://online.securityfocus.com/data/vulnerabilities/patches/vulnerabilities/patches/ossh-afs-krb4.patch

OpenSSH OpenSSH 2.9 p2:

Niels Provos Patch ossh-afs-krb4.patch
http://online.securityfocus.com/data/vulnerabilities/patches/vulnerabilities/patches/ossh-afs-krb4.patch

OpenSSH OpenSSH 2.9 p1:

Niels Provos Patch ossh-afs-krb4.patch
http://online.securityfocus.com/data/vulnerabilities/patches/vulnerabilities/patches/ossh-afs-krb4.patch

OpenSSH OpenSSH 2.9:

Niels Provos Patch ossh-afs-krb4.patch
http://online.securityfocus.com/data/vulnerabilities/patches/vulnerabilities/patches/ossh-afs-krb4.patch

OpenSSH OpenSSH 2.9.9:

Niels Provos Patch ossh-afs-krb4.patch
http://online.securityfocus.com/data/vulnerabilities/patches/vulnerabilities/patches/ossh-afs-krb4.patch

OpenSSH OpenSSH 3.0.1:

Niels Provos Patch ossh-afs-krb4.patch
http://online.securityfocus.com/data/vulnerabilities/patches/vulnerabilities/patches/ossh-afs-krb4.patch

OpenSSH OpenSSH 3.0.2:

Niels Provos Patch ossh-afs-krb4.patch
http://online.securityfocus.com/data/vulnerabilities/patches/vulnerabilities/patches/ossh-afs-krb4.patch

OpenSSH OpenSSH 3.1:

Niels Provos Patch ossh-afs-krb4.patch
http://online.securityfocus.com/data/vulnerabilities/patches/vulnerabilities/patches/ossh-afs-krb4.patch



Index: bufaux.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/bufaux.c,v
retrieving revision 1.24
diff -u -r1.24 bufaux.c
--- bufaux.c    26 Mar 2002 15:23:40 -0000    1.24
+++ bufaux.c    19 Apr 2002 12:55:29 -0000
@@ -137,10 +137,18 @@
    BN_bin2bn(bin, len, value);
    xfree(bin);
}
-
/*
- * Returns an integer from the buffer (4 bytes, msb first).
+ * Returns integers from the buffer (msb first).
  */
+
+u_short
+buffer_get_short(Buffer *buffer)
+{
+    u_char buf[2];
+    buffer_get(buffer, (char *) buf, 2);
+    return GET_16BIT(buf);
+}
+
u_int
buffer_get_int(Buffer *buffer)
{
@@ -158,8 +166,16 @@
}

/*
- * Stores an integer in the buffer in 4 bytes, msb first.
+ * Stores integers in the buffer, msb first.
  */
+void
+buffer_put_short(Buffer *buffer, u_short value)
+{
+    char buf[2];
+    PUT_16BIT(buf, value);
+    buffer_append(buffer, buf, 2);
+}
+
void
buffer_put_int(Buffer *buffer, u_int value)
{
Index: bufaux.h
===================================================================
RCS file: /cvs/src/usr.bin/ssh/bufaux.h,v
retrieving revision 1.17
diff -u -r1.17 bufaux.h
--- bufaux.h    18 Mar 2002 17:25:29 -0000    1.17
+++ bufaux.h    19 Apr 2002 12:55:56 -0000
@@ -23,6 +23,9 @@
void    buffer_get_bignum(Buffer *, BIGNUM *);
void    buffer_get_bignum2(Buffer *, BIGNUM *);

+u_short    buffer_get_short(Buffer *);
+void    buffer_put_short(Buffer *, u_short);
+
u_int    buffer_get_int(Buffer *);
void    buffer_put_int(Buffer *, u_int);

相关信息
参考:kurt@seifried.org
http://mantra.freeweb.hu/