-
Bug
-
Resolution: Fixed
-
Minor
-
2.5.9, 2.6.5, 2.7.2, 2.8.1
-
MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
-
MOODLE_27_STABLE, MOODLE_28_STABLE
-
-
FRONTEND Sprint 15
There is an unnecessary eval() in the following code which is an open door to XSS attacks.
mod/assign/module.js
|
confirmmessage = eval('M.str.assign.batchoperationconfirm' + operation.get('value'));
|
The Javascript here resolves a string using the value from an HTML element. If the attacker can inject HTML content where this code is used (which I tried and failed as a student), then it is possible to hijack the field and trick the eval into executing arbitrary code.
An easy fix is to use M.util.get_string().
- will help resolve
-
MDL-28286 Uses of M.str.{component}.{identifier} should be reviewed and converted to M.util.get_string where possible to avoid needless JS errors from missing strings
-
- Closed
-