search menu icon-carat-right cmu-wordmark

CERT Coordination Center


PHP FormMail Generator generates code vulnerable to multiple issues

Vulnerability Note VU#608591

Original Release Date: 2017-03-07 | Last Revised: 2017-03-07

Overview

PHP forms generated using the PHP FormMail Generator are vulnerable to stored cross-site scripting and unrestricted upload of dangerous file types.

Description

PHP FormMail Generator is a website that generates PHP form code for inclusion in a PHP-based or Wordpress-based website. The code generated by the website prior to 17 December 2016 is vulnerable to the following:

CWE-434: Unrestricted Upload of File with Dangerous Type - CVE-2016-9492

In the generated form.lib.php file, upload file types are checked against a hard-coded list of dangerous extensions. This list does not include all variations of PHP files, which may lead to execution of the contained PHP code if the attacker can guess the uploaded filename. The form by default appends a short random string to the end of the filename.

CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) - CVE-2016-9493

The name and message fields of the generated PHP form do not properly validate input, allowing an attacker to submit a XSS payload that is then stored by the application. The XSS payload is executed when an administrator accesses the administrator panel.

Impact

An unauthenticated remote attacker may be able to conduct stored XSS attacks against the form administrator, or possibly execute PHP code on the server if the attacker can guess the uploaded filename.

Solution

A full solution is not currently known, however users may consider the following.


Regenerate your PHP form code

The PHP FormMail Generator website as of 2016-12-17 generates PHP code that addresses CVE-2016-9492. Affected users are encouraged to regenerate the PHP form code using the website, or manually apply patches.

However, CVE-2016-9493 is not confirmed addressed in the latest release. Users may manually update their form code to use PHP `htmlentities` or similar methods to prevent XSS in the fields. Alternately, users may need to consider a different form.

Vendor Information

608591
Expand all

PHP FormMail Generator

Notified:  December 16, 2016 Updated:  December 21, 2016

Statement Date:   December 17, 2016

Status

  Affected

Vendor Statement

No statement is currently available from the vendor regarding this vulnerability.

Vendor Information

We are not aware of further vendor information regarding this vulnerability.

Addendum

There are no additional comments at this time.

If you have feedback, comments, or additional information about this vulnerability, please send us email.


CVSS Metrics

Group Score Vector
Base 9.3 AV:N/AC:M/Au:N/C:C/I:C/A:C
Temporal 7.7 E:F/RL:OF/RC:C
Environmental 5.8 CDP:ND/TD:M/CR:ND/IR:ND/AR:ND

References

Credit

Thanks to Ibram Marzouk for reporting this vulnerability.

This document was written by Garret Wassermann.

Other Information

CVE IDs: CVE-2016-9492, CVE-2016-9493
Date Public: 2016-12-17
Date First Published: 2017-03-07
Date Last Updated: 2017-03-07 16:19 UTC
Document Revision: 28

Sponsored by the Department of Homeland Security Office of Cybersecurity and Communications.