You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, I was trying to reimplement this library without Vue for the browser and saw that this depends on markdown-it-katex, which is a library (abandoned a long time ago), you can see in this issue that there are a bunch of forks because it's abandoned.
And there lies a XSS vulnerability. It happens when there is a syntax error in the Latex, the text is just dumped as HTML without escaping.
This can't be reproduced by the live demo because it's on a old branch with code that does not implement katex, so we actively run a different code in production than the one we can test live here.
But in the original issue there is a proof of concept.
Also by default this library sets html input to true, which can take people by surprise. Markdown is heavily used to format content while avoiding XSS vulnerabilities, being unsafe by default is not a good idea.
There also is a vue-markdown fork trying to fix this problem, it doesn't seem to support everything and I can't attest it works, but some work has been done #92.
The text was updated successfully, but these errors were encountered:
paulocsanz
changed the title
XSS script when katex fails to render
XSS vulnerability when katex fails to render
Jan 25, 2020
Hey, I was trying to reimplement this library without Vue for the browser and saw that this depends on markdown-it-katex, which is a library (abandoned a long time ago), you can see in this issue that there are a bunch of forks because it's abandoned.
And there lies a XSS vulnerability. It happens when there is a syntax error in the Latex, the text is just dumped as HTML without escaping.
This can't be reproduced by the live demo because it's on a old branch with code that does not implement katex, so we actively run a different code in production than the one we can test live here.
But in the original issue there is a proof of concept.
Also by default this library sets html input to true, which can take people by surprise. Markdown is heavily used to format content while avoiding XSS vulnerabilities, being unsafe by default is not a good idea.
Apparently changing
import katex from 'markdown-it-katex'
toimport katex from '@iktakahiro/markdown-it-katex'
fixes it. Using this fork https://github.com/iktakahiro/markdown-it-katexThere also is a
vue-markdown
fork trying to fix this problem, it doesn't seem to support everything and I can't attest it works, but some work has been done #92.The text was updated successfully, but these errors were encountered: