Skip to content
RCE Advisory Intermediate CVE-2023-37469

GHSL-2022-119: Arbitrary command execution in CasaOS - CVE-2023-37469

The CasaOS application did not sanitise user-supplied parameters when mounting an SMB share, allowing an authenticated user to inject shell commands via the password field. An attacker could execute arbitrary commands on the server by connecting to a malicious SMB share.

Kwstubbs Follow

Originally disclosed on GitHub Security Lab

If an authenticated user using CasaOS is able to successfully connect to a controlled SMB server, they are able to execute arbitrary commands.

Kwstubbs, on GitHub Security Lab

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

An authenticated user could execute arbitrary commands on the CasaOS server, potentially leading to full compromise.

What the attacker needed

Authenticated user; control of an SMB server

The fix

The vulnerability was fixed in version v0.4.4 by properly sanitising the inputs before passing them to the shell command.

How it was found

  1. Create an SMB share with any path, share name, and username.
  2. Set the password of the user to a value that includes a shell command injection.
  3. In CasaOS, go to Files -> Location -> Connect Network Storage and enter the share path, username, and password.
  4. The injected command executes on the server.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When you connect to a network drive, the app builds a command to do the connection. If it puts your input directly into that command without cleaning it, you can sneak in extra commands. Here, the password field was used to run any command on the server.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Kwstubbs

View all

43 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.