diff --git a/CHANGELOG.md b/CHANGELOG.md index cfdd56602..4beb86be7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,24 @@ -## [v2.11.23](https://github.com/traefik/traefik/tree/v2.11.23) (2025-04-17) -[All Commits](https://github.com/traefik/traefik/compare/v2.11.22...v2.11.23) +## [v2.11.24](https://github.com/traefik/traefik/tree/v2.11.24) (2025-04-18) +[All Commits](https://github.com/traefik/traefik/compare/v2.11.22...v2.11.24) **Bug fixes:** - **[acme]** Bump github.com/go-acme/lego/v4 to v4.23.1 ([#11690](https://github.com/traefik/traefik/pull/11690) by [ldez](https://github.com/ldez)) - **[metrics]** Bump gopkg.in/DataDog/dd-trace-go.v1 to v1.72.2 ([#11693](https://github.com/traefik/traefik/pull/11693) by [kevinpollet](https://github.com/kevinpollet)) - **[middleware]** Add Content-Length header to preflight response ([#11682](https://github.com/traefik/traefik/pull/11682) by [lbenguigui](https://github.com/lbenguigui)) - **[server]** Sanitize request path ([#11684](https://github.com/traefik/traefik/pull/11684) by [rtribotte](https://github.com/rtribotte)) +- Bump github.com/redis/go-redis/v9 to v9.7.3 ([#11695](https://github.com/traefik/traefik/pull/11695) by [kevinpollet](https://github.com/kevinpollet)) - Bump golang.org/x/net to v0.38.0 ([#11691](https://github.com/traefik/traefik/pull/11691) by [kevinpollet](https://github.com/kevinpollet)) - Bump golang.org/x/oauth2 to v0.28.0 ([#11689](https://github.com/traefik/traefik/pull/11689) by [rtribotte](https://github.com/rtribotte)) **Documentation:** +- **[middleware]** Add content-length best practice documentation ([#11697](https://github.com/traefik/traefik/pull/11697) by [sheddy-traefik](https://github.com/sheddy-traefik)) - Typo fix on the Explanation Section for User Guide HTTP Challenge. ([#11676](https://github.com/traefik/traefik/pull/11676) by [YapWC](https://github.com/YapWC)) +## [v2.11.23](https://github.com/traefik/traefik/tree/v2.11.23) (2025-04-17) +[All Commits](https://github.com/traefik/traefik/compare/v2.11.22...v2.11.23) + +Release canceled. + ## [v3.3.5](https://github.com/traefik/traefik/tree/v3.3.5) (2025-03-31) [All Commits](https://github.com/traefik/traefik/compare/v3.3.4...v3.3.5) diff --git a/docs/content/middlewares/http/buffering.md b/docs/content/middlewares/http/buffering.md index 27dc60382..c609fe469 100644 --- a/docs/content/middlewares/http/buffering.md +++ b/docs/content/middlewares/http/buffering.md @@ -264,3 +264,7 @@ The retry expression is defined as a logical combination of the functions below - `Attempts()` number of attempts (the first one counts) - `ResponseCode()` response code of the service - `IsNetworkError()` whether the response code is related to networking error + +### Content-Length + +See [Best Practices: Content‑Length](../../security/best-practices/content-length.md) \ No newline at end of file diff --git a/docs/content/migration/v2.md b/docs/content/migration/v2.md index 68d5fcbed..02924b976 100644 --- a/docs/content/migration/v2.md +++ b/docs/content/migration/v2.md @@ -660,11 +660,11 @@ Please check out the [entrypoint forwarded headers connection option configurati In `v2.11.14`, the `X-Forwarded-Prefix` header is now handled like the other `X-Forwarded-*` headers: Traefik removes it when it's sent from an untrusted source. Please refer to the Forwarded headers [documentation](../routing/entrypoints.md#forwarded-headers) for more details. -## v2.11.23 +## v2.11.24 ### Request Path Sanitization -Since `v2.11.23`, the incoming request path is now cleaned before being used to match the router rules and sent to the backends. +Since `v2.11.24`, the incoming request path is now cleaned before being used to match the router rules and sent to the backends. Any `/../`, `/./` or duplicate slash segments in the request path is interpreted and/or collapsed. If you want to disable this behavior, you can set the [`sanitizePath` option](../routing/entrypoints.md#sanitizepath) to `false` in the entryPoint HTTP configuration. diff --git a/docs/content/security/best-practices/content-length.md b/docs/content/security/best-practices/content-length.md new file mode 100644 index 000000000..e09c62b6d --- /dev/null +++ b/docs/content/security/best-practices/content-length.md @@ -0,0 +1,24 @@ +--- +title: "Content-Length" +description: "Enforce strict Content‑Length validation in Traefik by streaming or full buffering to prevent truncated or over‑long requests and responses. Read the technical documentation." +--- + +Traefik acts as a streaming proxy. By default, it checks each chunk of data against the `Content-Length` header as it passes it on to the backend or client. This live check blocks truncated or over‑long streams without holding the entire message. + +If you need Traefik to read and verify the full body before any data moves on, add the [buffering middleware](../../reference/routing-configuration/http/middlewares/buffering.md): + +```yaml +http: + middlewares: + buffer-and-validate: + buffering: {} +``` + +With buffering enabled, Traefik will: + +- Read the entire request or response into memory. +- Compare the actual byte count to the `Content-Length` header. +- Reject the message if the counts do not match. + +!!!warning + Buffering adds overhead. Every request and response is held in full before forwarding, which can increase memory use and latency. Use it when strict content validation is critical to your security posture. diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 633a03c22..3e60ab843 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -163,6 +163,9 @@ nav: - 'Tracing': - 'Overview': 'observability/tracing/overview.md' - 'OpenTelemetry': 'observability/tracing/opentelemetry.md' + - 'Security': + - 'Best Practices': + - 'security/best-practices/content-length.md' - 'User Guides': - 'FastProxy': 'user-guides/fastproxy.md' - 'Kubernetes and Let''s Encrypt': 'user-guides/crd-acme/index.md' @@ -206,7 +209,7 @@ nav: - 'Nomad': "reference/install-configuration/providers/hashicorp/nomad.md" - 'Consul': 'reference/install-configuration/providers/hashicorp/consul.md' - 'Consul Catalog': 'reference/install-configuration/providers/hashicorp/consul-catalog.md' - - 'KV Stores': + - 'KV Stores': - 'Redis': 'reference/install-configuration/providers/kv/redis.md' - 'Consul': 'reference/install-configuration/providers/kv/consul.md' - 'etcd': 'reference/install-configuration/providers/kv/etcd.md' @@ -230,22 +233,22 @@ nav: - 'Health Check (CLI & Ping)': 'reference/install-configuration/observability/healthcheck.md' # - 'Options List': 'reference/install-configuration/cli-options-list.md' -- Todo - 'Routing Configuration': - - 'General' : + - 'General' : - 'Configuration Methods' : 'reference/routing-configuration/dynamic-configuration-methods.md' - - 'HTTP' : + - 'HTTP' : - 'Router' : - 'Rules & Priority' : 'reference/routing-configuration/http/router/rules-and-priority.md' - 'Observability': 'reference/routing-configuration/http/router/observability.md' - 'Load Balancing' : - 'Service' : 'reference/routing-configuration/http/load-balancing/service.md' - 'ServersTransport' : 'reference/routing-configuration/http/load-balancing/serverstransport.md' - - 'TLS' : + - 'TLS' : - 'Overview' : 'reference/routing-configuration/http/tls/overview.md' - 'TLS Certificates' : 'reference/routing-configuration/http/tls/tls-certificates.md' - 'TLS Options' : 'reference/routing-configuration/http/tls/tls-options.md' - - 'Middlewares' : + - 'Middlewares' : - 'Overview' : 'reference/routing-configuration/http/middlewares/overview.md' - - 'AddPrefix' : 'reference/routing-configuration/http/middlewares/addprefix.md' + - 'AddPrefix' : 'reference/routing-configuration/http/middlewares/addprefix.md' - 'BasicAuth' : 'reference/routing-configuration/http/middlewares/basicauth.md' - 'Buffering': 'reference/routing-configuration/http/middlewares/buffering.md' - 'Chain': 'reference/routing-configuration/http/middlewares/chain.md' @@ -269,7 +272,7 @@ nav: - 'StripPrefix': 'reference/routing-configuration/http/middlewares/stripprefix.md' - 'StripPrefixRegex': 'reference/routing-configuration/http/middlewares/stripprefixregex.md' - 'TCP' : - - 'Router' : + - 'Router' : - 'Rules & Priority' : 'reference/routing-configuration/tcp/router/rules-and-priority.md' - 'Service' : 'reference/routing-configuration/tcp/service.md' - 'ServersTransport' : 'reference/routing-configuration/tcp/serverstransport.md' @@ -284,7 +287,7 @@ nav: - 'Service' : 'reference/routing-configuration/udp/service.md' - 'Kubernetes': - 'Gateway API' : 'reference/routing-configuration/kubernetes/gateway-api.md' - - 'Kubernetes CRD' : + - 'Kubernetes CRD' : - 'HTTP' : - 'IngressRoute' : 'reference/routing-configuration/kubernetes/crd/http/ingressroute.md' - 'TraefikService' : 'reference/routing-configuration/kubernetes/crd/http/traefikservice.md'