Security Fix for Stored Cross Site Scripting - huntr.dev #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@thehunckerma (https://huntr.dev/users/thehunckerma) has fixed a potential Stored Cross Site Scripting vulnerability in your repository 馃敤. For more information, visit our website (https://huntr.dev/) or click the bounty URL below...
Q | A
Version Affected | *
Bug Fix | YES
Original Pull Request | 418sec#1
If you are happy with this disclosure, we would love to get a CVE assigned to the vulnerability. Feel free to credit @thehunckerma, the discloser found in the bounty URL (below) and @huntr-helper.
User Comments:
馃搳 Metadata *
Bounty URL: https://huntr.dev/bounties/2-other-digidocu/
鈿欙笍 Description *
DigiDocu is rendering the description field in the admin's users page without escaping it. A WYSIWYG editor is provided to the users for the profile description which itself has a built-in sanitizer. The user can bypass the WYSIWYG's default sanitizer by intercepting the request (using Burp Suite for instance) and insert some malicious XSS payload. Our fix is to sanitize the HTML before inserting it into the database.
馃捇 Technical Description *
We are using stevebauman's purify library which is a wrapper around ezyang's htmlpurifier which is a famous standards-compliant HTML filter library.
We replace the description input with the sanitized version before inserting it into the database
馃悰 Proof of Concept (PoC) *
User test is editing his profile:
User test intercepts the request using Burp Suite:
User test adds his XSS payload to the description input:
Admin super visits test's profile, XSS payload gets executed:
馃敟 Proof of Fix (PoF) *
User test is editing his profile:
User test intercepts the request using Burp Suite and adds his XSS payload to the description input:
Admin super visits test's profile, the
<img/>
element is rendered but the XSS payload is not executed:The HTML element is sanitized:
馃憤 User Acceptance Testing (UAT)
There is no unit testing in this project but the feature in question (the WYSIWYG editor) is still working and the HTML is being rendered properly.