Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security Fix for Cross-site Request Forgery (CSRF) - huntr.dev #63

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

huntr-helper
Copy link

https://huntr.dev/users/alromh87 has fixed the Cross-site Request Forgery (CSRF) vulnerability 馃敤. Think you could fix a vulnerability like this?

Get involved at https://huntr.dev/

Q | A
Version Affected | ALL
Bug Fix | YES
Original Pull Request | 418sec#2
Vulnerability README | https://github.com/418sec/huntr/blob/master/bounties/other/node-login/1/README.md

User Comments:

馃搳 Metadata *

Bounty URL: https://www.huntr.dev/bounties/1-other-node-login

鈿欙笍 Description *

node-login is a template for quickly building login systems on top of Node.js & MongoDB. It is vulnerable to CSRF attacks in Update and Delete profile actions

馃捇 Technical Description *

Avoid CSRF by using csrf token using csurf

馃悰 Proof of Concept (PoC) *

  1. Download and setup node-login
  2. Go to http://localhost:3000/signup and create an account
  3. Create payload and serve trough web
<html>
  <!-- CSRF PoC - generated by Burp Suite Professional -->
  <body>
  <script>history.pushState('', '', '/')</script>
    <form action="http://localhost:3000/home" method="POST">
      <input type="hidden" name="name" value="hacked" />
      <input type="hidden" name="email" value="hacked&#64;test&#46;com" />
      <input type="hidden" name="country" value="Afghanistan" />
      <input type="hidden" name="pass" value="hacked" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html>
  1. Open payload from same browser as logged in user and click on Submit button
  2. User data has been tempered with
    Captura de pantalla de 2020-12-07 21-08-45

馃敟 Proof of Fix (PoF) *

After fix data is unafected as csrf token is requiered for post actions

Captura de pantalla de 2020-12-17 10-02-44

馃憤 User Acceptance Testing (UAT)

All functinality is unafected
Captura de pantalla de 2020-12-07 21-44-31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants