Skip to content

Fetching subdomains with special characters #1127

@discodamone

Description

@discodamone

Reproduction

Steps to reproduce the behavior:

  1. fetch('otherdomain[.example.com') will fetch otherdomain/[.example.com

Expected behavior

I believe the request should fail, as is the case with the normal fetch api and location header within browsers.
https://tools.ietf.org/html/rfc1035

Your Environment

software version
node-fetch 2.6.1
node 12.18.4
npm 6.14.8
Operating System ubuntu

Additional context

This has security implicatons, there are circumstances where any subdomains of a specific root domain are allowed to be fetched (and are user-supplied) but node-fetch adds a forward slash and allows other domains to be fetched

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions