Commit 236070e
committed
Fix a potential XSS vulnerability in the past answers table (the Answer Log).
If MathQuill is enabled and a student types `"<script>alert(1);</script>`
and submits the answer, then that script is executed if an instructor
views the answer on the past answers page. If MathQuill is not enabled,
and a student simply enters `<script>alert(1);</script>` the same thing
happens.
This is due to a change in #1899 to make the special character `޲`
used to separate array answers (usually coming from checkbox answers)
display correctly.
To fix this better handling of answers with that character is needed.
So this splits the student answers on that character, and now DOES html
escape all other parts of the student answer again, but directly inserts
the `⍮` characters without escaping. The effect is that answers
will still be displayed the same as they were before other than scripts
in the answer. Those will now actually appear as text. Note that is the
same as it would have been before #1899.1 parent 5743ae9 commit 236070e
File tree
1 file changed
+5
-1
lines changed- templates/ContentGenerator/Instructor/ShowAnswers
1 file changed
+5
-1
lines changedLines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
| |||
0 commit comments