Subscribe

XSS (cross-site scripting vulnerabilities)

  1. 2010-09-01 07:00:27 PDT
    Hello! My name is Bogdan Calin. I'm a security researcher at Acunetix (http://www.acunetix.com). You can contact me at this email address: bogdan [at] acunetix.com I wanted to contact you on a private channel (because I'm reporting security issues), however the only contact information I could find was this forum. I would like to report a list of XSS vulnerabilities in NuSOAP. In various files contained in the NuSOAP library, you echo the contents of the $_SERVER['PHP_SELF'] variable without properly encoding it. Here are a few cases (I'm using the latest version of NuSOAP, version 0.9.5): Filename lib\nusoap.php, line 5429 <p>View the <a href="'.$PHP_SELF.'?wsdl">WSDL</a> for the service. $PHP_SELF is initialized before as $PHP_SELF = $_SERVER['PHP_SELF']; Same situation in file class.wsdl.php, line 847 <p>View the <a href="'.$PHP_SELF.'?wsdl">WSDL</a> for the service. This makes it vulnerable to XSS. By using an URL like http://site/filename.php/1%3CScRiPt%3Eprompt(923395)%3C/ScRiPt%3E it's possible to execute Javascript code. Our scanner found an XSS vulnerability in a popular application that is using NoSOAP and that's how we got to you. I hope you will fix this problem. Thanks in advance and have a nice day! Bogdan
  2. 2010-09-02 12:53:21 PDT
    (Monitoring)
  3. 2010-09-03 07:04:05 PDT
    @dhx1 Why use htmlentities() and not htmlspecialchars() ? Also, why not just protect the definition of $PHP_SELF instead of all of its uses ?
  4. 2010-09-03 08:40:40 PDT
    Is there really a need for keeping the things that may be appended to index.php to access the index.php?wsdl (hence using htmlentities() or htmlspecialchars() ) ? Me thinks that just doing : $PHP_SELF = substr($_SERVER['PHP_SELF'], 0, (strlen($_SERVER['PHP_SELF']) - strlen($_SERVER['PATH_INFO']))); could be fine. See my proposed patch : http://git.debian.org/?p=users/olberger-guest/nusoap.git;a=blob;f=debian/patches/595248.patch;h=6af3d725fe74d839764d9755c5bb18458a192518;hb=268f03b88c6900d1a87b17734c248c705c22cb07
  5. 2010-09-04 01:42:31 PDT
    Oh, and Btw (thanks to Raphael Geissert who made me notice), the PHP_SELF use for the ?wsdl link is useless. It's enough to do ...<a href="?wsdl">... I think that's gonna be the patch I'll include in an updated Debian package.
  6. 2010-09-04 07:10:10 PDT
    Thanks Oliver, I agree with your comments about my patch. I had made it in a hurry and as such made it overkill (htmlentities vs htmlspecialchars, escaping every variable echoed) to ensure that it was 100% safe vs the most efficient/elegant solution. The section of code affected strikes me as being hard to read/understand (joke variable names, etc) so I was trying to use the simplest approach. I'm not too keen on the substr() approach you've suggested as it doesn't seem to acknowledge that any part of the path could contain special HTML characters. While it wouldn't necessarily be a security issue (however it could turn into a security problem), it'd still be possible to produce invalid HTML output. If it's possible to remove the echoing of PHP_SELF entirely (or replace it with ?wsdl as suggested) then I'd go with that approach. I was also mindful of the other variable names that were being echoed and whether they need escaping too. Because the variable names are obfuscated I couldn't be bothered wasting time figuring out what the variables could contain (whether the user sets them, etc). Hopefully upstream can look into this soon.
  7. 2010-09-04 09:37:47 PDT
    I haven't checked in detail the other variables that are echoed, but I think they're there to provide the docs for the web service in the page, so I think they're generated from the program's API and thus harmless XSS-wise. But just my guessing having read quickly through. I've now prepared a patched Debian package that will hopefull include the following patch (both for 0.7.3 and 0.9.5) : see latest commits in http://git.debian.org/?p=users/olberger-guest/nusoap.git;a=shortlog;h=refs/heads/testing-security and http://git.debian.org/?p=users/olberger-guest/nusoap.git;a=shortlog;h=refs/heads/debian Hope this helps. Best regards,
Jump To:
< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.