Skip to content
RCE Write-up Intermediate

Bughunt Authenticated Rce Found In Horizontcms Part 1 Malicious Plugins

An authenticated user could upload a modified plugin containing malicious PHP code, which would execute when a specific plugin action was performed, leading to remote code execution. The attacker could run arbitrary commands on the server.

bigb0ss Follow

Published on infosecwriteups.com

A couple of weeks ago, I teamed up with my buddy, Chi Tran, to do some bug hunting on an open-source CMS application, HorizontCMS. This application was created by @ttimot24.

bigb0ss, on infosecwriteups.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

Likely, the application allows authenticated users to upload and activate plugins without validating or sandboxing the PHP code within them, so malicious code in plugin files is executed by the server.

What the attacker needed

Authenticated user account; ability to upload plugins

The fix

The application should validate and sandbox plugin code, or restrict plugin uploads to trusted administrators, to prevent execution of malicious PHP.

How it was found

  1. Zip the sample GoogleMaps plugin and upload it; it is automatically unzipped.
  2. Install and activate the plugin.
  3. Add an arbitrary location using the plugin's 'Add location' function and observe the success message.
  4. Modify the plugin's message.php file to include a PHP reverse shell.
  5. Re-zip the modified plugin and upload it again.
  6. Add a location again to trigger the reverse shell and gain RCE.

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.

The content management system lets users install plugins, which are like add-ons that add new features. The plugin files are not checked for harmful code, so someone with an account can upload a plugin that runs commands on the server when used. This gives the attacker control over 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 bigb0ss

View all

1 more disclosed report, best first.

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.