🐛 QUIC Hijack() skips the status-written check that HTTP/2 enforces
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- go
- Área
- backend, networking
Línea de trabajo
Compara http2RespWriter.Hijack en connection/http2.go con httpResponseAdapter.Hijack en connection/quic_connection.go, centrándote en statusWritten y connectResponseSent. Reproduce el comportamiento diferente con los protocolos HTTP/2 y QUIC descritos y, luego, verifica que QUIC aplique la misma precondición y ya no permita escrituras sin procesar antes de que se envíe una respuesta de conexión.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
Hijack() has different preconditions on the two transports.
HTTP/2, http2RespWriter.Hijack in connection/http2.go, refuses when no status was written yet:
if !rp.statusWritten {
return nil, nil, fmt.Errorf("status not yet written before attempting to hijack connection")
}
QUIC, httpResponseAdapter.Hijack in connection/quic_connection.go, has no such check. It always returns a localProxyConnection, even when connectResponseSent is still false, so the caller can write raw bytes to the stream before any connect response went out.
Same caller, different outcome depending on the transport: on HTTP/2 it gets an error, on QUIC it gets a conn.
To Reproduce
Stock cloudflared writes the status before it hijacks, so the built-in ingress path does not hit this. I hit it in a fork that replaces the OriginProxy, with code that hijacks first. net/http/httputil.ReverseProxy does exactly that on a 101: handleUpgradeResponse calls Hijack() and then writes the status line onto the conn itself.
ProxyHTTPserves the request throughhttputil.ReverseProxyto a backend that answers 101.- With
--protocol http2,Hijackfails and the client gets a 502. - With
--protocol quic,Hijacksucceeds and the caller can write to the stream before any connect response was sent.
Expected behavior
Both transports enforce the same precondition. The HTTP/2 check looks like the right one, so QUIC could refuse the same way while connectResponseSent is false.
Environment and versions
- OS: Linux
- Architecture: AMD64
- Version: 2026.9.1, and the
Hijackbodies are unchanged on master as of 2026.9.3
Logs and errors
HTTP/2: status not yet written before attempting to hijack connection. QUIC: no error.
Additional context
I worked around it on my side, so it does not block me. Filing it because the two transports disagree on the ResponseWriter contract, and that is easy to miss.
- Lenguaje dominante
- Go
- Estrellas
- 16.2k
- Forks
- 1.5k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de cloudflare/cloudflared
-
🐛 --output json writes invalid JSON lines when events are logged concurrentlyPosiblemente ocupada @theolujay la tomó hace 12 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
cloudflare/cloudflared#1761 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
🐛 cfRay is missing from proxied request logs (newHTTPLogger discards the zerolog context)Posiblemente ocupada @pankajc46 la tomó hace 14 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
cloudflare/cloudflared#1756 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
🐛 After SIGTERM, `cloudflared tunnel run` uses 100% of one CPU core for the whole graceful-shutdown periodPosiblemente ocupada @cyphercodes la tomó hace 14 días. AbiertoPriority: Normal Type: Bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
cloudflare/cloudflared#1753 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
tunnel route ip show: --filter-network-is-subset-of sends the superset filterPosiblemente ocupada @wangyusheng1985 la tomó hace 14 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 92/100
cloudflare/cloudflared#1750 ·
Los mantenedores suelen responder en 1 día
-
🐛 QUIC Hijack() skips the status-written check that HTTP/2 enforcesPosiblemente ocupada @dedsec-terminal la tomó hace 8 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
cloudflare/cloudflared#1748 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de cloudflare/cloudflared
Issues similares
-
native
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
prime-radiant-inc/evener#4839 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
521xueweihan/HelloGitHub#4073 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
goharbor/terraform-provider-harbor#655 · 1 comentario ·