Skip to content
RCE Write-up Intermediate

PandoraFMS 755 - Chained XSS + .htaccess RCE CVE-2021-36698, CVE-2021-36697

The File Manager in Pandora FMS 755 allowed an admin to upload files with unrestricted extensions, including overwriting the .htaccess file to make a custom extension execute as PHP. A lower-privileged user could also store JavaScript in an Event Filter, which ran when an admin viewed the Events tab, enabling a chain to remote code execution.

k4m1ll0.com

Published on k4m1ll0.com

Back to the advisories · Contact

k4m1ll0, on k4m1ll0.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 File Manager did not restrict file extensions or prevent overwriting server configuration files, and the Event Filter did not sanitise stored input.

Impact

An attacker with admin access could execute arbitrary PHP code; a lower-level user could use stored XSS to perform the same actions when an admin views the Events tab.

What the attacker needed

Admin access for direct RCE; lower-level user for XSS chain; victim (admin) views Events tab

The fix

The text does not state the exact fix, but the vendor released Pandora FMS 757, which likely restricts file extensions and sanitises the Event Filter input.

How it was found

  1. Log in to Pandora FMS.
  2. Overwrite the .htaccess file in a web-accessible folder with a rule to execute a custom extension as PHP.
  3. Upload a file with the custom extension containing PHP code.
  4. Request the uploaded file to execute the PHP code.

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 File Manager is a tool for uploading files to the web server. It let an admin upload a configuration file that tells the web server to treat a new file type as executable code. Separately, a lower-level user could save JavaScript in an event filter, and that script ran when an admin looked at the events page, letting the attacker perform admin actions.

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.