Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

XSS fix - Remove onload handler from svg element - #1

Open
d3v53c wants to merge 1 commit into
418sec:masterfrom
d3v53c:huntr/xss-01
Open

XSS fix - Remove onload handler from svg element#1
d3v53c wants to merge 1 commit into
418sec:masterfrom
d3v53c:huntr/xss-01

Conversation

@d3v53c

@d3v53c d3v53c commented Feb 17, 2021

Copy link
Copy Markdown

馃搳 Metadata *

tui.editor is vulnerable to Cross-Site Scripting (XSS).

Bounty URL: https://www.huntr.dev/bounties/1-other-tui.editor/

鈿欙笍 Description *

TOAST UI Editor provides Markdown mode and WYSIWYG mode. Depending on the type of use you want like production of Markdown or maybe to just edit the Markdown. The TOAST UI Editor can be helpful for both the usage. It offers Markdown mode and WYSIWYG mode, which can be switched any point in time.

馃捇 Technical Description *

Fixed XSS by sanitizing user inputs before updating DOM elements, in this an edge case was arisen due to an onload event handler not properly sanitized/removed while updating the DOM elements in the editor.

馃悰 Proof of Concept (PoC) *

  1. Open https://nhn.github.io/tui.editor/latest/tutorial-example01-editor-basic
  2. Insert the xss payload in editor Ex: <svg> <svg><svg onload=alert(111)> <svg>
  3. XSS payload will get executed.

馃敟 Proof of Fix (PoF) *

// index.html
image

// script.js

const editor = new toastui.Editor({
  el: document.querySelector('#editor')
});

output:
image

馃憤 User Acceptance Testing (UAT)

After the fix, functionality is unaffected.

馃敆 Relates to...

418sec/huntr#1911

huntr-helper pushed a commit to 418sec/huntr that referenced this pull request Feb 17, 2021
@huntr-helper

Copy link
Copy Markdown

馃憢 Hello, @shiren - @d3v53c has opened a PR to us with a fix for a potential vulnerability in your repository. To view the vulnerability, please refer to the bounty URL in the first comment, above.

Ultimately, you get to decide if the fix is 馃憤 or 馃憥. If you are happy with the fix, please write a new comment (@huntr-helper - LGTM) and we will open a PR to your repository with the fix. All remaining PRs for this vulnerability will be automatically closed.

If you have any questions or need support, come and join us on our community Discord!

@shiren & @d3v53c - thank you for your efforts in securing the world鈥檚 open source code! 馃帀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants