Description
Vulnerability Details
File: public/main/course_description/course_description_controller.php Lines: 225 and 460 CWE: CWE-79 — Improper Neutralization of Input During Web Page Generation (Cross-site Scripting) Severity: High CVSS: 7.5 — CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
Root Cause
The Symfony/Doctrine save path assigns $_POST['contentDescription'] to $content without any XSS sanitization at two locations (lines 225 and 460). The legacy save path at line 425 already calls Security::remove_XSS(..., COURSEMANAGERLOWSECURITY), but the newer Doctrine-based path does not. The stored content is later rendered via {{ description | raw }} in src/CoreBundle/Resources/views/Course/about.html.twig (line 85), which explicitly disables Twig's auto-escaping. The route /course/{id}/about has no #[IsGranted] guard — publicly accessible without authentication.
Impact
- Auth required to trigger: Yes (Teacher/Course Manager role to plant payload)
- Auth required to be affected: None — unauthenticated visitors are affected
- Consequence: session hijacking, credential theft, defacement, phishing via injected forms
Vulnerable Code
$content = $_POST['contentDescription']; // raw — no sanitizationRecommended Fix
$content = Security::remove_XSS($_POST['contentDescription'], COURSEMANAGERLOWSECURITY);Verification
Confirmed on Chamilo LMS v2.1.0 (PHP 8.2 / MariaDB 10.6 / Docker) on 2026-05-24. Payload <img src=x onerror=alert(document.cookie)> confirmed unescaped at two locations in the HTML response of /course/1/about (HTTP 200, no auth required).
Affected versions
- chamilo/chamilo-lmsPackagist
through 2.0.2