/

CVE-2026-28405

Severity:

HIGH RISK

(8.0)

XSS in MarkUs Assignment Submission Preview

CVE-2026-28405

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Stored/Reflected Client-Side Code Execution in Users' Browsers

Severity:

HIGH RISK

(8.0)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

MarkUs contained a cross-site scripting (XSS) issue where student-submitted file contents were rendered as HTML without sanitization in the courses/<course_id>/assignments/<assignment_id>/submissions/html_content route.

When an attacker can control the submitted file content, they may be able to inject arbitrary JavaScript into the browser of any user who views that submission, potentially compromising accounts and session data.

Affected context

This vulnerability affects MarkUs deployments that allow students or other users to upload or submit files which can then be viewed via the submissions/html_content route.

The issue arises when the application:

  • Reads the raw file contents from the submission,
  • Treats those contents as HTML,
  • And returns them to the browser without HTML sanitization or output encoding.

It is most relevant where instructors, TAs, or other privileged users regularly view student submissions through the web UI.

Exploit preconditions

  • Attack surface: Web UI endpoint at courses/<course_id>/assignments/<assignment_id>/submissions/html_content.
  • Required access: Ability to submit or upload a file for an assignment in a course (typically an authenticated student role or any role that can submit content).
  • Trigger point: A victim (e.g., instructor, TA, or another user) viewing the submission via the vulnerable route in a browser.
  • Why exploitation is possible: The server reads file contents and renders them directly as HTML without sanitization or context-appropriate output encoding, allowing attacker-controlled markup and scripts to execute in the victim's browser.

Why this happens

The root cause is improper neutralization of user-controlled content before it is included in an HTML response, aligning with CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting).

MarkUs reads the contents of a student-submitted file and returns it as HTML without sanitizing dangerous elements (such as script tags, event handlers, or JavaScript URLs) or applying context-aware escaping.

This insecure pattern treats untrusted submission data as trusted HTML, allowing it to break out of any intended display context and inject active content into the page.

Potential impact

  • Execution of arbitrary JavaScript in the context of the MarkUs application for the affected course.
  • Theft or misuse of session cookies or other web storage data, depending on cookie and browser security settings.
  • Unauthorized actions performed on behalf of the victim (e.g., grading changes, feedback modifications, or viewing other sensitive content) via cross-site request forgery-style actions within the authenticated session.
  • Phishing or UI redressing attacks against instructors, TAs, or students by modifying the visible page content.
  • Potential pivoting to further application weaknesses if sensitive tokens or CSRF protections can be bypassed via injected scripts.

General mitigation guidance

Effective mitigation focuses on treating all submission content as untrusted and neutralizing it before rendering:

  • Apply robust HTML sanitization to any user-submitted content that must be rendered as HTML, using a well-maintained allowlist-based sanitizer that strips scripts, event handlers, and dangerous attributes.
  • Prefer context-appropriate output encoding (e.g., HTML-escaping) when the content does not need to be interpreted as HTML, rendering it as plain text instead.
  • Clearly separate trusted templates from untrusted data, ensuring templates contain markup and data is only ever inserted via encoded placeholders.
  • Use Content Security Policy (CSP) to reduce the impact of any remaining XSS issues (e.g., disallow inline scripts and restrict script sources).
  • Follow a secure-by-default design where new routes and views escape user content unless explicitly and safely opted into rich HTML rendering.

How teams detect issues like this

Organizations can detect similar XSS risks via:

  • Static code analysis rules that flag direct insertion of request parameters, file contents, or other untrusted data into HTML responses without sanitization or encoding.
  • Code review checklists that explicitly ask whether any rendered content originates from user submissions and if it is sanitized or escaped.
  • Dynamic application security testing (DAST) that submits files containing benign XSS test payloads and inspects rendered output for execution.
  • Automated security gates in CI/CD that scan templates and controllers for patterns like raw output helpers or direct rendering of user-controlled content.
  • Logging and monitoring for anomalous script execution or suspicious parameters in URLs related to submission viewing endpoints.

Sources

SourceLink
github.comgithub.com/MarkUsProject/Markus/commit/55d74f2ddb72d2ec2f29aa2b4cb6b2da10755036
github.comgithub.com/MarkUsProject/Markus/releases/tag/v2.9.1
github.comgithub.com/MarkUsProject/Markus/security/advisories/GHSA-p5pc-pxrj-3893

Frequently asked

questions

Yes. Any user with the ability to submit or upload assignment files can potentially craft a malicious submission. When another user views that submission through the vulnerable route, the attacker-controlled script can execute in the victim's browser.

The attacker typically needs authenticated access sufficient to submit assignment content in a course, such as a student account. They do not need elevated privileges; the attack is effective when a higher-privileged user (like an instructor or TA) later views the malicious submission.

The safest pattern is to ensure that all submission contents are treated as untrusted and are either:

  • Rendered as plain text with proper HTML escaping, or
  • Passed through a strict HTML sanitizer that removes all active content.

Additionally, the view code should avoid any "raw" rendering helpers that bypass escaping.

Establish a standard framework for output encoding and sanitization across the application, enforce it in coding guidelines, and integrate automated checks. During design and code review, treat any feature that renders user-generated content as high-risk and require explicit justification and controls when serving HTML instead of plain text.

Find out what's already
exploitable in your codebase.