# GHSA-XFHV-QG8R-RC7W: Stored XSS in Learning Path TOC via malicious SCORM package item title (\< 2.0.3, \< 1.11.40)

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

## Tracked as

- [CVE-2026-55503](https://cve.now/CVE-2026-55503.md): Chamilo LMS stored XSS in SCORM learning path table of contents

## Affected versions

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

## Description

## Vulnerability Details

**File (source — import time)**: `public/main/lp/scormItem.class.php`
**Line**: 61
**File (store)**: `public/main/lp/scorm.class.php`
**Lines**: 343–368
**File (render sink)**: `src/CoreBundle/Resources/views/LearnPath/scorm_list.html.twig`
**Lines**: 1, 69, 83, 159, 170
**CWE**: CWE-79 — Improper Neutralization of Input During Web Page Generation (Cross-site Scripting)
**Severity**: Medium
**CVSS**: 6.5 — CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N

### Root Cause

When a Teacher uploads a SCORM package, `scormItem::parse_children()` reads the `<title>` element from `imsmanifest.xml` via `$child->firstChild->nodeValue` with no XSS sanitization (line 61). The value passes through `api_utf8_decode()` (encoding conversion only) in `scorm.class.php` and is stored directly in `c_lp_item.title` via `CLpItem::setTitle()`.

The `scorm_list.html.twig` template begins with `{% autoescape false %}` and renders the title as `{{ item.title | raw }}` — explicitly disabling Twig's auto-escaping. A secondary code path in `getListArrayToc()` (learnpath.class.php line 2790) applies `strip_tags() + Security::remove_XSS()` only when the optional AI disclosure feature is enabled. When AI disclosure is disabled (the default production state), no sanitization occurs.

### Impact

- **Auth required to trigger**: Yes (Teacher role to import SCORM package)
- **Auth required to be affected**: Yes (enrolled students viewing the LP)
- **Consequence**: session hijacking of enrolled students; if admin views the LP, admin session is compromised

### Verification

Confirmed on Chamilo LMS v2.1.0 (PHP 8.2 / MariaDB / Apache / Docker) on 2026-05-29.

SCORM zip uploaded via `POST /main/lp/lp_controller.php?action=upload`. Payload stored raw in `c_lp_item.title`. LP TOC rendered via `/main/lp/lp_controller.php?action=view&lp_id=1` with AI disclosure disabled confirmed:

```
Line 150: <span class="lp-item-title"><img src=x onerror=alert(document.cookie)>XSS-VULN-002</span>
```

## References

- https://github.com/chamilo/chamilo-lms/security/advisories/GHSA-xfhv-qg8r-rc7w

Page: https://cve.now/GHSA-XFHV-QG8R-RC7W
