Disabled HTML autoescape High

The autoescape mechanism protects web applications from the most common cross-site scripting (XSS) vulnerabilities. To secure your application, enable autoescaping.

Detector ID
scala/do-not-disable-html-autoescape@v1.0
Category
Common Weakness Enumeration (CWE) external icon

Noncompliant example

1def nonCompliant(pageParameters: PageParameters): Unit = {
2    // Noncompliant: Autoescape is disabled for this label.
3    add(new Label("test").setEscapeModelStrings(false))
4}

Compliant example

1def compliant(pageParameters: PageParameters): Unit = {
2    // Compliant: Autoescape is enabled for this label.
3    add(new Label("test").setEscapeModelStrings(true))
4}