{"id":948,"cve":"CVE-2023-49081","cve_url":"https:\/\/www.cvedetails.com\/cve\/CVE-2023-49081","cwe":"CWE-20 Improper Input Validation","cwe_number":20,"cwe_url":"https:\/\/cwe.mitre.org\/data\/definitions\/20","cvss_score":5.3,"published":"2023-11-30","owasp":"A10 Server-Side Request Forgery (SSRF)","odc":"Checking","cdc":"Incorrect Check","category":"Information Leakage","subcategory":"Insecure Handling of Sensitive Data","scope":"Remote","impact":"Unauthorized Access","summary":"Asynchronous HTTP request manipulation in aiohttp 3.8.0","permalink":"https:\/\/netpack.pt\/vaitp\/vulnerability\/CVE-2023-49081\/","description":"aiohttp is an asynchronous HTTP client\/server framework for asyncio and Python. Improper validation made it possible for an attacker to modify the HTTP request (e.g. to insert a new header) or create a new HTTP request if the attacker controls the HTTP version. The vulnerability only occurs if the attacker can control the HTTP version of the request. This issue has been patched in version 3.9.0.","solution":"Upgrade aiohttp to version 3.9.0 or newer","affected_component":"aiohttp","fixed_by_upgrading":true,"vulnerable_code":"import aiohttp\nfrom aiohttp import web\n\nasync def handle(request):\n    return web.Response(text=\"Request processed\")\n\napp = web.Application()\napp.router.add_get('\/', handle)\n\nif __name__ == '__main__':\n    web.run_app(app)","patched_code":"import aiohttp\nfrom aiohttp import web\n\nasync def handle(request):\n    if request.version not in (aiohttp.HttpVersion11, aiohttp.HttpVersion10):\n        return web.Response(text=\"Invalid HTTP version\", status=400)\n\n    return web.Response(text=\"Request processed safely\")\n\napp = web.Application()\napp.router.add_get('\/', handle)\n\nif __name__ == '__main__':\n    web.run_app(app)","payload_needed":false,"payload":null,"payload_status":"none","published_fix":[{"repository":"aio-libs\/aiohttp","commit_url":"https:\/\/github.com\/aio-libs\/aiohttp\/commit\/1e86b777e61cf4eefc7d92fa57fa19dcc676013b","commit_subject":"Disallow arbitrary sequence types in version (#7835)","units":[{"file":"aiohttp\/client_reqrep.py","function":"ClientRequest.send"}]}],"references":null}