Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2023-35794 PoC — Cassia Networks Access Controller 安全漏洞

Source
Associated Vulnerability
Title:Cassia Networks Access Controller 安全漏洞 (CVE-2023-35794)
Description:Cassia Networks Access Controller是美国Cassia Networks公司的一个应用程序。提供一个功能强大的物联网网络管理解决方案。 Cassia Access Controller 2.1.1.2303271039版本存在安全漏洞,该漏洞源于无需身份验证即可访问Web SSH终端端点。
Description
Repository contains description for CVE-2023-35794 discovered by Dodge Industrial Team for Dodge OPTIFY platfrom.
Readme
# CVE-2023-35794-WebSSH-Hijacking
Repository contains description for CVE-2023-35794 discovered by Dodge Industrial Team for Dodge OPTIFY platfrom.
___  
CVE ID: CVE-2023-35794  
Vendor: Cassia Networks  
Product: Access Controller  
Version: Cassia-AC-2.1.1.2303271039  
___
Vulnerability: Incorrect Access Control  
Affected: web ssh, gateways  
Decription: WebSSH session can be hijacked  
Status: Confirmed by vendor, Fixed  
Version Patched: Cassia-AC-2.1.1.2308181707
____
#### Details
Cassia uses WebSSH2 by billchurch to initiate SSH sessions from AC to Gateways. WebSSH2 Is a web SSH Client which uses ssh2, socket.io, xterm.js, and express. 
A bare bones example of an HTML5 web-based terminal emulator and SSH client. It uses SSH2 as a client on a host to proxy a Websocket/Socket.io connection to a SSH2 server.

When a session of WebSSH is established with Gateway Device any external user can hijack it without any authentication and authorization.

Session establishment is done via GET request to proper
```/ap/remote/<mac>?ssh_port=<ac-rev-ssh-port>```
Gateway then receiving request through MQTT (or CAPWAP) channel
and establishes SSH tunnel with local port forwarding to Access Controller.
Then Access-Controller binds to the forwarded port with SSH Web Session.
The user who invoked the web ssh session is redirected to
```/ssh/host``` but the session cookie is not validated. 
The new WebSSH2 cookie is provided with 401 error.
![Alt text](img/1.png)
In fact a user is being asked for providing Basic auth.
![Alt text](img/2.png)
Obtained Basic authentication credentials are sent in next requests
and potentially consumed by webssh2.bundle.js as credentials used to authenticate
to the choosen device.
![Alt text](img/3.png)
![Alt text](img/4.png)
This allows unathorized to Access Controller portal User to hijack already existing SSH session with only knowing SSH username and password (note that
this commonly may be default ```cassia:cassia-<last-mac-6-digits>```).  

____
#### Exploitation

An attacker may use [CVE-2023-35793](https://github.com/Dodge-MPTC/CVE-2023-35793-CSRF-On-Web-SSH) to trick any athenticated user to initiate
a session to any device connected to the AC (note that the user does not need to login into the gateway, the session itself will be initiated with only exploiting CVE-2023-35793 CSRF). Then using this vulnerability
and knowing the MAC address an attacker may easily obtain access to the device
through WebSSH.

Lets assume an attacker triggered someone and the session is established 
to the gateway where the default credentials are used.

1) Attacker just opens the web browser and enters default credentials for known device.
![](img/5.png)
2) Attacker knowing which device were triggered provides default credentials (commonly these are not being changed)
![](img/6.png)
3) Attacker is authenticated to device LXC container as a user which has root rights by default
![Alt text](img/7.png)

#### Remediation
- Patch to the highest possible version availaible on [Cassia Networks](https://www.cassianetworks.com/)
File Snapshot

[4.0K] /data/pocs/dcad2352972ed1c925ee02874f2ec0a6a8b24c8e ├── [4.0K] img │   ├── [131K] 1.png │   ├── [ 26K] 2.png │   ├── [163K] 3.png │   ├── [157K] 4.png │   ├── [129K] 5.png │   ├── [ 34K] 6.png │   └── [ 39K] 7.png └── [3.0K] README.md 1 directory, 8 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. If the original source is unavailable, please email f.jinxu#gmail.com for a local snapshot (replace # with @).
    3. Shenlong has snapshotted the POC code for you. To support long-term maintenance, please consider donating. Thank you for your support.