CVE-2026-22787: Polymorphic Function Arg To Innerhtml

A function parameter is conditionally checked to be a string and directly assigned to `innerHTML`. This pattern frequently appears in functions handling either DOM nodes or strings, leading to DOM XSS if the string is attacker-controlled.

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0JS
greprules fetch cve-2026-22787-polymorphic-function-arg-to-innerhtml --engine opengrep

Description

A function parameter is conditionally checked to be a string and directly assigned to `innerHTML`. This pattern frequently appears in functions handling either DOM nodes or strings, leading to DOM XSS if the string is attacker-controlled.