How We Hacked Our Way to Free 4.0s and Took Over a uWaterloo & UofT Grading Tool
Markus, a grading tool, had an IDOR in its submission preview that let any student view other students' files, and it rendered submitted notebooks as HTML without proper sandboxing, allowing stored XSS that could change grades. A zip-slip in assignment config uploads then allowed an instructor session to overwrite a shell script and achieve remote code execution.
xtra.sh
Published on xtra.sh
first, i’ll explain what markus is. then i’ll walk through how a student account could view other students’ submissions, how i could get 100s on assignments/tests, and finally how it was escalated to RCE. i’ll also cover a few other vulnerabilities i found along the way.
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 preview route looked up submission files by a global ID without checking ownership, and the notebook preview rendered untrusted HTML with only report-only CSP; separately, the zip upload joined entry names to a server path without checking for path traversal.
Impact
A student could view other students' submissions, and via XSS an attacker could change grades or perform instructor actions; the zip-slip could lead to remote code execution on the server, though the report notes the XSS preview had only report-only CSP and the RCE required an instructor session.
What the attacker needed
A student account; victim (instructor) opens a preview; instructor session for RCE chain
The fix
The issues were fixed in markus versions 2.9.1, 2.9.4, and 2.9.5, which removed the insecure html_content route, validated zip entries, and hardened HTML previews.
How it was found
- Open a submitted file from the grading page and observe the select_file_id parameter.
- Change the select_file_id number and request the same preview route to render a different submitted file.
- Submit a malicious notebook containing JavaScript.
- As an instructor, open the submitted notebook from the normal grading page, causing the script to run.
- Upload a crafted assignment config zip with a path-traversal entry to overwrite a shell script.
- Trigger the overwritten shell script via normal student SSH or git access to execute code.
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.
Markus is a website where students hand in work and teachers grade it. A bug let any student change a number in a web address to see other students' submitted files. Another bug let a student hide a small program inside a submitted notebook; when a teacher opened it, the program ran in the teacher's browser and could change marks. Finally, a file upload feature let an attacker write files outside the intended folder, which led to running commands on the server.
What is IDOR?
One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.