Skip to content
Path traversal Write-up Intermediate

Support Board 3.3.4 Arbitrary File Deletion to Remote Code Execution

The delete-file function in Support Board 3.3.4 only restricted deletions to the uploads directory when the supplied path contained the string 'http'; any other path was passed straight to unlink. An authenticated attacker could therefore delete arbitrary files, and by deleting a WordPress wp-config.php file they could trigger a reinstall and gain code execution.

noob3xploiter.medium.com

Published on noob3xploiter.medium.com

Hi. In this writeup, i will show you a bug that i found.

Brandon Roldan, on noob3xploiter.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 code decided whether to confine the deletion to the uploads directory based on whether the user-supplied path contained the substring 'http', rather than validating the resolved path, so other paths reached unlink unchecked.

Impact

An authenticated user could delete arbitrary files, and by removing wp-config.php could reinstall WordPress and achieve remote code execution; the text notes there is no CSRF protection, so this could be chained with CSRF.

What the attacker needed

An authenticated account; WordPress installed for the RCE chain

The fix

It was fixed in version 3.3.6.

How it was found

  1. Create a test file in a known location on the server
  2. Send a request to the delete-file function with the path of that file
  3. Observe that the file is deleted
  4. Send a request with the path of the WordPress wp-config.php file
  5. Visit the site and complete the WordPress reinstall to gain code execution

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 plugin had a file-deletion feature that was meant to only remove files inside its own uploads folder. The check for that folder was skipped whenever the supplied path did not contain the text 'http', so a logged-in user could ask it to delete any file on the server. Deleting a site's configuration file can let an attacker reinstall the site and take it over.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.