CVE-2026-47761: Unsafe Dynamic Attribute Reconstruction

Reconstructing HTML elements by dynamically stripping prefixes from attribute names and assigning them directly to objects without sanitizing the reconstructed full element can lead to Stored XSS. Attackers can smuggle attributes like `onclick` or `href` using expected user-controlled prefixes. Ensure that the full element (`outerHTML`) is sanitized instead

Provally CuratedPublic repositoryMediumMedium confidenceVerifiedApache-2.0JS
greprules fetch cve-2026-47761-unsafe-dynamic-attribute-reconstruction --engine opengrep

Description

Reconstructing HTML elements by dynamically stripping prefixes from attribute names and assigning them directly to objects without sanitizing the reconstructed full element can lead to Stored XSS. Attackers can smuggle attributes like `onclick` or `href` using expected user-controlled prefixes. Ensure that the full element (`outerHTML`) is sanitized instead