#7528 XSS on wiki page and preview

v1.2.0
closed
General
nobody
2015-08-20
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

Discussion

  • Dave Brondsema

    Dave Brondsema - 2014-07-03

    Simplified test case:

    <div/onload><img src=x onerror=alert(document.cookie)>
    
     
  • Dave Brondsema

    Dave Brondsema - 2014-07-03
    • status: open --> in-progress
    • assigned_to: Dave Brondsema
    • Size: --> 2
     
  • 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

     
  • Dave Brondsema

    Dave Brondsema - 2014-07-03
    • status: in-progress --> code-review
     
  • .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'}
    
     
    • status: code-review --> in-progress
     
  • Dave Brondsema

    Dave Brondsema - 2014-07-07

    Added a commit to fix that.

     
  • Dave Brondsema

    Dave Brondsema - 2014-07-07
    • status: in-progress --> code-review
     
    • status: code-review --> closed
     
  • Dave Brondsema

    Dave Brondsema - 2014-07-07
    • status: closed --> code-review
    • private: Yes --> No
     
  • Dave Brondsema

    Dave Brondsema - 2014-07-08
    • status: code-review --> closed
     
  • Dave Brondsema

    Dave Brondsema - 2014-07-08

    Tests fixed to be reliable.

     
  • Dave Brondsema

    Dave Brondsema - 2015-01-05
    • Milestone: unreleased --> asf_release_1.2.0
     

Log in to post a comment.