Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Register
    • Login
    Introducing Netgate Nexus: Multi-Instance Management at Your Fingertips.

    Reason for requiring CSRF on login page?

    Scheduled Pinned Locked Moved General pfSense Questions
    3 Posts 2 Posters 457 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      kfp
      last edited by

      Typically CSRF tokens protects users with authenticated sessions from executing single request surreptitiously to change some state of the application (ie update firewall rules) where the request URI parameters are known by a malicious 3rd party. For the login page the user is not authenticated, the request parameters (the user's credential) are not likely to be known, and the single action (logging in) is unlikely to be of value to the attacker.

      Having the CSRF token required on the login page does add a minor annoyance in that if you leave the login page open longer than the token life, when you go to actually login you will have to either refresh the page or click the retry button. Minor but unnecessary.

      1 Reply Last reply
      Reply Quote 0
      • jimpJ
        jimp Rebel Alliance Developer Netgate
        last edited by

        Yes.

        For a basic reasoning, see https://en.wikipedia.org/wiki/Cross-site_request_forgery#Forging_login_requests but there are other more detailed examples out there as well.

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        1 Reply Last reply
        Reply Quote 0
        • K
          kfp
          last edited by

          Oh interesting. In my understanding if there was only one user this attack would not be possible and possibly if the user logging in already has the maximum escalated privileges this attack becomes much less useful. I understand that these are likely small enough use cases they would not warrant mitigation for the login page token expiry.

          Thanks for the explanation!

          1 Reply Last reply
          Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          Copyright 2026 Rubicon Communications LLC (Netgate). All rights reserved.
          Privacy Policy · Cookie Policy