Skip to content
SSRF Disclosed report Intermediate

Urllib connects to a wrong host

The urllib module parsed URLs inconsistently with how it fetched them, so a password containing a hash character caused the library to connect to a different host than the one the URL appeared to name. An attacker could use this to make a server-side request to an unintended host, an SSRF issue.

Orange Tsai .8361) Follow

Originally disclosed on HackerOne

Bounty$500 Low View original
  • Fixed in 3 months
  • Paid in 3 months
  • Disclosed after 22 months

Summary by the program

The urllib module doesn’t parse correctly password containing the # character.

  • Disclosure date: 2017-05-29 (Python issue #30500 reported)
  • Reported at: 2017-03-04 (Orange Tsai on the PSRT list)

The report

Description


The inconsistent of URL parsing and URL fetching are distinct

 

Original bug report


 

Note


  • None

  Thanks :)

Impact

SSRF

The original report as published on HackerOne, by orange. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the URL parser and the URL fetcher disagreed about where the host ends when a password contains a hash character, so the fetched host differed from the parsed one.

What the attacker needed

Attacker controls a URL fetched by the app

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A URL can contain a username and password before the host name. The hash symbol normally marks the start of a fragment that browsers ignore, but here the library treated it differently when reading the URL than when connecting, so it ended up talking to the wrong server. That matters because a program that fetches a URL on a user's behalf could be tricked into contacting an internal machine.

What is SSRF?

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.

More by Orange Tsai .8361)

View all

22 more disclosed reports, best first.

More from Internet Bug Bounty

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Server-side request forgery (SSRF)

The lesson behind this report.

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.