Skip to content
RCE Write-up Intermediate

Remote code execution in aaPanel - CVE-2025-48702

The aaPanel sub-panel's file compression feature passed user-controlled filenames directly to the tar command, allowing an authenticated low-privileged subaccount to inject tar options and execute arbitrary commands on the server.

fenrisk.com

Published on fenrisk.com

aaPanel is a free and open-source web hosting control panel designed to simplify server management for Linux-based systems. It provides a graphical interface to manage web servers, websites,…

The author, on fenrisk.com

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 write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The application built the tar command from user-supplied filenames without separating options from file arguments, so filenames beginning with dashes were interpreted as tar options.

Impact

An authenticated low-privileged subaccount could execute arbitrary commands on the underlying server, escalating beyond the restricted sub-panel features.

What the attacker needed

A subaccount on the commercial sub-panel; access to the file manager; ability to upload files

The fix

The vulnerability was fixed in version 7.0.20, likely by preventing filenames from being interpreted as tar options.

How it was found

  1. Log in to the sub-panel as a subaccount and open the file manager.
  2. Create two empty files whose names look like tar options, one to enable checkpoints and one to run a command.
  3. Upload a shell script to the same directory.
  4. Send a compress request that includes the crafted filenames in the files list.
  5. The server runs tar, which treats the filenames as options and executes the shell script.

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 write-up has not been written yet. The Original tab links to the source.

When you click 'compress' in a file manager, the server runs a command-line program called tar to make the archive. The bug is that the server let the names of the files you selected become extra options for that program, and some options tell tar to run a shell command. So a low-privileged user could make the server run any command they wanted.

What is RCE?

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

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.