Skip to content

Obscure the data-* attributes on the Flask login form #163

Description

@fluffy-critter

Some crawlers see the data-example attributes and interpret them as links to crawl, which then results in stupid things like

access.log.1:47.147.230.141 - - [21/Jun/2026:18:03:43 -0700] "GET /_login/food/coffee/instance/instance/instance/instance/instance/instance/instance/instance/instance/instance/instance/instance/instance/instance/instance/instance/instance/instance/instance/instance/instance/instance/instance/instance/instance/instance/instance/instance/instance/instance/instance/instance/instance/?fill=https%3 HTTP/1.1" 200 5193 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0" "beesbuzz.biz" https

Apparently a lot of crawlers now see data- attributes with / as potential URLs to traverse, so a potential workaround would be to replace all /s with another character and then substitute them back in setUrl().

This can all happen within the login.html template itself, with no need to make any backend changes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    UXRelating to the end-user experience

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions