Bug 1962292 (CVE-2021-3558)

Summary: CVE-2021-3558 moodle: XSS when uploading HTML files containing an input tag with a polyglot payload
Product: [Other] Security Response Reporter: Guilherme de Almeida Suckevicz <gsuckevi>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: gwync, igor.raits, sergio
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-19 20:57:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1962293, 1962294    
Bug Blocks: 1962321    

Description Guilherme de Almeida Suckevicz 2021-05-19 16:58:28 UTC
A flaw was found in Moodle in versions 3.9.2 and 3.10.4. When creating a course, you can upload HTML files as a resource. When uploading an HTML file containing an <input> tag that has an XSS polyglot payload as "value" it is possible to perform a Cross-Site Scripting.

Reference:
https://moodle.org/mod/page/view.php?id=8722

Comment 1 Guilherme de Almeida Suckevicz 2021-05-19 16:58:48 UTC
Created moodle tracking bugs for this issue:

Affects: epel-all [bug 1962294]
Affects: fedora-all [bug 1962293]

Comment 2 Product Security DevOps Team 2021-05-19 20:57:22 UTC
This CVE Bugzilla entry is for community support informational purposes only as it does not affect a package in a commercially supported Red Hat product. Refer to the dependent bugs for status of those individual community products.

Comment 3 Guilherme de Almeida Suckevicz 2022-03-09 17:15:39 UTC
This CVE has been rejected. After checking with upstream, this appear to be intended and expected functionally.

"In Moodle, permissions are controlled by "capabilities", which can have various "flags" assigned to them relating to known risks. The capability required to create new resources is only assigned to teachers/managers/admins by default, and is flagged as having a known XSS risk, meaning it is allowed to contain JavaScript content. A polyglot is not required, as standard JavaScript can be embedded within a HTML file resource directly. The reason we allow these actions by "trusted" users is to ensure we strike a balance between security and the ability for educators to create engaging and interactive content for their students."