CVE-2024-45299: Java Unescaped Data In Script Element

Appending unescaped content directly to a `<script>` tag can lead to Cross-Site Scripting (XSS) or structural HTML breakage if the content contains a closing script tag (e.g., `</script>`). Ensure the content is properly encoded (e.g., using `UriUtils.encodeFragment` or `HtmlUtils.htmlEscape`) before appending it to the DOM. Avoid using standard JSON seriali

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0Javaβ
greprules fetch cve-2024-45299-java-unescaped-data-in-script-element --engine opengrep

Description

Appending unescaped content directly to a `<script>` tag can lead to Cross-Site Scripting (XSS) or structural HTML breakage if the content contains a closing script tag (e.g., `</script>`). Ensure the content is properly encoded (e.g., using `UriUtils.encodeFragment` or `HtmlUtils.htmlEscape`) before appending it to the DOM. Avoid using standard JSON seriali