[UNIX] sh-httpd Wildcard Character Vulnerability

From: SecuriTeam (support_at_securiteam.com)
Date: 10/28/03

  • Next message: SecuriTeam: "[TOOL] Btscanner - Bluetooth Scanner"
    To: list@securiteam.com
    Date: 28 Oct 2003 11:01:00 +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

    - - - - - - - - -

      sh-httpd Wildcard Character Vulnerability
    ------------------------------------------------------------------------

    SUMMARY

     <http://lrp.steinkuehler.net/Packages/weblet.htm> sh-httpd is "a shell
    script-based web server that supports GET and HEAD methods and a CGI 1.1
    interface". A vulnerability in the product allows remote attackers to
    execute and read any file they desire by requesting filenames with
    wildcards.

    DETAILS

    Vulnerable systems:
     * sh-httpd version 0.4
     * sh-httpd version 0.3

    By requesting a filename from a remote host and inserting a wildcard ('*')
    with the filename, a remote attacker can read any file from the remote
    server or execute any CGI the attacker desires.

    Examples:
    GET *
    GET ../../../sh-httpd/p*
    GET /../../etc/s*
    GET ../../root/.b*

    Patch:
     === sh-httpd.patch ===

    --- sh-httpd-0.4/sh-httpd Mon Oct 9 11:28:05 2000
    +++ sh-httpd.patch Sat Jul 19 08:51:44 2003
    @@ -31,7 +31,7 @@

     bname() {
            local IFS='/'
    - set -- $1
    + set -- "$1"
            eval rc="\$$#"
            [ "$rc" = "" ] && eval rc="\$$(($# - 1))"
            echo "$rc"
    @@ -262,7 +262,7 @@

            # Split URI into base and query string at ?
            IFS='?'
    - set -- $URI
    + set -- "$URI"
            QUERY_STRING="$2"
            URL="$1"
            IFS=$OIFS
    @@ -292,7 +292,7 @@
            fi

            DIR="`dname $URL`"
    - FILE="`bname $URL`"
    + FILE="`bname "$URL"`"

            # Check for existance of directory
            if [ ! -d "$DOCROOT/$DIR" ]; then
     === eof ===

    ADDITIONAL INFORMATION

    The information has been provided by <mailto:xploit_@_hackermail.com>
    dong-h0un U.

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

    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: "[TOOL] Btscanner - Bluetooth Scanner"

    Relevant Pages