wasi-http p3: forwarded trailers aren't checked against is_forbidden_header hook
Description
Trailers were not filtered by the WasiHttpHooks::is_forbidden_header hook when the body has been forwarded from an existing request/response in a WASIp3 guest. There is no known attack that this enables, but its possible that this breaks a property of trailers that the embedder requires and intended by customizing the is_forbidden_header hook.
Patches
Patches are present in main, the 50.0.0 release branch, and patch releases 48.0.7 and 49.0.4.
This issue is fixed in main and 50.0.0 by replacing is_forbidden_header with a new method WasiHttpHooks::forbidden_header_filter which refactors the forbidden header check to be a boxed closure for implementation reasons.
In 48.0.7 and 49.0.4, the issue is fixed by introducing WasiHttpHooks::forbidden_header_filter, while keeping is_forbidden_header (now defined in terms of forbidden_header_filter) as to not break semver. Embedders that customized their implementation of is_forbidden_header must patch their implementations to implement forbidden_header_filter in order to fully get this fix, otherwise forwarded body trailers will only block the DEFAULT_FORBIDDEN_HEADERS set.