Zum Inhalt springen

Cross-Site Scripting (ARCH8101)

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Key kotlin.security.xss · Severity error · Category security · CWE CWE-79

Flags WebView HTML/JavaScript sinks (loadData, loadDataWithBaseURL, evaluateJavascript) fed with interpolated data, and javaScriptEnabled = true on a WebView.

webView.loadData("<h1>$userName</h1>", "text/html", "utf-8")
webView.loadData("<h1>${Html.escapeHtml(userName)}</h1>", "text/html", "utf-8")

Escape data before it reaches an HTML/JS sink; keep JavaScript disabled unless the page needs it.