CVE-2026-6019: Python Insufficient Script Escaping

Escaping string quotes with `.replace` is insufficient to prevent XSS in an inline HTML `<script>` block. An attacker can inject a `</script>` tag to break out of the script execution context. Use robust encoding like `json.dumps()` or `base64`.

Provally CuratedPublic repositoryMediumMedium confidenceVerifiedApache-2.0Python
greprules fetch cve-2026-6019-python-insufficient-script-escaping --engine opengrep

Description

Escaping string quotes with `.replace` is insufficient to prevent XSS in an inline HTML `<script>` block. An attacker can inject a `</script>` tag to break out of the script execution context. Use robust encoding like `json.dumps()` or `base64`.