OIDC pass-through matcher incorrectly treats the Bearer scheme as case-sensitive

Open Beginner friendly
#10,104 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@floriankoch is already working on this.

Since Sep 24, 2026.

  • #10105 by @floriankoch — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go

Research direction

Start in internal/xds/translator/oidc.go around the default JWT extraction path referenced at lines 346 and 359. Reproduce the behavior with passThroughAuthHeader enabled using both bearer and Bearer schemes, then add regression coverage for capitalization and invalid JWT rejection. Done means both valid spellings receive identical treatment while JWT validation remains enforced.

Written by the indexing model from the issue text.

Description

triage

Description:

With OIDC, JWT authentication, and passThroughAuthHeader enabled, the default JWT extraction path generates a pass-through matcher for Bearer without IgnoreCase: true.

The affected code is present in v1.8.4, line 346 and v1.9.1, line 359.

Repro steps:

  1. Configure OIDC and JWT with passThroughAuthHeader enabled and default JWT extraction.
  2. Send Authorization: bearer without OAuth cookies.
  3. Compare with Authorization: Bearer .
    Actual:
    Lowercase bearer does not match the pass-through rule and enters the OAuth2 flow. If a matching denyRedirect rule prevents login redirects, the gateway returns 401.

Expected: Both spellings should receive identical treatment:

  • RFC 9110 §11.1 defines authentication scheme names as case-insensitive.
  • RFC 6750 §2.1 defines Bearer credentials as credentials = "Bearer" 1*SP b64token. The "Bearer" ABNF literal is case-insensitive under RFC 5234 §2.3.

Suggested fix
Set IgnoreCase: true on the default Bearer prefix matcher. Preserve token contents and JWT validation, with regression tests covering scheme capitalization and rejection of invalid JWTs.

Dominant language
Go
Stars
3.1k
Forks
940
Avg merge
2d 8h
Merged PRs (30d)
177

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from envoyproxy/gateway

All issues in envoyproxy/gateway

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.