CVE-2022-40313 in Fedoraproject Fedora and 2 more products
Recursive rendering of Mustache template helpers containing user input could, in some cases, result in an XSS risk or a page failing to load.
Affects 3 products from 2 vendors. Facts below cite their sources.
Remotely exploitable over the network, low complexity, no authentication required, requires user interaction, can impact systems beyond the vulnerable component.
Affected products and versions
| Vendor | Product | Affected versions |
|---|---|---|
| Fedoraproject | Fedora | 35 36 |
| Fedoraproject | Extra Packages For Enterprise Linux | 8.0 |
| Moodle | Moodle | ≥ 3.9.0, < 3.9.17 ≥ 3.11.0, < 3.11.10 ≥ 4.0.0, < 4.0.4 |
A product listed here is affected only at the versions shown. Use the free check to test the exact version you run.
Fix and vendor advisory
Vendor PSIRT: [email protected]
Exploitation
| CISA known-exploited | Not in the CISA KEV catalog |
|---|---|
| Public exploit | Not confirmed |
Official description
Recursive rendering of Mustache template helpers containing user input could, in some cases, result in an XSS risk or a page failing to load.
Source: NIST NVD / MITRE CVE.
Record details
| CVE ID | CVE-2022-40313 |
|---|---|
| BreachSpider ID | BS-2022-GLOBAL-065355-H |
| CVSS vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L |
| Published | 2022-09-30 |
| Last modified | 2025-05-20 |
| Weakness (CWE) | |
| Source | NVD |
Weakness definitions
CWE-79: Cross-Site Scripting (XSS)
Attacker injects malicious scripts into web pages viewed by other users, executing in the victim's browser context.
Related attack patterns (CAPEC)
CAPEC-85 AJAX Footprinting via CWE-79
CAPEC-209 XSS Using MIME Type Mismatch via CWE-79
CAPEC-588 DOM-Based XSS via CWE-79
CAPEC-591 Reflected XSS via CWE-79
CAPEC-592 Stored XSS via CWE-79
Show all 6
CAPEC-63 Cross-Site Scripting (XSS) via CWE-79
Mapping is CWE to CAPEC per MITRE CAPEC 3.9.
Analysis AI-written, not human-reviewed
A vulnerability in the recursive rendering of Mustache template helpers containing user input can lead to Cross-Site Scripting (XSS) or page load failures.
An attacker can inject malicious scripts into Mustache template helpers if user input is not properly sanitized. This can result in the execution of arbitrary code in the context of the victim's browser, leading to potential data theft or session hijacking.
Questions
What is CVE-2022-40313?
A vulnerability in the recursive rendering of Mustache template helpers containing user input can lead to Cross-Site Scripting (XSS) or page load failures.
What is the CVSS score for CVE-2022-40313?
CVE-2022-40313 has CVSS 7.1 (High). Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L. EPSS: 0.8%.
Is CVE-2022-40313 actively exploited?
No confirmed active exploitation of CVE-2022-40313 as of 2026-05-30.
How do I remediate CVE-2022-40313?
Priority: HIGH. Advisory: https://moodle.org/mod/forum/discuss.php?d=438392 PSIRT: [email protected]
What systems are affected by CVE-2022-40313?
CVE-2022-40313 affects Fedoraproject Fedora, Extra Packages For Enterprise Linux; Moodle Moodle.
For developers and AI agents
Run this check from your own code or agent
REST API
curl -s https://breachspider.com/api/v1/assets/correlate-cves \
-H "Authorization: Bearer $BREACHSPIDER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"assets":[{"asset_id":"dev-1","vendor":"Fedoraproject","product":"Fedora","version":"1.0"}]}'
MCP for AI agents
# hosted: add as a connector
https://mcp.breachspider.com/mcp
# local
pipx install breachspider-mcp
Free trial: 14 days, 750 device checks, no card.
Page facts from NVD, MITRE, CISA and vendor advisories, record last modified 2025-05-20.