# GHSA-JV7G-9FF9-6CC5: Stored XSS in course description controller via contentDescription field (\<2.0.3)

- Database: GitHub
- Severity: high (stated by ghsa, no CVSS score)
- Published: 2026-07-08
- Modified: 2026-07-08

## Tracked as

- [CVE-2026-54747](https://cve.now/CVE-2026-54747.md): Chamilo LMS stored XSS in course description controller

## Affected versions

- chamilo/chamilo-lms (Packagist): through 2.0.2

## 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

```php
$content = $_POST['contentDescription'];  // raw — no sanitization
```

### Recommended Fix

```php
$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).

## References

- https://github.com/chamilo/chamilo-lms/security/advisories/GHSA-jv7g-9ff9-6cc5

Page: https://cve.now/GHSA-JV7G-9FF9-6CC5
