{"id":7409,"date":"2022-04-22T12:30:52","date_gmt":"2022-04-22T19:30:52","guid":{"rendered":"https:\/\/webdev.securin.xyz\/?p=7409"},"modified":"2023-04-05T12:33:50","modified_gmt":"2023-04-05T19:33:50","slug":"account-take-over-attack-series-2-account-takeover-through-password-reset-poisoning","status":"publish","type":"post","link":"https:\/\/webdev.securin.xyz\/articles\/account-take-over-attack-series-2-account-takeover-through-password-reset-poisoning\/","title":{"rendered":"Account Take Over Attack Series 2: Account Takeover through Password Reset Poisoning"},"content":{"rendered":"
\n

Every web application that has a login portal also has a reset password functionality with it. This reset password functionality comes in very handy when the user forgets his password. Read on to know how attackers steal your credentials while resetting your password.<\/p>\n<\/blockquote>\n

Password reset poisoning is an attack where the attacker gets hold of the password reset token of a victim and is now able to reset the victim\u2019s password.<\/p>\n

This issue is caused when the application relies on the host header to craft the password reset link and adds the user-provided host header in the password reset link.<\/p>\n

Working of Password Reset Functionality<\/h2>\n
    \n
  1. \n

    A legitimate user who has forgotten his password goes to the password reset page and enters his email id or username.<\/p>\n<\/li>\n

  2. \n

    Then, the application checks whether the user is present in its database and creates a unique temporary token that is associated with the user\u2019s account.<\/p>\n<\/li>\n

  3. \n

    An email is sent to the user containing a link with the token attached as a parameter. This link can be used to reset the account\u2019s password.<\/p>\n<\/li>\n<\/ol>\n

    <\/p>\n

    For the demonstration of the vulnerability, we\u2019ll be using Portswigger\u2019s Web Security Academy lab.<\/p>\n

    Vulnerable Application: <\/strong>Portswigger\u2019s Web Security Academy lab<\/a><\/p>\n

    Attack Scenario: <\/strong>Wiener is an attacker, and he wants to hijack Carlos\u2019s (victim) account.<\/p>\n

    Steps to Reproduce:<\/h2>\n
      \n
    1. \n

      The application provides a login panel in which password reset functionality is present. We can abuse this functionality.<\/p>\n<\/li>\n<\/ol>\n

      <\/p>\n

        \n
      1. \n

        We also have our own exploit server, which can be used to get the victim\u2019s token from the password reset functionality.<\/p>\n<\/li>\n<\/ol>\n

        <\/p>\n

          \n
        1. \n

          Enter the victim\u2019s name in the password reset input field and click on submit.<\/p>\n<\/li>\n<\/ol>\n

          <\/p>\n

            \n
          1. \n

            Intercept this request in a proxy server like Burp.<\/p>\n<\/li>\n<\/ol>\n

            <\/p>\n

              \n
            1. \n

              Change the host header to the exploit server\u2019s domain.<\/p>\n<\/li>\n<\/ol>\n

              <\/p>\n

                \n
              1. \n

                Now let the request pass by turning the intercept off. On the browser, it shows that the password reset link is sent in the mail.<\/p>\n<\/li>\n<\/ol>\n

                <\/p>\n

                  \n
                1. \n

                  As soon as the victim clicks on the link in his mail, our exploit server gets a request, and the reset token gets logged.<\/p>\n<\/li>\n<\/ol>\n

                  <\/p>\n

                    \n
                  1. \n

                    This token can now be used to reset the password of our victim Carlos and take over his account.<\/p>\n<\/li>\n<\/ol>\n

                    <\/p>\n

                      \n
                    1. \n

                      We have successfully taken over Carlos\u2019s account.<\/p>\n<\/li>\n<\/ol>\n

                      <\/p>\n

                      Mitigation<\/h2>\n
                        \n
                      1. \n

                        Try to avoid the usage of the host header in the server-side code.<\/p>\n<\/li>\n

                      2. \n

                        If the inclusion of the current domain is necessary, then it should be specified in a custom configuration file in the server-side code, and should not depend upon the host header.<\/p>\n<\/li>\n

                      3. \n

                        If the host header specifically is required to be included in the server-side code then it must be validated from a list of whitelisted domains.<\/p>\n<\/li>\n

                      4. \n

                        Disable the support of Host override headers like X-Forwarded-Host, X-Forwarded-For, etc.<\/p>\n<\/li>\n<\/ol>\n

                        Related Blogs<\/h2>\n

                        What is Account Take Over Attack (ATO)?<\/a><\/p>\n

                        ATO Attack Series 1: Cross-Site Request Forgery Account Takeover<\/a><\/p>\n

                        Start Protecting your Credentials Today! Get in touch with CSW for Red Teaming and VMaaS services.<\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"

                        ATO Attack | Password Reset Poisoning<\/p>\n","protected":false},"author":14,"featured_media":7404,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"content-type":"","footnotes":""},"categories":[80,127,123],"tags":[474,475,473,369],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/webdev.securin.xyz\/wp-json\/wp\/v2\/posts\/7409"}],"collection":[{"href":"https:\/\/webdev.securin.xyz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webdev.securin.xyz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webdev.securin.xyz\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/webdev.securin.xyz\/wp-json\/wp\/v2\/comments?post=7409"}],"version-history":[{"count":4,"href":"https:\/\/webdev.securin.xyz\/wp-json\/wp\/v2\/posts\/7409\/revisions"}],"predecessor-version":[{"id":17376,"href":"https:\/\/webdev.securin.xyz\/wp-json\/wp\/v2\/posts\/7409\/revisions\/17376"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webdev.securin.xyz\/wp-json\/wp\/v2\/media\/7404"}],"wp:attachment":[{"href":"https:\/\/webdev.securin.xyz\/wp-json\/wp\/v2\/media?parent=7409"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webdev.securin.xyz\/wp-json\/wp\/v2\/categories?post=7409"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webdev.securin.xyz\/wp-json\/wp\/v2\/tags?post=7409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}