Skip to content
Path traversal Write-up Intermediate

Form Tools Remote Code Execution: We Need To Talk About PHP

A pre-authentication local file inclusion in Form Tools' installation script allows an attacker to include arbitrary PHP files, and by leveraging the PEAR command-line tool, write a malicious PHP file to disk and execute it, achieving remote code execution.

watchTowr Follow

Published on labs.watchtowr.com

This research is a glimpse into the capability powering the watchTowr Platform, a Preemptive Exposure Management solution. We enable organizations to autonomously validate and mitigate their exposure to emerging threats, ahead of in-the-wild exploitation.

watchTowr (@watchtowrcyber), on labs.watchtowr.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 application concatenates user input directly into a file path used in an include() statement without proper validation, allowing directory traversal and inclusion of arbitrary PHP files.

Impact

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

What the attacker needed

Form Tools version 3.1.1 installed; PEAR installed on the server; register_argc_argv enabled in PHP

The fix

The project is no longer maintained; users should remove the installation file or block access to it.

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 application takes a language setting from the user and uses it to load a file without checking it. An attacker can trick it into loading a different file, and by using a built-in tool called PEAR, they can create a new file with harmful code and run it on the server.

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 watchTowr

View all

3 more disclosed reports, best first.

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.