Skip to content
XSS Disclosed report Intermediate

Base Tag Hijacking via Host Header Injection

The server set the href attribute of the HTML base tag from the incoming Host header, so an attacker who could inject a host value could make all relative URLs resolve to an attacker-controlled domain. This could let the attacker serve malicious content, download malware, deface the page, or redirect users.

Kapeka Follow

Originally disclosed on Bugcrowd

Informational View original
  • Accepted in 31 hours
  • Disclosed after 7 months

Summary by Kapeka

A Host Header Injection was used to hijack the href attribute from the base HTML tag. The vulnerability arises because the server dynamically sets the href attribute of the <base> tag in the HTML document based on the Host header. This allows an attacker to manipulate the Host header and control the resolution of relative URLs, affecting resources like images, scripts, and links.

Example: If an attacker injects an evil host in the HTTP Host header, for example: evil.com The base HTML tag that indentifies relative paths, will look like this:

<base href="https://evil.com">

All relative URLs (such as /img/logo.png, /js/main.js) will be resolved to https://evil.com, enabling the attacker to serve malicious content, download malware, web defacement, redirect....

However as it requires Host header injection and only affects client side, it is considered a self vuln and a P5.

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

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

Impact

An attacker could serve malicious content, download malware, deface the page, or redirect users, but the report notes it requires Host header injection and only affects the client side, so it is considered a self vulnerability and rated P5.

What the attacker needed

Ability to inject the Host header; victim loads the affected page

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 web page often uses a base tag to tell the browser where to find relative links like images or scripts. This site built that base address from the Host header, which is just the domain name the browser sends. If an attacker can change that header, the browser will load everything from the attacker's site instead.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More from National Aeronautics and Space Administration (NASA) - Vulnerability Disclosure Program

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.