GHSA-6C2X-MJMQ-VX4Q
Reflected XSS in search clean-URL route (/search/<term>)
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-6C2X-MJMQ-VX4Q divulgada · CVSS 6.1 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
### Summary
The Serendipity clean-URL search handler reflects the attacker-controlled search term into the page without HTML encoding, because the sanitisation pipeline runs urldecode() after the HTML-encoding step. A single-URL-encoded payload (e.g. %3Csvg…%3E) survives strip_tags() and htmlspecialchars() as inert text, then is decoded back into live <svg…> HTML and printed into the page. A crafted link executes arbitrary JavaScript in a victim's browser.
### Details
include/functions_routing.inc.php — serveSearch():
// line 198
$serendipity['GET']['searchTerm'] =
urldecode( serendipity_specialchars( strip_tags( implode(' ', $search) ) ) );### PoC
Executable POC (verified on an up to date instance)
https://example.com/search/zz%3Csvg/onload%3Dalert%601%60%3Ezz
<img width="952" height="248" alt="image" src="https://github.com/user-attachments/assets/9ffe8fab-ba1d-48d3-962f-a37093d2ab3f" />
### Impact
A single crafted GET link can execute attacker JavaScript in the victim's authenticated session.
### Remediation
In include/functions_routing.inc.php:198, do not urldecode() after encoding. Decode first, then sanitise:
$term = urldecode( implode(' ', $search) );
$serendipity['GET']['searchTerm'] = serendipity_specialchars( strip_tags( $term ) );Or drop the trailing urldecode() entirely, $search is already URL-decoded by the router.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagists9y/serendipity |
Sin parche | — | — | — |
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/s9y/Serendipity/security/advisories/GHSA-6c2x-mjmq-vx4qLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
