Skip to content

httplib: wrong Host header when connecting to IPv6 link-local address #73561

Closed

Description

@JonathanGuthrie
BPO 29375
Nosy @gpshead, @vadmium

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2017-01-25.20:14:44.074>
labels = ['3.7', 'type-bug', 'library']
title = 'httplib: wrong Host header when connecting to IPv6 link-local address'
updated_at = <Date 2017-01-26.21:13:35.139>
user = 'https://bugs.python.org/JonathanGuthrie'

bugs.python.org fields:

activity = <Date 2017-01-26.21:13:35.139>
actor = 'JonathanGuthrie'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2017-01-25.20:14:44.074>
creator = 'JonathanGuthrie'
dependencies = []
files = []
hgrepos = []
issue_num = 29375
keywords = []
message_count = 3.0
messages = ['286276', '286286', '286333']
nosy_count = 3.0
nosy_names = ['gregory.p.smith', 'martin.panter', 'JonathanGuthrie']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'needs patch'
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue29375'
versions = ['Python 2.7', 'Python 3.5', 'Python 3.6', 'Python 3.7']

Linked PRs

Activity

  1. JonathanGuthrie commented on Jan 25, 2017

    JonathanGuthriemannequin
    MannequinAuthor

    This is related to bpo-5111.

    An IPv6 link-local address must include a scope specifier as part of the address passed to the HTTPConnection or HTTPSConnection constructor, that scope specifier is not being stripped from the address passed in the HTTP 1.1 Host: header line.

    So, suppose I was attempting to connect to an HTTP server on fe80::8aae:1dff:fea4:29c8. That's a link-local address, so I must give the scope specifier, which is the interface I can use to connect to that address. So, the address I would pass to the HTTPConnection constructor might look like "fe80::8aae:1dff:fea4:29c8%eth0". The appropriate Host line in the HTTP request would be "Host: [fe80::8aae:1dff:fea4:29c8]" but it is actually "Host: [fe80::8aae:1dff:fea4:29c8%eth0]"

    Compliant HTTP servers reject requests including this line as malformed.

  2. added
    stdlibStandard Library Python modules in the Lib/ directory
    on Jan 25, 2017
  3. vadmium commented on Jan 25, 2017

    @vadmium
    Member

    More closely related: bpo-23448, about the same thing with urllib, which adds the Host value itself. Any solution should be shared between both modules.

  4. JonathanGuthrie commented on Jan 26, 2017

    JonathanGuthriemannequin
    MannequinAuthor

    Yes, it is more closely related to bpo-23448. My search for related issues apparently wasn't exhaustive enough.

  5. transferred this issue fromon Apr 10, 2022
  6. mib1185 commented on Jul 5, 2023

    @mib1185
    Contributor

    Hi,
    according to the dev-guid - reviewing, i would like to "ping" this issue.
    Do you mind to have a look into the linked PR? Unfortunately it is without a review since more than a year, but it is a quite small PR to fix this issue.
    thx

  7. mib1185 commented on Aug 17, 2023

    @mib1185
    Contributor

    Hi,
    according to the dev-guid - reviewing, i would like to "ping" this issue.
    Do you mind to have a look into the linked PR?
    thx

  8. self-assigned this
    on Nov 19, 2023
  9. added a commit that references this issue on Nov 19, 2023
  10. added 2 commits that reference this issue on Nov 19, 2023
  11. added 2 commits that reference this issue on Nov 19, 2023
  12. added a commit that references this issue on Feb 11, 2024
  13. added a commit that references this issue on Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

3.7 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions