首页 -> 安全研究

安全研究

安全漏洞
PuTTY/PSCP远程任意指令执行漏洞

发布日期:2004-08-04
更新日期:2004-08-09

受影响系统:
Simon Tatham PuTTY 0.54
Simon Tatham PuTTY 0.53b
Simon Tatham PuTTY 0.53
Simon Tatham PuTTY 0.48
Simon Tatham PuTTY 0.49
    - Microsoft Windows NT 4.0
    - Microsoft Windows 98
    - Microsoft Windows 95
    - Microsoft Windows 2000 SP3
不受影响系统:
Simon Tatham PuTTY 0.55
描述:
BUGTRAQ  ID: 10850
CVE(CAN) ID: CVE-2004-1440

PuTTY是一款免费的Telnet和SSH客户端实现,可使用在Win32平台下。

PuTTY在处理畸形包数据时存在问题,远程攻击者可以利用这个漏洞构建恶意服务器,诱使putty访问,可以用户进程权限在系统上执行任意指令。

Core Security小组发现putty存在一个严重问题。允许SSH2服务器在主机KEY验证之前攻击putty客户端。攻击者可以构建恶意SSH服务器,让putty用户连接时触发此漏洞。

攻击者可以修改OpenSSH 3.8.1p1来触发此漏洞,尤其是如下函数:

  packet_put_int
  packet_put_string
  packet_put_cstring
  packet_put_raw
  packet_put_bignum
  packet_put_bignum2

当PSCP被服务器验证,可发送特殊构建的大数值(服务器发送的"base"大数值)来触发,问题代码如下:

----------------------------------------------------------------------
/*
* Compute (base ^ exp) % mod.
* The base MUST be smaller than the modulus.
* The most significant word of mod MUST be non-zero.
* We assume that the result array is the same size as the mod array.
*/
Bignum modpow(Bignum base, Bignum exp, Bignum mod)
{
    BignumInt *a, *b, *n, *m;
    int mshift;
    int mlen, i, j;
    Bignum result;

    /* Allocate m of size mlen, copy mod to m */
    /* We use big endian internally */
    mlen = mod[0];

    [...]

    /* Allocate n of size mlen, copy base to n */
    n = snewn(mlen, BignumInt);
    i = mlen - base[0];
    for (j = 0; j < i; j++)
       n[j] = 0;
    for (j = 0; j < base[0]; j++)
       n[i + j] = base[base[0] - j];

    [...]
----------------------------------------------------------------------

在通常会话中,base小于modulus,但是没有对此进行正确检查。通过发送特殊构建的base,可触发缓冲区溢出。

另外PuTTY也存在此问题。

<*来源:Core Security Technologies
  
  链接:http://www.securitytracker.com/alerts/2004/Aug/1010849.html
        http://marc.theaimsgroup.com/?l=bugtraq&m=109167869528138&w=2
*>

建议:
厂商补丁:

Simon Tatham
------------
目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载putty 0.55版本:

http://www.chiark.greenend.org.uk/~sgtatham/putty/

浏览次数:3461
严重程度:0(网友投票)
本安全漏洞由绿盟科技翻译整理,版权所有,未经许可,不得转载
绿盟科技给您安全的保障