Skip to main content
Menu
Advisories

Advisory

Stored XSS in Social Wall post content via API (v-html without DOMPurify) (< 2.0.3)

GHSA-PPW9-GF4R-5C39Published Updated GitHub

Description

Vulnerability Details

File (server-side sink): src/CoreBundle/Entity/SocialPost.php Line: 259 File (client-side sink): assets/vue/components/social/SocialWallPost.vue Line: 83 CWE: CWE-79 — Improper Neutralization of Input During Web Page Generation (Cross-site Scripting) Severity: High CVSS: 8.0 — CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N

Root Cause

The SocialPost API resource (POST /api/social_posts) accepts a JSON body with a content field. SocialPost::setContent() stores the value as-is with no XSS sanitization — no Symfony event listener, no API Platform normalizer, no entity lifecycle callback filters this field. Compare to MessageNormalizer (line 29) which correctly calls Security::remove_XSS($data['content'], STUDENT) for message content.

The stored content is later rendered in SocialWallPost.vue line 83 via Vue's v-html directive without calling DOMPurify.sanitize(), unlike PageCard.vue (line 47) and TermsList.vue (line 34) which already apply DOMPurify to their v-html usages.

Impact

  • Auth required to trigger: Yes (any ROLE_USER — student, teacher, any authenticated account)
  • Auth required to be affected: Yes (authenticated users viewing social wall)
  • Consequence: session hijacking of any user who views the attacker's social wall, including platform administrators
  • Scope: all authenticated users — low-privilege attacker can target high-privilege victims

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)> posted via POST /api/social_posts and confirmed executing via v-html when any authenticated user views the social wall.

Affected versions