Visitorbook LE Multiple Vulnerabilities

From: Paul Johnston (paul_at_westpoint.ltd.uk)
Date: 12/10/03

  • Next message: der Mouse: "Re: Dell BIOS DoS"
    Date: Wed, 10 Dec 2003 11:19:20 +0000
    To: bugtraq@securityfocus.com
    
    

    Westpoint Security Advisory

    Title: VisitorBook LE Mail Relay and Cross Site Scripting
    Risk Rating: Moderate
    Software: FreeScripts VisitorBook LE
    Platforms: Most Unix
    Vendor URL: http://www.freescripts.com/
    Author: Paul Johnston <paul@westpoint.ltd.uk>
    Date: 10th December 2003
    Advisory ID#: wp-03-0001

    Overview
    ========

    VisitorBook is a "customizable, database-driven guestbook software ...
    used all
    over the net", which fails to escape various control characters in user
    input.
    This results in:

      * Mail relaying
      * Data loss
      * Cross site scripting

    Details
    =======

    Open mail relay
    ---------------
    If $mailuser is set to 1 (not the default) then the script can be used as a
    mail relay. This arises because line breaks are not escaped in the email
    field,
    so you can relay mail by setting the email address to something like:

      victim@example.com
      From: spammer@example.com
      Subject: $$$ hardcore XXX
      ...

    Guestbook database deleting / DoS
    ---------------------------------
    Another consequence of the script failing to escape line breaks is that
    anyone
    can remotely delete the log - they just need to submit an entry with
    more line
    breaks that the value of $max_posts.

    If you do this with Windows line breaks, then the database file is so
    corrupted
    afterwards that the script always gives "500 Internal Server Error".

    The script also fails to escape pipe "|" characters, which it uses as a
    field
    deliminator, although it's unlikely this can be exploited.

    Cross site scripting
    --------------------
    The "do" parameter is not escaped at all, which you can exploit like:
      http://fester/cgi-bin/visitorbook.pl?do=>alert('hello')</script>

    The user parameter is also not escaped. To exploit this you need to use
    a rogue
    DNS server to poison the script with a malicious reverse DNS response. More
    about this below. Note: this would be difficult to exploit in practice
    and was
    not actually exploited in my tests.

    Quote marks are not escaped in any parameters. You can exploit this by
    signing
    an entry with a web link like this:
      http://" onmouseover="alert('hello')" crap="

    Also, ampersands (&) are not escaped in any parameters, although it's
    unlikely
    this can be exploited.

    Trust of reverse dns
    --------------------
    The script uses the logic that it logs the user's reverse DNS name if
    available, or IP address otherwise. The problem with this is that the
    reverse
    DNS is untrusted data - someone can easily change their identity by setting
    their reverse DNS to, say, "www.whitehouse.gov". This also leads to the
    cross-
    site scripting attack mentioned above.

    Workarounds
    ===========

    Mail relay
      Disable user mails, by setting $mailuser to 0
    Data deleting
      Modify code to escape line break characters on all parameters
    Cross site scripting
      Modify code to escape <>&" characters on all parameters
    Trusting reverse DNS
      In Apache config set HostNameLookups to Off

    Vendor notification
    ===================

    4 Nov 2003 Mailed all the email addresses in the source code, whois
    contacts
                  for domain.
                  No response.

    5 Nov 2003 Raised a support ticket.
                  The vendor indicated that the free version of the code had not
                  been maintained for some time, but that sharing security
    related
                  findings would be much appreciated.

    10 Nov 2003 First detailed notification of vulnerabilities.
                  No response.

    21 Nov 2003 Passed draft advisory to vendor; indicated intention to
    publish
                  on 10 Dec.
                  No response.

    9 Dec 2003 Reminded vendor of impending publication.
                  No response.

    This advisory is available online at:
      
    http://www.westpoint.ltd.uk/advisories/wp-03-0001.txt

    -- 
    Paul Johnston
    Internet Security Specialist
    Westpoint Limited
    Albion Wharf, 19 Albion Street,
    Manchester, M1 5LN
    England
    Tel: +44 (0)161 237 1028
    Fax: +44 (0)161 237 1031
    email: paul@westpoint.ltd.uk
    web: www.westpoint.ltd.uk
    

  • Next message: der Mouse: "Re: Dell BIOS DoS"

    Relevant Pages

    • Re: sed replace with html code and variables
      ... I'm trying to write a bash script that will do a replace among ... that I am running this command on... ... Even more so, in the RHS of a substitution, you don't need to escape ... double quotes in the RHS. ...
      (comp.unix.shell)
    • Re: Disabling shell expansion
      ... >> The read script does indeed work, however thats not the enviroment I'm ... Basically I"m looking for a way to send these two lines as an argument to a shell command, without having to escape each ... character (because in OTHER error messages windows already escapes certain characters, so I'd end up escaping the ...
      (comp.unix.shell)
    • Re: laptops
      ... >> Perhaps can modify that script to add a call to your app shutdown ... > the vendor doesnt know, all they said is that it does the same thing as ... All i can see it does is sync file systems then off it goes ...
      (comp.unix.solaris)
    • Re: Escaping a plus sign
      ... On Tuesday 30 May 2006 14:23, Anthony Ettinger wrote: ... I have a perl script that runs nightly. ... Is there a way to escape this character so in the future it won't kill ... Paul Nowosielski ...
      (perl.beginners)
    • Re: script
      ... On 5/22/06, Daniel Hedlund wrote: ... > The issue is that it doesnot cd to the directory after running the ... this could be your problem; you'll need to escape the ... Now the script looks like ...
      (Fedora)