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

exploitDog

github логотип

GHSA-cjmm-f4jc-qw8r

Опубликовано: 03 апр. 2026
Источник: github
Github: Прошло ревью
CVSS4: 5.3

Описание

DOMPurify ADD_ATTR predicate skips URI validation

Summary

DOMPurify allows ADD_ATTR to be provided as a predicate function via EXTRA_ELEMENT_HANDLING.attributeCheck. When the predicate returns true, _isValidAttribute short-circuits the attribute check before URI-safe validation runs. An attacker who supplies a predicate that accepts specific attribute/tag combinations can then sanitize input such as <a href="javascript:alert(document.domain)"> and have the javascript: URL survive, because URI validation is skipped for that attribute while other checks still pass. The provided PoC accepts href for anchors and then triggers a click inside an iframe, showing that the sanitized payload executes despite the protocol bypass.

Impact

Predicate-based allowlisting bypasses DOMPurify's URI validation, allowing unsafe protocols such as javascript: to reach the DOM and execute whenever the link is activated, resulting in DOM-based XSS.

Credits

Identified by Cantina’s Apex (https://www.cantina.security).

Пакеты

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

dompurify

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

<= 3.3.1

3.3.2

EPSS

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

5.3 Medium

CVSS4

Дефекты

CWE-183

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

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

DOMPurify before 3.3.2 contains a URI validation bypass vulnerability when ADD_ATTR is provided as a predicate function via EXTRA_ELEMENT_HANDLING.attributeCheck. Attackers can supply a predicate that accepts specific attribute and tag combinations to bypass URI-safe validation, allowing unsafe protocols like javascript: to survive sanitization and execute as DOM-based XSS when the link is activated.

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

DOMPurify before 3.3.2 contains a URI validation bypass vulnerability when ADD_ATTR is provided as a predicate function via EXTRA_ELEMENT_HANDLING.attributeCheck. Attackers can supply a predicate that accepts specific attribute and tag combinations to bypass URI-safe validation, allowing unsafe protocols like javascript: to survive sanitization and execute as DOM-based XSS when the link is activated.

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

DOMPurify before 3.3.2 contains a URI validation bypass vulnerability ...

EPSS

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

5.3 Medium

CVSS4

Дефекты

CWE-183