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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sanitizing markdown text. #7971

Merged
merged 1 commit into from
Jun 8, 2020
Merged

Conversation

jbicker
Copy link
Contributor

@jbicker jbicker commented Jun 5, 2020

What it does

#7954: It sanitizes the html which is shown in markdown preview.

How to test

  1. Create markdown file
  2. append the following text: <style onload="alert(0)"> and/or <script>"alert(0)"</script>
  3. Save and close the file.
  4. Right click the file and select Open With -> Preview
  5. Observe the alert is not fired.

Review checklist

Reminder for reviewers

@akosyakov akosyakov added markdown issues related to markdown security issues related to security labels Jun 5, 2020
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

@jbicker it looks like some of the markdown tests need to be updated following the changes (CI is red).

@jbicker
Copy link
Contributor Author

jbicker commented Jun 8, 2020

@jbicker it looks like some of the markdown tests need to be updated following the changes (CI is red).

Thanks. looking into it.

Fixes #7954

Signed-off-by: Jan Bicker <jan.bicker@typefox.io>
@jbicker jbicker force-pushed the jbicker/security-xss-vulnerability-7954 branch from 973e208 to e7e92e3 Compare June 8, 2020 09:43
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

The changes look good to me!

I verified that:

  • the new dependency is license approved using our clearly defined process
  • the markdown script is not executed (it is on master)

@jbicker jbicker merged commit 309b218 into master Jun 8, 2020
@jbicker jbicker deleted the jbicker/security-xss-vulnerability-7954 branch June 8, 2020 14:08
@luigigubello luigigubello mentioned this pull request Dec 16, 2020
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
markdown issues related to markdown security issues related to security
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants