CVE-2024-23334: LFI and Path Traversal Vulnerability in Aiohttp
CVE-2024-23334 exposes a Local File Inclusion (LFI) and Path Traversal vulnerability in Aiohttp versions <= 3.9.1. This issue allows attackers to access files outside the intended directories when follow_symlinks=True
is used.
Technical Overview
The vulnerability occurs due to improper handling of file paths when serving static resources. By manipulating the URL, attackers can access sensitive files on the system.
Proof of Concept (PoC)
The PoC demonstrating this vulnerability can be found here: Exploit PoC on GitHub.
Example of exploitation:
http://<server-ip>:<port>/static/../../../../etc/passwd
##Impact
Sensitive File Access: Attackers can exploit this vulnerability to access critical files like /etc/passwd, which may contain sensitive information.
Security Breach: Unauthorized access to these files could lead to privilege escalation or further attacks on the system.
Widespread Exposure: Any system running vulnerable versions of Aiohttp is at risk.
##Mitigation
Upgrade Aiohttp: Update to version 3.9.2 or later, which resolves the issue.
Avoid Using follow_symlinks=True: If possible, avoid using this option, especially without proper access control and validation.
Path Sanitization: Implement robust path sanitization and validation to prevent attackers from exploiting path traversal vulnerabilities.
##Conclusion
CVE-2024-23334 is a critical vulnerability that could lead to serious breaches if left unpatched. Organizations using vulnerable versions of Aiohttp should upgrade immediately or apply alternative mitigations to prevent exploitation. For full details and the PoC, visit the GitHub repository.