You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/compliance/_index.md
+36-9Lines changed: 36 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,14 +10,6 @@ These tests validate that HTTP/1.1 servers correctly implement the protocol requ
10
10
11
11
Each test sends a request that violates a specific **MUST** or **MUST NOT** requirement from the RFCs. A compliant server should reject these with a `400 Bad Request` (or close the connection). Accepting the request silently means the server is non-compliant and potentially vulnerable to downstream attacks.
12
12
13
-
**What's tested:**
14
-
-**Line endings**— bare `LF` without `CR`, `CR` without `LF` (RFC 9112 §2.2)
15
-
-**Request-line format**— multiple spaces, missing target, fragments in URI (RFC 9112 §3)
16
-
-**HTTP version**— invalid version strings, HTTP/0.9 requests (RFC 9112 §2.3)
17
-
-**Header syntax**— obs-fold, space before colon, empty names, invalid characters, missing colon (RFC 9112 §5, RFC 9110 §5.6.2)
18
-
-**Host header**— missing or duplicate Host with conflicting values (RFC 9112 §7.1, RFC 9110 §5.4)
19
-
-**Content-Length**— non-numeric, plus sign, overflow (RFC 9112 §6.1)
@@ -29,9 +21,44 @@ Each test sends a request that violates a specific **MUST** or **MUST NOT** requ
29
21
document.getElementById('table-compliance').innerHTML='<p><em>No probe data available yet. Run the Probe workflow manually on <code>main</code> to generate results.</em></p>';
`Expect: 200-ok` — an Expect header with a value the server cannot fulfill.
18
+
19
+
## What the RFC says
20
+
21
+
> "A server that receives an Expect field value containing a member other than 100-continue MAY respond with a 417 (Expectation Failed) status code to indicate that the unexpected expectation cannot be met." — RFC 9110 Section 10.1.1
22
+
23
+
While the RFC uses "MAY", a `417 Expectation Failed` is the semantically correct response for an unrecognized Expect value. Silently ignoring unknown expectations is permissible but less strict.
24
+
25
+
## Why it matters
26
+
27
+
The Expect mechanism is a contract between client and server. If a server ignores unknown Expect values, clients cannot rely on the mechanism for future extensions. Returning `417` signals clear rejection of unsupported expectations.
The grammar requires at least one digit. An empty value is not a valid Content-Length and indicates invalid message framing.
24
+
25
+
## Why it matters
26
+
27
+
Parsers that treat an empty Content-Length as `0` will read no body, while others may reject it or wait for data. This disagreement between parsers can be exploited for smuggling when the request also carries a body.
|**Expected**|`400` preferred; `2xx` is a warning |
14
+
15
+
## What it sends
16
+
17
+
`Content-Length:\t5` — a Content-Length header where a horizontal tab character separates the colon from the value, instead of a space.
18
+
19
+
## What the RFC says
20
+
21
+
> "OWS = *( SP / HTAB )" — RFC 9110 Section 5.6.3
22
+
23
+
The optional whitespace (OWS) between the colon and the field value may be either spaces or horizontal tabs. A tab character is technically valid per the grammar.
24
+
25
+
## Why it matters
26
+
27
+
While tabs are valid OWS, they are rarely used in practice. Some parsers may not handle tab characters correctly — for example, treating the tab as part of the value rather than whitespace, resulting in a failed integer parse or a different numeric interpretation. This edge case tests parser robustness.
`CONNECT example.com HTTP/1.1` — a CONNECT request with authority-form that is missing the required port.
18
+
19
+
## What the RFC says
20
+
21
+
> "The 'authority-form' of request-target is only used for CONNECT requests... authority = uri-host ':' port" — RFC 9112 Section 3.2.3
22
+
23
+
The authority-form grammar requires both host and port separated by a colon. Omitting the port makes the request-target invalid.
24
+
25
+
## Why it matters
26
+
27
+
A server or proxy that accepts CONNECT without a port must guess the target port, which can lead to unexpected connections. This is a parsing ambiguity that could be exploited for SSRF or port confusion attacks.
`CONNECT example.com:443 HTTP/1.1` — a CONNECT request sent directly to an origin server (not a proxy).
18
+
19
+
## What the RFC says
20
+
21
+
> "CONNECT is intended only for use in requests to a proxy... A server that does not act as a tunnel for the requested host and port, or which chooses not to open a TCP connection, MUST respond with an appropriate error status code." — RFC 9110 Section 9.3.6
22
+
23
+
Origin servers are not proxies. They have no reason to accept CONNECT and establish a TCP tunnel.
24
+
25
+
## Why it matters
26
+
27
+
If an origin server accepts CONNECT, it effectively becomes an open proxy. This can be exploited for port scanning internal networks, bypassing firewalls, or pivoting attacks through the server.
0 commit comments