Direct DOM manipulations in Lightning Web Component (LWC)

Overview

Lightning Web Components use Shadow DOM to protect the component from being manipulated by arbitrary HTML, CSS, and JavaScript. Bypassing the Shadow DOM gives developers greater control but is strongly discouraged as it significantly increases the risk of Cross-Site Scripting (XSS) and code injection vulnerabilities.

Business Impact

Decreased operational efficiency, increased potential for human error, delayed time-to-market, and decreased employee satisfaction.

Resources

Frequent

Incidence

How common is this issue?
11%6%
arrow down4%
lower

Exposure

How long do organizations remain exposed before fixing the problem?
1 year9 months
arrow down44%
shorter
BenchmarkWith Clayton

Frameworks

EasyiconAutomatediconEfficiencyiconOperational LogiciconA04:2021 – Insecure Designicon