Vulnerabilities > CVE-2007-5397 - Improper Restriction of Operations Within the Bounds of A Memory Buffer vulnerability in Activepdf Server

047910
CVSS 7.5 - HIGH
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
PARTIAL
Integrity impact
PARTIAL
Availability impact
PARTIAL
network
low complexity
activepdf
CWE-119
nessus

Summary

Heap-based buffer overflow in the activePDF Server service (aka APServer.exe) in activePDF Server 3.8.4 and 3.8.5.14, and possibly other versions before 3.8.6.16, allows remote attackers to execute arbitrary code via a packet with a size field that is less than the actual size of the data.

Vulnerable Configurations

Part Description Count
Application
Activepdf
1

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Buffer Overflow via Environment Variables
    This attack pattern involves causing a buffer overflow through manipulation of environment variables. Once the attacker finds that they can modify an environment variable, they may try to overflow associated buffers. This attack leverages implicit trust often placed in environment variables.
  • Overflow Buffers
    Buffer Overflow attacks target improper or missing bounds checking on buffer operations, typically triggered by input injected by an attacker. As a consequence, an attacker is able to write past the boundaries of allocated buffer regions in memory, causing a program crash or potentially redirection of execution as per the attackers' choice.
  • Client-side Injection-induced Buffer Overflow
    This type of attack exploits a buffer overflow vulnerability in targeted client software through injection of malicious content from a custom-built hostile service.
  • Filter Failure through Buffer Overflow
    In this attack, the idea is to cause an active filter to fail by causing an oversized transaction. An attacker may try to feed overly long input strings to the program in an attempt to overwhelm the filter (by causing a buffer overflow) and hoping that the filter does not fail securely (i.e. the user input is let into the system unfiltered).
  • MIME Conversion
    An attacker exploits a weakness in the MIME conversion routine to cause a buffer overflow and gain control over the mail server machine. The MIME system is designed to allow various different information formats to be interpreted and sent via e-mail. Attack points exist when data are converted to MIME compatible format and back.

Nessus

  • NASL familyWindows
    NASL idACTIVEPDF_3_8_6_LOCAL.NASL
    descriptionactivePDF Server is installed on the remote host. It is used to provide PDF generation and conversion from within enterprise and web applications. The version of activePDF Server installed on the remote host contains a heap-based buffer overflow that can be triggered by sending a packet specifying a size smaller than the actual size of the following data. An unauthenticated, remote attacker may be able to leverage this issue to crash the affected service or execute arbitrary code. Note that the service runs with SYSTEM privileges, so successful exploitation could lead to a complete compromise of the affected host.
    last seen2020-06-01
    modified2020-06-02
    plugin id31350
    published2008-03-05
    reporterThis script is Copyright (C) 2008-2018 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/31350
    titleactivePDF Server < 3.8.6 Packet Handling Remote Overflow (credentialed check)
    code
    #
    #  (C) Tenable Network Security, Inc.
    #
    
    
    include("compat.inc");
    
    if (description)
    {
      script_id(31350);
      script_version("1.17");
     script_cvs_date("Date: 2018/11/15 20:50:26");
    
      script_cve_id("CVE-2007-5397");
      script_bugtraq_id(28013);
      script_xref(name:"Secunia", value:"27371");
    
      script_name(english:"activePDF Server < 3.8.6 Packet Handling Remote Overflow (credentialed check)");
      script_summary(english:"Checks version of APServer.exe");
    
     script_set_attribute(attribute:"synopsis", value:
    "The remote Windows host contains a program that is affected by a
    buffer overflow vulnerability.");
     script_set_attribute(attribute:"description", value:
    "activePDF Server is installed on the remote host. It is used to
    provide PDF generation and conversion from within enterprise and web
    applications.
    
    The version of activePDF Server installed on the remote host contains
    a heap-based buffer overflow that can be triggered by sending a packet
    specifying a size smaller than the actual size of the following data.
    An unauthenticated, remote attacker may be able to leverage this issue
    to crash the affected service or execute arbitrary code.
    
    Note that the service runs with SYSTEM privileges, so successful
    exploitation could lead to a complete compromise of the affected host.");
     script_set_attribute(attribute:"see_also", value:"https://secuniaresearch.flexerasoftware.com/secunia_research/2007-87/advisory");
     script_set_attribute(attribute:"see_also", value:"http://www.activepdf.com/support/knowledgebase/viewKb.cfm?fs=1&ID=11744" );
     script_set_attribute(attribute:"solution", value:
    "Upgrade to activePDF version 3.8.6 or later and make sure the file
    version for the affected file is 3.8.6.15 or later.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:C/I:C/A:C");
      script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C");
      script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"false");
     script_cwe_id(119);
    
     script_set_attribute(attribute:"plugin_publication_date", value:"2008/03/05");
    
    script_set_attribute(attribute:"plugin_type", value:"local");
    script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_family(english:"Windows");
      script_copyright(english:"This script is Copyright (C) 2008-2018 Tenable Network Security, Inc.");
      script_dependencies("smb_hotfixes.nasl");
      script_require_keys("SMB/Registry/Enumerated");
      script_require_ports(139, 445);
      exit(0);
    }
    
    #
    
    include("global_settings.inc");
    include("smb_func.inc");
    
    if (!get_kb_item("SMB/Registry/Enumerated")) exit(0);
    
    
    # Connect to the appropriate share.
    name    =  kb_smb_name();
    port    =  kb_smb_transport();
    #if (!get_port_state(port)) exit(0);
    login   =  kb_smb_login();
    pass    =  kb_smb_password();
    domain  =  kb_smb_domain();
    
    #soc = open_sock_tcp(port);
    #if (!soc) exit(0);
    
    #session_init(socket:soc, hostname:name);
    
    if (!smb_session_init()) exit(0);
    
    rc = NetUseAdd(login:login, password:pass, domain:domain, share:"IPC$");
    if (rc != 1) {
      NetUseDel();
      exit(0);
    }
    
    
    # Connect to remote registry.
    hklm = RegConnectRegistry(hkey:HKEY_LOCAL_MACHINE);
    if (isnull(hklm))
    {
      NetUseDel();
      exit(0);
    }
    
    
    # Make sure it's installed.
    exe = NULL;
    
    key = "SYSTEM\CurrentControlSet\Services\A4ACTIVEPDFSERVER";
    key_h = RegOpenKey(handle:hklm, key:key, mode:MAXIMUM_ALLOWED);
    if (!isnull(key_h))
    {
      value = RegQueryValue(handle:key_h, item:"ImagePath");
      if (!isnull(value)) exe = value[1];
    
      RegCloseKey(handle:key_h);
    }
    RegCloseKey(handle:hklm);
    if (isnull(exe))
    {
      NetUseDel();
      exit(0);
    }
    
    
    # Grab the file version of the affected file.
    share = ereg_replace(pattern:"^([A-Za-z]):.*", replace:"\1$", string:exe);
    exe2 =  ereg_replace(pattern:"^[A-Za-z]:(.*)", replace:"\1", string:exe);
    NetUseDel(close:FALSE);
    
    rc = NetUseAdd(login:login, password:pass, domain:domain, share:share);
    if (rc != 1)
    {
      NetUseDel();
      exit(0);
    }
    
    fh = CreateFile(
      file:exe2,
      desired_access:GENERIC_READ,
      file_attributes:FILE_ATTRIBUTE_NORMAL,
      share_mode:FILE_SHARE_READ,
      create_disposition:OPEN_EXISTING
    );
    ver = NULL;
    if (!isnull(fh))
    {
      ver = GetFileVersion(handle:fh);
      CloseFile(handle:fh);
    }
    NetUseDel();
    
    
    # Check the version number.
    if (!isnull(ver))
    {
      # nb: while the release notes talk of 3.8.6.16, that appears to
      #     be a mistake -- the release of 3.8.6 on 28-Feb-2008 was
      #     3.8.6.15. And testing shows it fixes the problem. The
      #     previous release was 3.8.5, which was affected.
      fix = split("3.8.6.15", sep:'.', keep:FALSE);
      for (i=0; i<max_index(fix); i++)
        fix[i] = int(fix[i]);
    
      for (i=0; i<max_index(ver); i++)
        if ((ver[i] < fix[i]))
        {
          # nb: the file version isn't always up-to-date so I won't report it.
          security_hole(port);
          break;
        }
        else if (ver[i] > fix[i])
          break;
    }
    
  • NASL familyWindows
    NASL idACTIVEPDF_3_8_6.NASL
    descriptionactivePDF Server is installed on the remote host. It is used to provide PDF generation and conversion from within enterprise and web applications. The version of activePDF Server installed on the remote host contains a heap-based buffer overflow that can be triggered by sending a packet specifying a size smaller than the actual size of the following data. An unauthenticated, remote attacker may be able to leverage this issue to crash the affected service or execute arbitrary code. Note that the service runs with SYSTEM privileges, so successful exploitation could lead to a complete compromise of the affected host.
    last seen2020-06-01
    modified2020-06-02
    plugin id31349
    published2008-03-05
    reporterThis script is Copyright (C) 2008-2018 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/31349
    titleactivePDF Server < 3.8.6 Packet Handling Remote Overflow

Seebug

bulletinFamilyexploit
descriptionBUGTRAQ ID: 28013 CVE(CAN) ID: CVE-2007-5397 activePDF服务器用于为企业或Web应用提供集成的PDF生成和动态PDF转换功能。 activePDF Server服务(APServer.exe)在处理畸形客户端数据时存在堆溢出漏洞,远程攻击者可能利用此漏洞控制服务器。 如果用户连接到了该服务(默认端口53535/TCP)并在发送的报文中指定的大小小于之后数据的实际大小的话,就可能触发这个溢出,导致执行任意指令。 activePDF activePDF 3.8.5.14 activePDF activePDF 3.8.4 厂商补丁: activePDF --------- 目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载: <a href=http://www.activepdf.com/products/serverproducts/server/index.cfm target=_blank>http://www.activepdf.com/products/serverproducts/server/index.cfm</a>
idSSV:2965
last seen2017-11-19
modified2008-03-01
published2008-03-01
reporterRoot
titleactivePDF服务器报文处理远程堆溢出漏洞