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/docs/caching/etag-304.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,11 +34,11 @@ Captures the `ETag` header from the response for use in step 2.
34
34
```http
35
35
GET / HTTP/1.1\r\n
36
36
Host: localhost:8080\r\n
37
-
If-None-Match: "abc123"\r\n
37
+
If-None-Match: {ETag from step 1}\r\n
38
38
\r\n
39
39
```
40
40
41
-
Sends the captured ETag value in an `If-None-Match` header. If the resource hasn't changed, the server should return `304 Not Modified`.
41
+
Replays the `ETag` value captured from step 1 in an `If-None-Match` header. If the resource hasn't changed, the server should return `304 Not Modified`. If the server did not include an `ETag` header in step 1, the test reports Warn immediately.
Copy file name to clipboardExpand all lines: docs/content/docs/caching/inm-precedence.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,12 +34,12 @@ Captures the `ETag` header from the response.
34
34
```http
35
35
GET / HTTP/1.1\r\n
36
36
Host: localhost:8080\r\n
37
-
If-None-Match: "abc123"\r\n
37
+
If-None-Match: {ETag from step 1}\r\n
38
38
If-Modified-Since: Thu, 01 Jan 1970 00:00:00 GMT\r\n
39
39
\r\n
40
40
```
41
41
42
-
The `If-None-Match` header matches the current ETag (should produce `304`), but the`If-Modified-Since` is set to epoch (should produce `200` since the resource was certainly modified after 1970). If the server returns `304`, it correctly evaluated `If-None-Match` first.
42
+
Replays the `ETag` value captured from step 1 in `If-None-Match`(should produce `304`), combined with`If-Modified-Since` set to epoch (should produce `200` since the resource was certainly modified after 1970). If the server returns `304`, it correctly evaluated `If-None-Match` first.
Copy file name to clipboardExpand all lines: docs/content/docs/caching/inm-unquoted.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,11 +34,11 @@ Captures the `ETag` header from the response for use in step 2.
34
34
```http
35
35
GET / HTTP/1.1\r\n
36
36
Host: localhost:8080\r\n
37
-
If-None-Match: abc123\r\n
37
+
If-None-Match: {ETag from step 1, unquoted}\r\n
38
38
\r\n
39
39
```
40
40
41
-
Sends the ETag value without the required surrounding double quotes. According to the RFC grammar, `entity-tag = [ weak ] opaque-tag` and `opaque-tag = DQUOTE *etagc DQUOTE` — the quotes are mandatory.
41
+
Sends the ETag value captured from step 1, stripped of the required surrounding double quotes. According to the RFC grammar, `entity-tag = [ weak ] opaque-tag` and `opaque-tag = DQUOTE *etagc DQUOTE` — the quotes are mandatory.
Copy file name to clipboardExpand all lines: docs/content/docs/caching/last-modified-304.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,11 +34,11 @@ Captures the `Last-Modified` header from the response for use in step 2.
34
34
```http
35
35
GET / HTTP/1.1\r\n
36
36
Host: localhost:8080\r\n
37
-
If-Modified-Since: Sun, 01 Jan 2025 00:00:00 GMT\r\n
37
+
If-Modified-Since: {Last-Modified from step 1}\r\n
38
38
\r\n
39
39
```
40
40
41
-
Sends the captured Last-Modified value in an `If-Modified-Since` header. If the resource hasn't changed since that date, the server should return `304 Not Modified`.
41
+
Replays the `Last-Modified` value captured from step 1 in an `If-Modified-Since` header. If the resource hasn't changed since that date, the server should return `304 Not Modified`. If the server did not include a `Last-Modified` header in step 1, the test reports Warn immediately.
Cookie parsing is handled by framework-level parsers that run automatically on every request. Malformed `Cookie` headers can crash these parsers, cause memory issues, or produce mangled values. These tests check whether servers and frameworks survive adversarial cookie input.
10
-
11
-
Cookies are defined by [RFC 6265](https://www.rfc-editor.org/rfc/rfc6265) (not RFC 9110/9112), so all tests are **unscored**.
12
-
13
-
## Scoring
14
-
15
-
All cookie tests are **unscored**:
16
-
17
-
-**Pass** — Server handled the cookie input safely
18
-
-**Warn** — Endpoint not available or non-ideal but non-dangerous behavior
19
-
-**Fail** — Server crashed (500), preserved dangerous bytes, or lost data it should have parsed
20
-
21
-
## Echo-Based Tests
22
-
23
-
These tests target `/echo` and work on all servers. They check whether the server survives adversarial cookie headers without crashing.
{{< card link="multi-header" title="MULTI-HEADER" subtitle="Two separate Cookie headers." >}}
34
-
{{< /cards >}}
35
-
36
-
## Parsed-Cookie Tests
37
-
38
-
These tests target `/cookie` and check whether the framework's cookie parser correctly extracts key=value pairs. Servers without a `/cookie` endpoint return 404 (Warn).
Control characters (`0x00-0x1F`) are explicitly excluded from the `cookie-octet` production. They are not valid in cookie values.
30
-
31
26
## Why it matters
32
27
33
-
Control characters in cookie values can cause:
34
-
-**Log injection** — if the bytes reach log files, they may corrupt formatting or inject terminal escape sequences
35
-
-**Parser confusion** — some parsers may interpret control characters as delimiters
36
-
-**Security filter bypass** — WAFs may not inspect or sanitize non-printable bytes
28
+
Control characters in cookie values violate RFC 6265's cookie-octet grammar and can enable response splitting or log injection if passed through to output.
37
29
38
30
## Verdicts
39
31
40
-
-**Pass** — `400` (rejected) or `2xx` with control characters stripped/cookie dropped
41
-
-**Fail** — `2xx` with control characters preserved in the response body
32
+
-**Pass** — 400rejected, or 2xx with control chars stripped
33
+
-**Fail** — 2xx with control chars preserved (dangerous), or 500
An empty cookie-string does not match `cookie-pair *( ";" SP cookie-pair )` since `cookie-pair` requires at least a name. However, servers should handle this gracefully.
30
-
31
26
## Why it matters
32
27
33
-
Empty `Cookie` headers can trigger null-pointer dereferences or empty-string edge cases in cookie parsers. The test verifies the server doesn't crash.
28
+
Empty Cookie headers can cause null-reference exceptions or crashes in parsers that assume at least one key=value pair.
34
29
35
30
## Verdicts
36
31
37
-
-**Pass** — `2xx` (accepted) or `400` (rejected gracefully)
0 commit comments