GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — HttpRequestDecoder silently accepts control characters in the HTTP version token · Issue #16970 · netty/netty Closed DescriptionExpected behaviorA request line whose HTTP-version token carries a boundary control byte ( Actual behavior
This is the same boundary-control-character / request-smuggling class that #16723 (issue #15047) closed for the method token. The method token now rejects the byte: but the version token on the same request line is still normalized away. Steps to reproduceSend a request whose version token is prefixed with a printf 'GET / \x00HTTP/1.1\r\nHost: localhost\r\n\r\n' | nc localhost 8080 # decoded as a clean HTTP/1.1 request; no decoder failure Minimal yet complete reproducer code (or URL to code)// BUG: control byte in the version token is silently trimmed EmbeddedChannel ch = new EmbeddedChannel(new HttpRequestDecoder()); ch.writeInbound(Unpooled.copiedBuffer( "GET / HTTP/1.1\r\nHost: localhost\r\n\r\n", StandardCharsets.US_ASCII)); HttpRequest req = ch.readInbound(); // current behavior — both pass, i.e. the malformed request is accepted: assertTrue(req.decoderResult().isSuccess()); assertEquals(HttpVersion.HTTP_1_1, req.protocolVersion()); // For contrast, the same NUL on the method token is rejected since #16723: EmbeddedChannel ch2 = new EmbeddedChannel(new HttpRequestDecoder()); ch2.writeInbound(Unpooled.copiedBuffer( " GET / HTTP/1.1\r\nHost: localhost\r\n\r\n", StandardCharsets.US_ASCII)); HttpRequest req2 = ch2.readInbound(); assertTrue(req2.decoderResult().isFailure()); // IllegalArgumentException: Illegal character in HTTP Method: 0x0 Root cause is Netty version4.2.15.Final, 4.1.135.Final, and current JVM version (e.g.
|
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |