VAITP Dataset

← Back to the dataset

CVE-2024-23829

  • CVSS 6.5
  • CWE-444
  • Input Validation and Sanitization
  • Remote

aiohttp is an asynchronous HTTP client/server framework for asyncio and Python. Security-sensitive parts of the Python HTTP parser retained minor differences in allowable character sets, that must trigger error handling to robustly match frame boundaries of proxies in order to protect against injection of additional requests. Additionally, validation could trigger exceptions that were not handled consistently with processing of other malformed input. Being more lenient than internet standards require could, depending on deployment environment, assist in request smuggling. The unhandled exception could cause excessive resource consumption on the application server and/or its logging facilities. This vulnerability exists due to an incomplete fix for CVE-2023-47627. Version 3.9.2 fixes this vulnerability.

CVSS base score
6.5
Published
2024-01-29
OWASP
A05 Security Misconfiguration
Orthogonal defect classification
Checking
Category
Input Validation and Sanitization
Subcategory
Inadequate Error Handling
Accessibility scope
Remote
Impact
Denial of Service (DoS)
Affected component
aiohttp
Fixed by upgrading
Yes

Solution

Upgrade to aiohttp version 3.9.2 or later.

Vulnerable code sample

import aiohttp
import asyncio

async def handle_request(request):
    data = await request.text()
    return aiohttp.web.Response(text="Request processed successfully")

app = aiohttp.web.Application()
app.router.add_post('/endpoint', handle_request)

if __name__ == '__main__':
    aiohttp.web.run_app(app)

Patched code sample

import aiohttp
from aiohttp import web
import asyncio
import bleach

async def handle_request(request):
    data = await request.text()
    escaped_data = bleach.clean(data)

    return web.Response(text="Request processed successfully")

app = web.Application()
app.router.add_post('/endpoint', handle_request)

if __name__ == '__main__':
    web.run_app(app)

Payload

POST /endpoint HTTP/1.1
Host: vulnerable.server
Content-Length: 50

malicious_payload_here

Cite this entry

@misc{vaitp:cve202423829,
  title        = {{}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2024},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2024-23829},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2024-23829/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::