Skip to content

Commit 02958d0

Browse files
committed
Add release notes.
1 parent a34bfdd commit 02958d0

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

releases.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,52 @@
11
# Releases
22

3+
## Unreleased
4+
5+
### Improved HTTP Trailer Security
6+
7+
This release introduces significant security improvements for HTTP trailer handling, addressing potential HTTP request smuggling vulnerabilities by implementing a restrictive-by-default policy for trailer headers.
8+
9+
- **Security-by-default**: HTTP trailers are now validated and restricted by default to prevent HTTP request smuggling attacks.
10+
- Only safe headers are permitted in trailers:
11+
- `date` - Response generation timestamps (safe metadata)
12+
- `digest` - Content integrity verification (safe metadata)
13+
- `etag` - Cache validation tags (safe metadata)
14+
- `server-timing` - Performance metrics (safe metadata)
15+
- All other trailers are ignored by default.
16+
17+
If you are using this library for gRPC, you will need to use a custom policy to allow the `grpc-status` and `grpc-message` trailers:
18+
19+
```ruby
20+
module GRPCStatus
21+
def self.new(value)
22+
Integer(value)
23+
end
24+
25+
def self.trailer?
26+
true
27+
end
28+
end
29+
30+
module GRPCMessage
31+
def self.new(value)
32+
value
33+
end
34+
35+
def self.trailer?
36+
true
37+
end
38+
end
39+
40+
GRPC_POLICY = Protocol::HTTP::Headers::POLICY.dup
41+
GRPC_POLICY['grpc-status'] = GRPCStatus
42+
GRPC_POLICY['grpc-message'] = GRPCMessage
43+
44+
# Reinterpret the headers using the new policy:
45+
response.headers.policy = GRPC_POLICY
46+
response.headers['grpc-status'] # => 0
47+
response.headers['grpc-message'] # => "OK"
48+
```
49+
350
## v0.53.0
451

552
- Improve consistency of Body `#inspect`.

0 commit comments

Comments
 (0)