-
Notifications
You must be signed in to change notification settings - Fork 819
Render MathML in QTI questions generated by Studio #13668
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
Render MathML in QTI questions generated by Studio #13668
Conversation
…ny child annotation elements still. Add some basic styling for MathML.
Build Artifacts
|
|
Would be good to get QA verification here - I don't think the code is likely to change much. |
|
@rtibbles which Studio environment should I be using to test this one, publishing a channel with a Survey with a Free response question is still not working properly at Hotfixes... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall the updates look reasonable.
I did a cursory search for what 'semantics' refers to as a string passed to sanitize (ie, does this mean all "semantic" html elements in general or something specific to DOMPurify?)
Open question - the alternative here is to just remove the annotation completely from the Studio side - I don't think allowing semantics in this way opens us up to an XSS, but we would have to do some extra work to specifically allow the LaTeX annotation to be retained during santization.
Is this approach something that is more work for likely marginal (if any) security benefit?
@marcellamaki noted that we'd like this to be QA'd soon so I'm approving it - I don't suspect answers to my questions above will result in change requests so should be good to make available to QA
It would basically involve rolling back the additional LaTeX annotation I added on the Studio side (whereby the MathML is rendered in such a way that we keep the source LaTeX as an annotation on the MathML) - we might need this for supporting non-MathML supporting browsers, or possibly as a hint to an editor. I do think the current security risk is nil, simply because we are only allowing the semantic MathML element and not the annotation element (which is the vector for the injection attack). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to #13738, I have tested this with the dev environment sandbox (since we are having issues with hotfixes which prevents the QA team from testing). MathML rendering correctly!
c7ede7a
into
learningequality:release-v0.18.x
Summary
semanticselement to preserve the original LaTeX of the expression.semanticselements due to XSS vulnerabilities associated with its annotation elements.References
Fixes #13667
Reviewer guidance
Import a survey with a free response question and formula content into Kolibri and observe that the formula is now properly renderered.
Open question - the alternative here is to just remove the annotation completely from the Studio side - I don't think allowing semantics in this way opens us up to an XSS, but we would have to do some extra work to specifically allow the LaTeX annotation to be retained during santization.