Skip to content

http: count malformed client Forwarded lines removed by Sōzu #1692

Closed

Description

@FlorentinDUBOIS

Follow-up to #1685 (forwarded_headers per listener), found in its review.

#1685 validates a client-supplied Forwarded value against the RFC 7239 §4 grammar and removes a malformed line in the both (default) and rfc7239 modes, so Sōzu's own element always stays parseable. Values that break the RFC but are common in practice — an unquoted port (for=1.2.3.4:80) or an unquoted IPv6 address (for=2001:db8::1) — are therefore now dropped instead of extended. That is RFC-correct and documented, but the only trace is a debug! log: an operator behind a non-conforming upstream load balancer loses the upstream chain without any visible signal.

Proposal:

  • add a counter, e.g. http.forwarded_malformed_elided, incremented once per removed line, documented in doc/observability.md;
  • fix the comment above the trailer drop list in lib/src/protocol/mux/pkawa.rs, which says each X-Forwarded-* header is "either synthesised or removed" on the HEADERS pass — untrue in none mode, and in x_forwarded mode for Forwarded.

Test: an editor test asserting the counter increments for a malformed line and not for a valid one.

Activity

  1. added a commit that references this issue on Sep 29, 2026
    a641960
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions