Skip to content
Path traversal Write-up Intermediate

CVE-2024–6648: Mi primer CVE

A hidden base64-encoded configuration parameter in a PrestaShop page builder plugin contained a server file path that the backend used without validation. By changing that path, an attacker could read arbitrary files on the server, such as the system password file.

medium.com

Published on medium.com

Verano de 2024. Aunque atravesaba un momento complicado a nivel personal, decidí dedicar parte de mi tiempo libre a investigar algunos dominios de entidades españolas.

n0d0n, 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

Likely the backend passed the user-supplied product_item_path value directly to a file-reading function without validating or restricting the path.

Impact

An attacker could read confidential files such as database credentials, potentially leading to further compromise, and the base64 encoding could help bypass some web application firewalls.

What the attacker needed

Access to a PrestaShop store using the plugin; plugin version before 3.0.0

The fix

The plugin was fixed in version 3.0.0, with all earlier versions vulnerable.

How it was found

  1. Inspect the page source and find the hidden input with class apconfig whose value is base64-encoded.
  2. Decode the value to see a JSON configuration containing a product_item_path field with an absolute server path.
  3. Find in the page JavaScript that the input value is sent as the config parameter in a GET request to the module's apajax.php endpoint.
  4. Modify the product_item_path in the decoded JSON to point to a sensitive file such as the system password file, re-encode it, and send the request.
  5. Observe that the server returns the contents of the requested file.

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 web page sent a hidden setting to the server that included the location of a template file on the server's disk. The server trusted that location and opened whatever file was named there. Because the setting was only encoded, not checked, someone could point it at a sensitive system file and read it.

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.