Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#7528 XSS on wiki page and preview

forge-jul-11
closed
nobody
General
2
2014-07-08
2014-07-03
Chris Tsai
No

Confirmed and reproduced here: https://sourceforge.net/p/strawhat/private-wiki/Swapnil_XSS/

This also affects live wiki pages, not just the previews

Original message from user, Swapnil Thaware:

Respected Authorities,

My name is Swapnil A. Thaware and I am a Security Researcher from India. I have found security vulnerability in​ sourceforge.net. Here I am giving the details of the vulnerability found in sourceforge.net.

Vulnerability : Stored XSS

Vulnerability Description : Cross-Site Scripting (XSS) attacks are a type of injection, in which malicious scripts are injected into otherwise benign and trusted web sites. XSS attacks occur when an attacker uses a web application to send malicious code, generally in the form of a browser side script, to a different end user. Flaws that allow these attacks to succeed are quite widespread and occur anywhere a web application uses input from a user within the output it generates without validating or encoding it.

An attacker can use XSS to send a malicious script to an unsuspecting user. The end user’s browser has no way to know that the script should not be trusted, and will execute the script. Because it thinks the script came from a trusted source, the malicious script can access any cookies, session tokens, or other sensitive information retained by the browser and used with that site. These scripts can even rewrite the content of the HTML page.

Step to Reproduce :
1) Login to Account
2) Goto wiki Section then Click on Create Page
3) Write a name
4) and then put XSS Payload in Content box then click on Preview button.
5) Boooommmm !! we get the popup

XSS Payload :

<body onLoad=confirm(0)> "><svg/onload=alert(document.cookie)> ">"<img src=x onerror=prompt(document.domain)>"> "><ScRiPt>alert("Hami Hax")<%2FScRiPt> "><img src=x onerror=prompt('Xss');> “><img src=x onerror=alert(document.cookie)> ';alert(String.fromCharCode(88,83,83))//';alert(String.fromCharCode(88,83,83))//"; alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//-- ></SCRIPT>">'><SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT>

POC : I added a screenshot in attachment, please kindly check the attachment.

Kindly let me know when the vulnerability is fixed and I am eligible for any acknowledgement or any reward.​

1 Attachments

Related

Chat: 53bb11110594ca1076d2f969
Chat: 53bb11110594ca1076d2f96c
Chat: 53bc228f0594ca1076d2f975
Chat: 53bc228f0594ca1076d2f978

Discussion

  • Dave Brondsema
    Dave Brondsema
    2014-07-03

    Simplified test case:

    <div/onload><img src=x onerror=alert(document.cookie)>
    
     
    Last edit: Dave Brondsema 2014-07-03
  • Dave Brondsema
    Dave Brondsema
    2014-07-03

    db/7528

    First, on master branch, put the XSS sample in a wiki page and view it. This should cache the result in mongo. Switch to the branch and confirm that the XSS no longer executes (cache is invalidated, and the new HTML rendering is safe).

    Also find complex markdown already in use (e.g. macros, formatting, raw html, on SourceForge etc) and put it in wiki pages and/or anywhere else and make sure it renders the same with the new sanitization library.

    Corresponding minor SF test updates in forge-classic:db/7528

     
  • .E..
    ======================================================================
    ERROR: alluratest.test_syntax.test_no_prints
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/var/local/env-allura/lib/python2.7/site-packages/nose-1.3.0-py2.7.egg/nose/case.py", line 197, in runTest
        self.test(*self.arg)
      File "/home/aluberg/aluberg-4084/forge/AlluraTest/alluratest/test_syntax.py", line 100, in test_no_prints
        raise Exception("These should use logging instead of print")
    Exception: These should use logging instead of print
    -------------------- >> begin captured stdout << ---------------------
    Allura/allura/lib/markdown_extensions.py:        print text
    
    --------------------- >> end captured stdout << ----------------------
    
    ----------------------------------------------------------------------
    Ran 4 tests in 19.476s
    
    FAILED (errors=1)
    finished nosetests  --cover-package=alluratest --processes=4 --process-timeout=180 {'cwd': 'AlluraTest'}
    
     
    Last edit: Alexander Luberg 2014-07-07


Anonymous


Cancel   Add attachments