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
- const match = markdown.isTrusted ? html.match(/^(<span[^<]+>)|(<\/\s*span>)$/) : undefined;
+ const match = markdown.isTrusted ? html.match(/^(<span[^>]+>)|(<\/\s*span>)$/) : undefined;
There was / is a typo in markdownRenderer.js that allowed any trusted document to pass arbitrary HTML through the marked.js sanitizer provided it is wrapped in <span></span> tags, or similar.
What could you have done with this? Not much that was not already possible in trusted mode, which, as far as I can tell is used just for Jypiter Notebooks that pretty much definitionally can execute Python anyway.
Insane strips everything worthwhile except <a data-href=''/> which you can use to send command: URIs on click (javascript: URIs are disabled at a higher level of abstraction), but the ability to do this is already allowlisted (L141) for trusted documents.
Matt Bierner (@mjbvz) since the fix for #112606 only restricted the tag attributes, I think that we could still gain from a specific fix for this issue.
Ignore the above, I don't think this warrants full verification-found, but I also don't think the final regex ended up in a good state. The regex /^(<span[^>]+>)|(<\/\s*span>)$/ is parsed as ^(<span[^>]+>) or (<\/\s*span>)$, I imagine you wanted it to be more like ^(?:(<span[^>]+>)|(<\/\s*span>))$. In this case the sanitizer is only called with the actual tag, so it's probably not a big deal either way.
Activity
mjbvz commentedon Jan 8, 2021
Alex Ross (@alexr00) Was this issue also fixed by the fix for #112606?
alexr00 commentedon Jan 8, 2021
Matt Bierner (@mjbvz) since the fix for #112606 only restricted the tag attributes, I think that we could still gain from a specific fix for this issue.
JacksonKearl commentedon Jan 29, 2021
Ignore the above, I don't think this warrants full
verification-found, but I also don't think the final regex ended up in a good state. The regex/^(<span[^>]+>)|(<\/\s*span>)$/is parsed as^(<span[^>]+>)or(<\/\s*span>)$, I imagine you wanted it to be more like^(?:(<span[^>]+>)|(<\/\s*span>))$. In this case the sanitizer is only called with the actual tag, so it's probably not a big deal either way.