Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed CVE-2023-2318 DOM-based XSS in MarkText bug #3621

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Teloshav
Copy link

@Teloshav Teloshav commented May 7, 2023

Q A
Bug fix? yes
New feature? no
Breaking changes? no
Deprecations? no
New tests added? not needed
Fixed tickets Fixes #3618
License MIT

Description

In ticket #3618 there was a DOM-based XSS which allowed "arbitrary JavaScript code to run in the context of MarkText main window." (quoted from @chromium1337, the author of ticket #3618), I also updated caniuse-lite while getting the build to work, not exactly sure what that does; but there you go! 馃榿

It's my first proper pull request to an open source project! I hope I've done everything right. Very happy to finally do a bug fix! :D 馃コ

Edit: Seems like my fix won't allow for link pasting now that I've just tried it. I'll have to see what is happening with that.

@Teloshav
Copy link
Author

Edit: Seems like my fix won't allow for link pasting now that I've just tried it. I'll have to see what is happening with that.

@@ -116,7 +116,7 @@ const pasteCtrl = ContentState => {
link.innerHTML = sanitize(title, PREVIEW_DOMPURIFY_CONFIG, true)
} else {
const span = document.createElement('span')
span.innerHTML = text
span.innerHTML = sanitize(title, PREVIEW_DOMPURIFY_CONFIG, true)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question: shouldn't the text where the title is? for example sanitize(text, PREVIEW_DOMPURIFY_CONFIG, true)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Security Issue: DOM-Based XSS leading to RCE
2 participants