CVE-2026-42197: Stored XSS via User Profile → Admin Session Hij
A stored cross-site scripting flaw in the RELATE learning management system let any enrolled student inject JavaScript through their profile name fields, which was then rendered unsanitised in the admin participation list. When an administrator viewed that page, the script executed in their session, allowing the attacker to steal the admin's session cookie and take over the account.
Published on medium.com
A Stored XSS vulnerability in RELATE — an open-source Django-based LMS used by universities — allowed any enrolled student to execute arbitrary JavaScript in an administrator’s browser session by injecting a payload through their own profile page. Successful exploitation results in full admin account takeover.
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
The admin display function used mark_safe() together with Python's % string formatting on unsanitised user input from get_full_name(), bypassing Django's automatic HTML escaping.
Impact
An attacker could steal the administrator's session cookie and replay it to impersonate the admin, gaining unrestricted access to all students, grades, exam tickets, and course configurations; the attack is persistent and affects every admin who views the page.
What the attacker needed
A student account; an active participation record; admin views the participation list
The fix
The fix replaces mark_safe() and % formatting with format_html(), which automatically escapes each interpolated argument.
How it was found
- Log in as a student and go to the profile page.
- Set the first name field to a script payload and save; no validation error occurs.
- Ensure an active participation record exists for the student.
- An administrator opens the participation list in the admin panel.
- The script executes in the administrator's browser.
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.
This is a stored cross-site scripting (XSS) bug. A student could type a small script into their profile name, and the website saved it without cleaning it up. Later, when an administrator looked at a list of participants, the script ran in the admin's browser and could steal the admin's login cookie, 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.