Skip to content
RCE Write-up Intermediate

eFront <= 3.6.10 (save_template.php) PHP Code Injection Vulnerability

The save_template.php script in eFront accepted user-supplied template name and content parameters without proper sanitisation and wrote them to a file via file_put_contents(). A remote attacker could inject and execute arbitrary PHP code on the server.

karmainsecurity.com

Published on karmainsecurity.com

eFront contains a flaw which allows a remote attacker to inject and execute arbitrary PHP code. The issue is due to the www/editor/tinymce/plugins/savetemplate/savetemplate.php script which fails to properly sanitize user-supplied input passed via the ‘templateName’ and ‘templateContent’ parameters before use it in a…

The author, on karmainsecurity.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 script passed unsanitised user input directly to file_put_contents(), allowing attacker-controlled content to be written into an executable PHP file.

Impact

A remote attacker could inject and execute arbitrary PHP code on the affected server.

What the attacker needed

Access to the save_template script

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.

This software lets users save a template, and the code that saves it writes whatever the user typed straight into a file on the server. Because the file is a PHP script, an attacker can put PHP code in the template content and the server will run it. That gives the attacker control over the web 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.