#2018 Mixed-case HTTPS scheme in URL results in unencrypted HTTP request

Reporter Zash
Owner Zash
Created
Updated
Stars ★ (1)
Tags
  • Milestone-13.0
  • Status-Fixed
  • Priority-High
  • Type-Defect
  • Security
  1. Zash on

    What steps will reproduce the problem? In the shell: prosody> >require"net.http".request("httpS://prosody.im/"):next(function(response) assert(response.request.conn:ssl(), "TLS was not used");end) ! Error: console:1: TLS was not used What version of the product are you using? On what operating system? Problem dates back to https://hg.prosody.im/trunk/rev/912a49b1c4e3 Please provide any additional information below. Problem is this line: local using_https = req.scheme == "https"; This means any other casing is treated as plain http (including other non-http schemes) https://www.rfc-editor.org/info/rfc3986/#section-3.1 > Although schemes are case-insensitive, the canonical form is lowercase > and documents that specify schemes must do so with lowercase letters. > An implementation should accept uppercase letters as equivalent to > lowercase in scheme names (e.g., allow "HTTP" as well as "http") for > the sake of robustness but should only produce lowercase scheme names > for consistency.

  2. Zash on

    Changes
    • tags Status-Started Milestone-13.0
    • owner Zash
  3. Zash on

    Fixed in https://hg.prosody.im/trunk/rev/23b891d042a2

    Changes
    • tags Status-Fixed
  4. MattJ on

    Changes
    • tags Hidden

New comment

Not published. Used for spam prevention and optional update notifications.