Skip to content
Path traversal Disclosed report Intermediate CVE-2021-40097

Authenticated path traversal to RCE

An authenticated user with page editing rights could upload a PNG file containing PHP code and then use a path traversal in the bFilename parameter to include that file, leading to remote code execution. This allowed the attacker to run arbitrary system commands and obtain sensitive information.

d3addog Follow

Originally disclosed on HackerOne

High 8.0 View original
  • Triaged in 3 months
  • Fixed in 7 months
  • Disclosed after 8 months

** crayons **

Description

The bFilename parameter in the scenario index.php/ccm/system/dialogs/block/design/submit is vulnerable to remote code execution via path traversal vulnerability. Authenticated attacker with rights to edit web application pages can upload malicious PNG file containing PHP code using any attachment upload functions (for example in comment section of the blog) and then use its relative path in bFilename parameter while editing layout design. The file, supplied in vulnerable parameter will be included in PHP, leading to injected malicious code to run.

Testing setup :

Concrete5 CMS version: 8.5.4 PHP Version: 7.2.24

Steps to reproduce

  1. Login to your Concrete5 account with rights to edit pages
  2. Upload using any attachment upload function png file, containing php code at its end. You can use file png-transparent.png from the attachments . It is empty PNG file with the following payload at its end:
<?php system("uname -a");?>

You can get file path for example by viewing uploaded file properties:

path_to_file.png
path_to_file.png From the original on HackerOne
  1. Navigate to page edit constructor
  2. Select any element (for example Sidebar) and click "Add Layout" -> "Add Layout"
  3. Click on newly added block and select "Edit layout Design" -> Save
  4. Get the request from step 5 from any web proxy (for example Burp Suite) and resend it modifying bFilename with the system relative path to the uploaded file, for example:
bFilename=../../../../application/files/9316/1312/5391/png-transparent.png
  1. Reload the page, your are editing, and see the payload fired
rce_layout_design.png
rce_layout_design.png From the original on HackerOne

Credits

This bug was found as a part of Solar Security CMS Reseach, with https://hackerone.com/d0bby, https://hackerone.com/wezery0, https://hackerone.com/silvereniqma in collaboration. Can you, please, add them to this report?

Impact

Authenticated attacker with page editing rights can run arbitrary system commands and obtain sensitive information

Attachments

The original report as published on HackerOne, by d3addog. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the application fails to sanitise the bFilename parameter, allowing directory traversal and inclusion of arbitrary local files in PHP.

Impact

An authenticated attacker with page editing rights could run arbitrary system commands and obtain sensitive information.

What the attacker needed

Authenticated account with page editing rights; Ability to upload attachments

How it was found

  1. Log in to Concrete5 with an account that has rights to edit pages.
  2. Upload a PNG file that contains PHP code at its end using any attachment upload function.
  3. Obtain the relative path of the uploaded file, for example by viewing its properties.
  4. Navigate to the page edit constructor and add a layout to any element.
  5. Edit the layout design and save, then capture the request with a web proxy.
  6. Modify the bFilename parameter to the relative path of the uploaded file and resend the request.

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

The application lets users with editing rights upload files, such as images. It also has a feature that includes a file based on a user-supplied name, but it does not properly check the path. By uploading a file that contains code and then pointing the application to that file using a path that goes up and down directories, the attacker can make the server run their code.

What is Path traversal?

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

More by d3addog

View all

3 more disclosed reports, best first.

More from Concrete CMS

View all

The newest disclosed reports for this program.

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.