jakartaee / jakartaee/servlet

isSecure should not trust scheme

Open
#96 3 comments 0 reactions 1 assignee Claimed by @glassfishrobot View on GitHub
Enhancement
Dominant language
Java
Stars
325
Forks
112
PR merge metrics
No merged PRs in 30d

Description

With http1, the scheme was not transported with the request (except for proxies), so it was the origin server that set if the scheme is http or https.

With http2, the scheme will be transported with the request, so it is possible for a https request to arrive over a plain text connection and for http to arrive over a TLS connection. Essentially scheme has become a user provided value rather than an origin server determined one.

The description of isSecure should be improved so that implementations do more than just return "https".equals(getScheme()). Implementations should check that https requests have a suitable secure context - which may be a TLS connection or the presence of headers or other out of band information provided by a TLS offloader (eg access to a protected port might be sufficient to indicate the request came from a secure path).
#### Environment
servlet 4.0 http2

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.