WeblateOrg / weblate

Audit required: Use of mark_safe detected BAN-B308
Security
Major
20 days ago4 years old
Use of mark_safe() may expose cross-site scripting vulnerabilities and should be reviewed.
 223            GROUP_TEMPLATE,
 224            [
 225                (
 226                    mark_safe('data-toggle="buttons"'),  # noqa: S308 227                    rtl_switch,
 228                )
 229            ],  # Only one group.
Use of mark_safe() may expose cross-site scripting vulnerabilities and should be reviewed.
 205                    gettext("Toggle text direction"),
 206                    rtl_name,
 207                    "rtl",
 208                    mark_safe('checked="checked"'),  # noqa: S308 209                    "RTL",
 210                ),
 211                (
Use of mark_safe() may expose cross-site scripting vulnerabilities and should be reviewed.
 172                    name,
 173                    format_html(
 174                        'data-value="{}"',
 175                        mark_safe(  # noqa: S308 176                            value.encode("ascii", "xmlcharrefreplace").decode("ascii") 177                        ), 178                    ),
 179                    char,
 180                )
Use of mark_safe() may expose cross-site scripting vulnerabilities and should be reviewed.
 244                    name,
 245                    format_html(
 246                        'data-value="{}"',
 247                        mark_safe(  # noqa: S308 248                            value.encode("ascii", "xmlcharrefreplace").decode("ascii") 249                        ), 250                    ),
 251                    char,
 252                )
Use of mark_safe() may expose cross-site scripting vulnerabilities and should be reviewed.
424            errors.extend(self.format_result(results))
425        if errors:
426            return format_html_join(
427                mark_safe("<br />"),  # noqa: S308428                "{}",
429                ((error,) for error in errors),
430            )