CVE-2025-66458: Python Markup Unsafe Formatting

Constructing a `Markup` object using Python's built-in string formatting (e.g., f-strings, `.format()`, `%`, or string concatenation) bypasses HTML escaping. `Markup` trusts the evaluated string entirely, leading to Cross-Site Scripting (XSS) if variable contents are user-controlled. Instead, pass the format string directly to `Markup` and then call `.format

Provally CuratedPublic repositoryMediumMedium confidenceVerifiedApache-2.0Python
greprules fetch cve-2025-66458-python-markup-unsafe-formatting --engine opengrep

Description

Constructing a `Markup` object using Python's built-in string formatting (e.g., f-strings, `.format()`, `%`, or string concatenation) bypasses HTML escaping. `Markup` trusts the evaluated string entirely, leading to Cross-Site Scripting (XSS) if variable contents are user-controlled. Instead, pass the format string directly to `Markup` and then call `.format