Why Gateway Upgrades Can Expose Invalid HTTP Traffic
November 26, 2026
Key Takeaways
- API7 Gateway 3.10.11 updates the Data Plane's NGINX runtime and changes how it handles specific malformed HTTP messages.
- Check clients, intermediaries, and upstreams before upgrading. Test highly fragmented chunked requests against an upgraded instance.
- A 400 or 502 alone does not identify the cause. Compare by Data Plane version and use the relevant error log to investigate.
A gateway upgrade can expose an integration problem that has been present for months: a client or upstream has sent invalid HTTP, but the previous runtime accepted it. When validation becomes stricter, an unchanged application may begin receiving errors. The operational challenge is to find the sender and repair the message before a staged rollout reaches the rest of the fleet.
The API7 Gateway 3.10.11 release notes describe three changes to review. Released on November 19, 2026, it updates the Data Plane's NGINX runtime to 1.31.9 and incorporates upstream security fixes; applicability of a particular upstream issue depends on its affected configuration.
Find the sender of malformed headers
A request header line without a colon now results in HTTP 400 on an upgraded Data Plane. Correct the client or intermediary to send a valid Header-Name: value line. An upstream response header line without a colon instead results in HTTP 502; investigate the upstream service or intermediary generating that response. Earlier versions could accept the request or pass the malformed response to the client, respectively.
These statuses have other causes. Check the Data Plane error log for client sent invalid header line or upstream sent invalid header before attributing a specific failure to this change. The client-header message is logged at info level, which may need to be enabled on the validation instance.
Test fragmented request bodies
For a chunked request, framing can become disproportionately large compared with the decoded body. In 3.10.11 the release notes describe a rejection when floor(R / 8) > D + 1,048,576, where R and D are the received and decoded body byte counts accumulated during processing; R includes chunk framing. The check runs while buffers are processed and can reject the request before the complete body is processed. A comparison using only final body totals does not establish every boundary case. The response is HTTP 400 for this condition.
Test representative request sizes and client traffic patterns, particularly clients producing many small chunks. If the relevant Data Plane log reports client sent too large chunked body overhead, inspect the client or intermediary and reduce the framing overhead. This log is also at info level.
What the isolated data-plane test demonstrated
We ran the official api7/api7-ee-3-gateway:3.10.10 and :3.10.11 images with the same HTTP/1.1 route and a synthetic upstream. The route forwarded to a local test server. These were YAML standalone data planes with the control-plane hook disabled as instructed by the image; the experiment does not validate the control-plane-managed deployment or enterprise hook.
The following is the tested deployment configuration excerpt. This is a local parser probe, not a production deployment recommendation:
deployment: role: data_plane role_data_plane: config_provider: yaml apisix: lua_module_hook: ~ node_listen: 9080 enable_admin: false enable_ipv6: false nginx_config: error_log_level: info
The same /* route in each instance forwarded to 192.168.65.254:19083, the Docker Desktop host address used by this local test. The Python upstream deliberately generated a response header line BrokenHeader without a colon. A separate client generated one-byte chunks with extensions to increase framing overhead. These are synthetic inputs, not production measurements.
Save the configuration above as config.yaml, and the route below as apisix.yaml. This reproduction uses Docker Desktop on macOS and the host address from our test; verify the host address for your installation before running. Use an isolated test machine: the temporary synthetic upstream listens on port 19083 on all host interfaces while the script runs.
routes: - id: 1 uri: /* upstream: type: roundrobin nodes: '192.168.65.254:19083': 1 #END
Start the data plane with the following command, then save the Python code as probe.py and run python3 probe.py on the host. It requires Python 3 and no third-party packages. The chunk extension is deliberately large; it represents a synthetic stress case rather than ordinary application traffic.
docker run -d --name http-validation-probe \ -p 127.0.0.1:19082:9080 \ -v "$PWD/config.yaml:/usr/local/apisix/conf/config.yaml:ro" \ -v "$PWD/apisix.yaml:/usr/local/apisix/conf/apisix.yaml:ro" \ --entrypoint /bin/bash api7/api7-ee-3-gateway:3.10.11 \ -c '/usr/bin/apisix init && exec /usr/local/openresty/bin/openresty -p /usr/local/apisix -g "daemon off;"'
import socket, socketserver, threading, time class Upstream(socketserver.BaseRequestHandler): def handle(self): data=b'' while b'\r\n\r\n' not in data: part=self.request.recv(65536) if not part: return data+=part header, body = data.split(b'\r\n\r\n', 1) length = 0 for line in header.split(b'\r\n')[1:]: if line.lower().startswith(b'content-length:'): length = int(line.split(b':', 1)[1].strip()) while len(body) < length: part = self.request.recv(min(65536, length - len(body))) if not part: return body += part if data.startswith(b'GET /bad '): self.request.sendall(b'HTTP/1.1 200 OK\r\nBrokenHeader\r\nContent-Length: 2\r\nConnection: close\r\n\r\nok') else: self.request.sendall(b'HTTP/1.1 200 OK\r\nContent-Length: 2\r\nConnection: close\r\n\r\nok') class Server(socketserver.ThreadingTCPServer): allow_reuse_address=True daemon_threads=True def request(label, payload): send_errors = [] try: with socket.create_connection(('127.0.0.1',19082), timeout=30) as s: s.settimeout(30) def send(): try: s.sendall(payload) except OSError as exc: send_errors.append(type(exc).__name__) sender = threading.Thread(target=send, daemon=True) sender.start() data=b'' while True: try: part=s.recv(65536) except ConnectionResetError: if data: break raise if not part: break data+=part sender.join(timeout=1) print(label, 'intended_bytes=',len(payload), 'status=',repr(data.split(b'\r\n',1)[0]), 'send_errors=',send_errors) except OSError as exc: print(label, 'error=',repr(exc)) with Server(('0.0.0.0',19083), Upstream) as server: threading.Thread(target=server.serve_forever, daemon=True).start() for attempt in range(30): try: with socket.create_connection(('127.0.0.1', 19082), timeout=1) as ready: ready.settimeout(1) ready.sendall(b'GET /ready HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') if ready.recv(64).startswith(b'HTTP/1.1 200 '): break except OSError: pass time.sleep(1) else: raise SystemExit('gateway readiness timed out') request('missing-colon', b'GET /good HTTP/1.1\r\nHost: localhost\r\nBadHeader\r\nConnection: close\r\n\r\n') request('valid-upstream', b'GET /good HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') request('malformed-upstream', b'GET /bad HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') head=b'POST /chunk HTTP/1.1\r\nHost: localhost\r\nTransfer-Encoding: chunked\r\nConnection: close\r\n\r\n' chunk=b'1;abcdefghijklmnopqrstuvwx=12345678\r\nx\r\n' for count in (1000,350000): body=chunk*count+b'0\r\n\r\n' print('chunk-size',count,'intended-body-bytes',len(body),'intended-decoded-bytes',count,'intended-floor(R/8)',len(body)//8,'intended-limit',count+1048576) request('chunk-'+str(count),head+body) server.shutdown()
The script reports intended request sizes. An early rejection can produce a send error after the HTTP response has arrived; use the returned status and server log together. After the script finishes, inspect docker logs http-validation-probe and stop it with docker stop http-validation-probe. To compare versions, use a second instance name and replace the image tag with 3.10.10, stopping the first instance before reusing the host port. This probe does not configure the control plane.
| Observed test input | 3.10.10 | 3.10.11 |
|---|---|---|
| Valid upstream response | 200 | 200 |
| Upstream header line without a colon | 200 | 502 |
| 1,000 one-byte chunks with extensions | 200 | 200 |
| 350,000 one-byte chunks with extensions | 200 | 400 |
On 3.10.11, a separate request containing BadHeader without a colon returned 400. The malformed-upstream and high-overhead tests produced the corresponding log messages:
upstream sent invalid header: "BrokenHeader\x0d..." client sent too large chunked body overhead: 262167+10224529 bytes
These are excerpts from actual test logs with connection metadata omitted. The second line records decoded bytes and framing overhead at rejection, before the entire intended request body was processed. The results corroborate the documented cases for this configuration; they do not prove exact threshold equality, every chunking pattern, or behavior of a control-plane-managed instance.
Roll out with a diagnostic baseline
Before rollout, inventory clients, intermediaries, and upstreams that may generate malformed headers, and run representative chunked traffic through an upgraded Data Plane. In a staged rollout, validate the upgraded instance before upgrading the remaining instances.
Afterward, compare HTTP 400 and 502 responses by Data Plane version, route, and upstream service against the pre-upgrade baseline. Correlate changes with the error logs and repair the responsible sender rather than treating a status code alone as a diagnosis. Review the release notes for the complete upgrade guidance and security-fix context.
For deployment planning, explore API7 Gateway and use the versioned release guidance to prepare your own validation traffic.


