gsd-2023-40586
Vulnerability from gsd
Modified
2023-12-13 01:20
Details
OWASP Coraza WAF is a golang modsecurity compatible web application firewall library. Due to the misuse of `log.Fatalf`, the application using coraza crashed after receiving crafted requests from attackers. The application will immediately crash after receiving a malicious request that triggers an error in `mime.ParseMediaType`. This issue was patched in version 3.0.1.
Aliases
Aliases
{ "GSD": { "alias": "CVE-2023-40586", "id": "GSD-2023-40586" }, "gsd": { "metadata": { "exploitCode": "unknown", "remediation": "unknown", "reportConfidence": "confirmed", "type": "vulnerability" }, "osvSchema": { "aliases": [ "CVE-2023-40586" ], "details": "OWASP Coraza WAF is a golang modsecurity compatible web application firewall library. Due to the misuse of `log.Fatalf`, the application using coraza crashed after receiving crafted requests from attackers. The application will immediately crash after receiving a malicious request that triggers an error in `mime.ParseMediaType`. This issue was patched in version 3.0.1.\n", "id": "GSD-2023-40586", "modified": "2023-12-13T01:20:44.016715Z", "schema_version": "1.4.0" } }, "namespaces": { "cve.org": { "CVE_data_meta": { "ASSIGNER": "security-advisories@github.com", "ID": "CVE-2023-40586", "STATE": "PUBLIC" }, "affects": { "vendor": { "vendor_data": [ { "product": { "product_data": [ { "product_name": "coraza", "version": { "version_data": [ { "version_affected": "=", "version_value": "\u003c 3.0.1" } ] } } ] }, "vendor_name": "corazawaf" } ] } }, "data_format": "MITRE", "data_type": "CVE", "data_version": "4.0", "description": { "description_data": [ { "lang": "eng", "value": "OWASP Coraza WAF is a golang modsecurity compatible web application firewall library. Due to the misuse of `log.Fatalf`, the application using coraza crashed after receiving crafted requests from attackers. The application will immediately crash after receiving a malicious request that triggers an error in `mime.ParseMediaType`. This issue was patched in version 3.0.1.\n" } ] }, "impact": { "cvss": [ { "attackComplexity": "LOW", "attackVector": "NETWORK", "availabilityImpact": "HIGH", "baseScore": 7.5, "baseSeverity": "HIGH", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "privilegesRequired": "NONE", "scope": "UNCHANGED", "userInteraction": "NONE", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "version": "3.1" } ] }, "problemtype": { "problemtype_data": [ { "description": [ { "cweId": "CWE-400", "lang": "eng", "value": "CWE-400: Uncontrolled Resource Consumption" } ] } ] }, "references": { "reference_data": [ { "name": "https://github.com/corazawaf/coraza/security/advisories/GHSA-c2pj-v37r-2p6h", "refsource": "MISC", "url": "https://github.com/corazawaf/coraza/security/advisories/GHSA-c2pj-v37r-2p6h" }, { "name": "https://github.com/corazawaf/coraza/commit/a5239ba3ce839e14d9b4f9486e1b4a403dcade8c", "refsource": "MISC", "url": "https://github.com/corazawaf/coraza/commit/a5239ba3ce839e14d9b4f9486e1b4a403dcade8c" } ] }, "source": { "advisory": "GHSA-c2pj-v37r-2p6h", "discovery": "UNKNOWN" } }, "gitlab.com": { "advisories": [ { "affected_range": "\u003e=v2.0.0 \u003c=v2.0.1", "affected_versions": "All versions starting from 2.0.0 up to 2.0.1", "cwe_ids": [ "CWE-1035", "CWE-400", "CWE-937" ], "date": "2023-08-25", "description": "### Summary\n\nDue to the misuse of `log.Fatalf`, the application using coraza crashed after receiving crafted requests from attackers.\n\n### Details\n\n https://github.com/corazawaf/coraza/blob/82157f85f24c6107667bf0f686b71a72aafdf8a5/internal/bodyprocessors/multipart.go#L26-L29 \nThe bodyprocessors of multipart uses `log.Fatalf` to handle errors from the `mime.ParseMediaType`, but `log.Fatalf` calls `os.Exit` directly after logging the error.\n https://github.com/golang/go/blob/a031f4ef83edc132d5f49382bfef491161de2476/src/log/log.go#L288-L291\nThis means that the application will immediately crash after receiving a malicious request that triggers an error in `mime.ParseMediaType`.\n\n### PoC\n\nThe server can be demonstrated by https://github.com/corazawaf/coraza/tree/main/examples/http-server\n\nAfter sending this request\n```\nPOST / HTTP/1.1\nHost: 127.0.0.1:8090\n```User-Agent```: curl/8.1.2\nAccept: */*\nContent-Length: 199\nContent-Type: multipart/form-data; boundary=------------------------5fa6351b877326a1; a=1; a=2\nConnection: close\n\n --------------------------5fa6351b877326a1\nContent-Disposition: form-data; name=\"file\"; filename=\"123\"\nContent-Type: application/octet-stream\n\n123 \n\n--------------------------5fa6351b877326a1--\n\n```\nThe server will crash immediately. The `a=1; a=2` in `Content-Type` makes `mime: duplicate parameter name` error.\n\n### Impact\n\nI believe the vulnerability was introduced by the following commit: https://github.com/corazawaf/coraza/commit/24af0c8cf4f10bab558740b595712be3b85493ec. \n\n### Mitigation\n\nThe error from `mime.ParseMediaType` should return directly.", "fixed_versions": [], "identifier": "GMS-2023-1811", "identifiers": [ "GHSA-c2pj-v37r-2p6h", "CVE-2023-40586", "GMS-2023-1811" ], "not_impacted": "", "package_slug": "go/github.com/corazawaf/coraza/v2", "pubdate": "2023-06-26", "solution": "Unfortunately, there is no solution available yet.", "title": "Coraza has potential denial of service vulnerability", "urls": [ "https://github.com/corazawaf/coraza/security/advisories/GHSA-c2pj-v37r-2p6h", "https://github.com/corazawaf/coraza-caddy/issues/48", "https://github.com/corazawaf/coraza/commit/24af0c8cf4f10bab558740b595712be3b85493ec", "https://github.com/corazawaf/coraza/commit/e1b119b83e12c64f0957e00e8cad45a1b5f012f8", "https://github.com/corazawaf/coraza/blob/82157f85f24c6107667bf0f686b71a72aafdf8a5/internal/bodyprocessors/multipart.go#L26-L29", "https://github.com/corazawaf/coraza/releases/tag/v3.0.1", "https://github.com/golang/go/blob/a031f4ef83edc132d5f49382bfef491161de2476/src/log/log.go#L288-L291", "https://github.com/corazawaf/coraza/commit/a5239ba3ce839e14d9b4f9486e1b4a403dcade8c", "https://github.com/advisories/GHSA-c2pj-v37r-2p6h" ], "uuid": "24fe58e8-33e5-40be-9233-78f7ac86fd99", "versions": [ { "commit": { "sha": "fdad9f5e07fb0c061a55426627afbefcd2b5c657", "tags": [ "v2.0.0" ], "timestamp": "20220322211430" }, "number": "v2.0.0" }, { "commit": { "sha": "a1529abf4746ab3082eb40622fdbeed2a7777fcb", "tags": [ "v2.0.1" ], "timestamp": "20220725143314" }, "number": "v2.0.1" } ] }, { "affected_range": "\u003e=v3.0.0 \u003cv3.0.1", "affected_versions": "All versions starting from 3.0.0 before 3.0.1", "cwe_ids": [ "CWE-1035", "CWE-400", "CWE-937" ], "date": "2023-08-25", "description": "### Summary\n\nDue to the misuse of `log.Fatalf`, the application using coraza crashed after receiving crafted requests from attackers.\n\n### Details\n\n https://github.com/corazawaf/coraza/blob/82157f85f24c6107667bf0f686b71a72aafdf8a5/internal/bodyprocessors/multipart.go#L26-L29\nThe bodyprocessors of multipart uses `log.Fatalf` to handle errors from the `mime.ParseMediaType`, but `log.Fatalf` calls `os.Exit` directly after logging the error.\n https://github.com/golang/go/blob/a031f4ef83edc132d5f49382bfef491161de2476/src/log/log.go#L288-L291\nThis means that the application will immediately crash after receiving a malicious request that triggers an error in `mime.ParseMediaType`.\n\n### PoC\n\nThe server can be demonstrated by https://github.com/corazawaf/coraza/tree/main/examples/http-server\n\nAfter sending this request\n```\nPOST / HTTP/1.1\nHost: 127.0.0.1:8090\n```User-Agent```: curl/8.1.2\nAccept: */*\nContent-Length: 199\nContent-Type: multipart/form-data; boundary=------------------------5fa6351b877326a1; a=1; a=2\nConnection: close\n\n --------------------------5fa6351b877326a1\nContent-Disposition: form-data; name=\"file\"; filename=\"123\"\nContent-Type: application/octet-stream\n\n123 \n\n --------------------------5fa6351b877326a1--\n\n```\nThe server will crash immediately. The `a=1; a=2` in `Content-Type` makes `mime: duplicate parameter name` error.\n\n### Impact\n\nI believe the vulnerability was introduced by the following commit: https://github.com/corazawaf/coraza/commit/24af0c8cf4f10bab558740b595712be3b85493ec.\n\n ### Mitigation\n\nThe error from `mime.ParseMediaType` should return directly.", "fixed_versions": [ "v3.0.1" ], "identifier": "GMS-2023-1812", "identifiers": [ "GHSA-c2pj-v37r-2p6h", "CVE-2023-40586", "GMS-2023-1812" ], "not_impacted": "All versions before 3.0.0, all versions starting from 3.0.1", "package_slug": "go/github.com/corazawaf/coraza/v3", "pubdate": "2023-06-26", "solution": "Upgrade to version 3.0.1 or above.", "title": "Coraza has potential denial of service vulnerability", "urls": [ "https://github.com/corazawaf/coraza/security/advisories/GHSA-c2pj-v37r-2p6h", "https://github.com/corazawaf/coraza-caddy/issues/48", "https://github.com/corazawaf/coraza/commit/24af0c8cf4f10bab558740b595712be3b85493ec", "https://github.com/corazawaf/coraza/commit/e1b119b83e12c64f0957e00e8cad45a1b5f012f8", "https://github.com/corazawaf/coraza/blob/82157f85f24c6107667bf0f686b71a72aafdf8a5/internal/bodyprocessors/multipart.go#L26-L29", "https://github.com/corazawaf/coraza/releases/tag/v3.0.1", "https://github.com/golang/go/blob/a031f4ef83edc132d5f49382bfef491161de2476/src/log/log.go#L288-L291", "https://github.com/corazawaf/coraza/commit/a5239ba3ce839e14d9b4f9486e1b4a403dcade8c", "https://github.com/advisories/GHSA-c2pj-v37r-2p6h" ], "uuid": "3e14990f-8245-4ba9-a968-ce0510dde9c9", "versions": [ { "commit": { "sha": "ad50864cfa00f5143fff7f6877847326fdc4b394", "tags": [ "v3.0.0" ], "timestamp": "20230531073255" }, "number": "v3.0.0" }, { "commit": { "sha": "a5239ba3ce839e14d9b4f9486e1b4a403dcade8c", "tags": [ "v3.0.1" ], "timestamp": "20230625161626" }, "number": "v3.0.1" } ] } ] }, "nvd.nist.gov": { "configurations": { "CVE_data_version": "4.0", "nodes": [ { "children": [], "cpe_match": [ { "cpe23Uri": "cpe:2.3:a:coraza:coraza:3.0.0:*:*:*:*:go:*:*", "cpe_name": [], "vulnerable": true } ], "operator": "OR" } ] }, "cve": { "CVE_data_meta": { "ASSIGNER": "security-advisories@github.com", "ID": "CVE-2023-40586" }, "data_format": "MITRE", "data_type": "CVE", "data_version": "4.0", "description": { "description_data": [ { "lang": "en", "value": "OWASP Coraza WAF is a golang modsecurity compatible web application firewall library. Due to the misuse of `log.Fatalf`, the application using coraza crashed after receiving crafted requests from attackers. The application will immediately crash after receiving a malicious request that triggers an error in `mime.ParseMediaType`. This issue was patched in version 3.0.1.\n" } ] }, "problemtype": { "problemtype_data": [ { "description": [ { "lang": "en", "value": "NVD-CWE-noinfo" } ] } ] }, "references": { "reference_data": [ { "name": "https://github.com/corazawaf/coraza/commit/a5239ba3ce839e14d9b4f9486e1b4a403dcade8c", "refsource": "MISC", "tags": [ "Patch" ], "url": "https://github.com/corazawaf/coraza/commit/a5239ba3ce839e14d9b4f9486e1b4a403dcade8c" }, { "name": "https://github.com/corazawaf/coraza/security/advisories/GHSA-c2pj-v37r-2p6h", "refsource": "MISC", "tags": [ "Mitigation", "Vendor Advisory" ], "url": "https://github.com/corazawaf/coraza/security/advisories/GHSA-c2pj-v37r-2p6h" } ] } }, "impact": { "baseMetricV3": { "cvssV3": { "attackComplexity": "LOW", "attackVector": "NETWORK", "availabilityImpact": "HIGH", "baseScore": 7.5, "baseSeverity": "HIGH", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "privilegesRequired": "NONE", "scope": "UNCHANGED", "userInteraction": "NONE", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "version": "3.1" }, "exploitabilityScore": 3.9, "impactScore": 3.6 } }, "lastModifiedDate": "2023-09-01T18:06Z", "publishedDate": "2023-08-25T21:15Z" } } }
Loading…
Loading…
Sightings
Author | Source | Type | Date |
---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.
Loading…
Loading…