Admin Account Takeover in Moodle!
A stored cross-site scripting flaw existed in Moodle's admin log viewer because event descriptions were built from user-supplied values without encoding. An attacker could inject script through a quiz's Safe Exam Browser keys or a redirect URL, and when an administrator viewed the logs the script ran and could steal the admin session.
medium.com
Published on medium.com
I’m excited to explain my process and methodology for finding my first CVE vulnerability (CVE-2025–26529) in an open source project!
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the event description strings were inserted into the admin log page without HTML encoding, so user-controlled values were rendered as markup.
What the attacker needed
Admin views the log page; student account and Safe Exam Browser quiz (first route); attacker-controlled server (redirect route)
How it was found
- Find the admin log route that shows event descriptions.
- Trace how the description string is built from event class variables.
- Identify the Safe Exam Browser access_prevented event, which uses the received config and browser keys.
- Send a quiz request with a script payload in the Safe Exam Browser headers.
- View the admin log page and observe the script executing.
- Alternatively, host a server that redirects to an internal address containing the payload so the event fires without a student account.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Cross-site scripting (XSS) is when a website displays text that a user supplied without cleaning it, so the browser treats it as code and runs it. Here, the admin log page showed values from quiz requests as if they were part of the page, so a malicious value could run a script in the administrator's browser. That script could read the admin's login cookie and send it to the attacker, letting the attacker act as the admin.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.