Skip to content
RCE Write-up Intermediate

On-Premise-01: Exploiting CVE-2023–3452 in the Canto WordPress

The Canto WordPress plugin version 3.0.4 contained an unauthenticated remote file inclusion flaw in its download.php file, allowing an attacker to supply an external URL via the wp_abspath parameter. When PHP's allow_url_include was enabled, the server fetched and executed arbitrary PHP code, leading to remote code execution.

M.Humayun Follow

Published on medium.com

Overview During a simulated red team engagement against Secure Corp, I identified a critical vulnerability in the Canto WordPress plugin (v3.0.4), used for digital asset management. The plugin was found to be susceptible to an unauthenticated Remote File Inclusion (RFI) flaw, tracked as CVE-2023–3452, which allowed…

M.Humayun, on medium.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 plugin used user input directly in a require_once call without validation, and the server had allow_url_include enabled.

Impact

An unauthenticated attacker could execute arbitrary commands on the server, leading to full system compromise.

What the attacker needed

Canto plugin ≤ v3.0.4 installed; allow_url_include enabled; attacker can host a file publicly

The fix

The plugin should be updated to a version that does not use user input in require_once, and allow_url_include should be disabled.

How it was found

  1. Check the plugin's readme.txt to confirm version 3.0.4 is installed.
  2. Create a malicious PHP file named admin.php that executes system commands.
  3. Host the malicious file on a publicly accessible web server.
  4. Send a request to download.php with the wp_abspath parameter pointing to the hosted file and a cmd parameter to run a command.
  5. Verify remote code execution by running the id command.
  6. List the root directory and read the flag file using the cmd parameter.

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.

A WordPress plugin had a file that blindly trusted a user-supplied web address and used it to load another file. If the server was configured to allow loading files from the internet, an attacker could point it to their own malicious file, which the server would then run as if it were part of the site. This gave the attacker full 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.

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.