CVE-2026-27612: Dangerouslysetinnerhtml Dynamic Interpolation

Constructing HTML via inline string interpolation and passing it directly to `dangerouslySetInnerHTML` bypasses React's XSS protections. If the interpolated variables contain unvalidated user input, an attacker can exploit this to perform Cross-Site Scripting (XSS). Provide standard JSX element children instead, which automatically escape HTML entities.

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0JS
greprules fetch cve-2026-27612-dangerouslysetinnerhtml-dynamic-interpolation --engine opengrep

Description

Constructing HTML via inline string interpolation and passing it directly to `dangerouslySetInnerHTML` bypasses React's XSS protections. If the interpolated variables contain unvalidated user input, an attacker can exploit this to perform Cross-Site Scripting (XSS). Provide standard JSX element children instead, which automatically escape HTML entities.