Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

github логотип

GHSA-xvp8-3mhv-424c

Опубликовано: 02 мар. 2026
Источник: github
Github: Прошло ревью
CVSS3: 6.1

Описание

lxml-html-clean has tag injection through default Cleaner configuration

Summary

The <base> tag passes through the default Cleaner configuration. While page_structure=True removes html, head, and title tags, there is no specific handling for <base>, allowing an attacker to inject it and hijack relative links on the page.

Details

The <base> tag is not currently in the page_structure kill set. Even though the specification says <base> must be inside <head>, browsers accept <base> tags outside of the head.

If an attacker injects a <base> tag, it changes the base URL for all relative URLs on the page (links, images, scripts) to a domain controlled by the attacker.

PoC

from lxml_html_clean import clean_html # The base tag is preserved in the output result = clean_html('<base href="http://evil.com/"><a href="/account">Account</a>') print(result) # Output: <div><base href="http://evil.com/">...<a href="/account">Account</a></div>

Impact

The injection of a <base> tag allows an attacker to hijack the resolution of all relative URLs on the page. This results in three critical attack vectors:

  1. Phishing & Redirection: Attackers can redirect user navigation (e.g., <a href="/login">) and form submissions (e.g., <form action="/auth">) to an attacker-controlled domain, effectively stealing credentials or sensitive data without the user realizing they have left the legitimate site.
  2. Cross-Site Scripting (XSS): If the victim application loads JavaScript files using relative paths (e.g., <script src="assets/app.js">), the browser will attempt to fetch the script from the attacker's domain. This upgrades the vulnerability from HTML injection to full Stored XSS.
  3. Defacement: Relative references to images (<img>) and stylesheets (<link>) will be loaded from the attacker's server, allowing for UI redressing or defacement.

Пакеты

Наименование

lxml-html-clean

pip
Затронутые версииВерсия исправления

<= 0.4.3

0.4.4

EPSS

Процентиль: 1%
0.0001
Низкий

6.1 Medium

CVSS3

Дефекты

CWE-116

Связанные уязвимости

CVSS3: 6.1
ubuntu
25 дней назад

lxml_html_clean is a project for HTML cleaning functionalities copied from `lxml.html.clean`. Prior to version 0.4.4, the <base> tag passes through the default Cleaner configuration. While page_structure=True removes html, head, and title tags, there is no specific handling for <base>, allowing an attacker to inject it and hijack relative links on the page. This issue has been patched in version 0.4.4.

CVSS3: 6.1
nvd
25 дней назад

lxml_html_clean is a project for HTML cleaning functionalities copied from `lxml.html.clean`. Prior to version 0.4.4, the <base> tag passes through the default Cleaner configuration. While page_structure=True removes html, head, and title tags, there is no specific handling for <base>, allowing an attacker to inject it and hijack relative links on the page. This issue has been patched in version 0.4.4.

CVSS3: 6.1
debian
25 дней назад

lxml_html_clean is a project for HTML cleaning functionalities copied ...

suse-cvrf
19 дней назад

Security update for python-lxml_html_clean

EPSS

Процентиль: 1%
0.0001
Низкий

6.1 Medium

CVSS3

Дефекты

CWE-116