Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ sequenceDiagram
AGW->>AGW: CSRF validation:<br/>Origin (malicioussite.com)<br/>vs Destination (api.example.com)

alt Origin does NOT match destination<br/>and NOT in additionalOrigins
AGW-->>User: 403 Forbidden<br/>"CSRF validation failed"
AGW-->>User: 403 Forbidden<br/>"csrf validation failed"
Note over User,AGW: Attack blocked
end

Expand All @@ -59,7 +59,7 @@ Allowed requests are as follows.

### Blocked requests

Blocked requests, which receive a `403 Forbidden` response with the message "CSRF validation failed", are as follows.
Blocked requests, which receive a `403 Forbidden` response with the message "csrf validation failed", are as follows.

- Cross-site requests with `Sec-Fetch-Site: cross-site` (unless trusted)
- Cross-site requests where `Origin` doesn't match `Host` (unless trusted)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ You can configure request buffering, response buffering, or both.
| `policies.buffer.response.maxBytes` | Maximum number of response body bytes to buffer. | Uses the global proxy buffer setting, which defaults to 2 MiB. |
| `policies.buffer.response.failureMode` | Behavior when the response body exceeds `maxBytes`: `failClosed` to reject the response, or `failOpen` to continue. | `failClosed` |

The `maxBytes` value is a number of bytes, such as `65536` for 64 KiB. Large buffered bodies can increase proxy memory usage, so set strict limits for routes that receive untrusted or large payloads. When a body exceeds the applicable buffer limit, agentgateway rejects the body if possible. If response headers were already sent before the limit is exceeded, the proxy closes the connection.
The `maxBytes` value is a number of bytes, such as `65536` for 64 KiB. Large buffered bodies can increase proxy memory usage, so set strict limits for routes that receive untrusted or large payloads. With `failClosed`, the proxy rejects a body that exceeds the applicable buffer limit. For a request body, the proxy returns `413` with the response body `request body too large`. For a response body that exceeds the limit before response headers are sent, the proxy returns `502` with the response body `upstream response too large`. If response headers were already sent before the limit is exceeded, the proxy closes the connection. With `failOpen`, the proxy buffers up to the limit and streams the rest of the body, so the request or response continues.

## Buffer request and response bodies

Expand Down
Loading