YOURLS: Unauthenticated File Inclusion
Summary
YOURLS versions ≤1.10.4 contain an unauthenticated path traversal vulnerability that allows attackers to include and execute arbitrary PHP files on the server without any credentials.
Details
The vulnerability exists because YOURLS uses URL sanitization functions (yourls_sanitize_url(), yourls_esc_url()) to filter request paths, but these functions are designed to clean URLs, not filesystem paths. They preserve / and . characters, allowing ../ sequences to pass through unfiltered.
The unsanitized keyword is then directly concatenated into a filesystem path and passed to file_exists() and later include() operations, enabling path traversal attacks.
Data Flow:
HTTP Request URI (with ../)
↓
yourls_get_request() (no sanitization)
↓
yourls_sanitize_url() (preserves / and .)
↓
yourls_esc_url() (permits / and . via regex)
↓
Keyword extraction (preserves ../)
↓
file_exists(YOURLS_PAGEDIR . "/$keyword.php") ← Sink
↓
include(YOURLS_PAGEDIR . "/$keyword.php") ← Code Execution
Proof of Concept (POC)
In the concept validation, we assume that the attacker has uploaded a test.php file to the web root directory, but it cannot be accessed directly. (Of course, it could also be any path, such as /tmp/test.php)
Setup
Place a test file in web root:
./test.php:
<?php
phpinfo();
?>
Attack Request
GET /../../test HTTP/1.1
Host: target.com
Connection: close
Response (Apache Environment)
<img width="1704" height="614" alt="image" src="https://github.com/user-attachments/assets/8750a3c0-a96c-4896-a087-d7b5cfeccd30" />Impact
-
Remote execution of uploaded PHP files – An attacker uploads a malicious PHP file to an arbitrary location on the server (e.g., via another vulnerability or file upload feature), obtains its absolute path but cannot access it directly. The attacker then leverages this vulnerability to include and execute the PHP file, gaining code execution privileges.
-
Indirect triggering of PHP code injection – If a PHP code injection point exists on the system (e.g., log injection, session injection) but the injected file cannot be accessed directly due to configuration restrictions, the attacker can use this vulnerability to include and execute the injected code, achieving remote command execution or further compromise.
Software afectado
Haz clic en una tecnología para ver todas sus vulnerabilidades.
| Plataforma | Paquete | Versiones vulnerables | Corregida en |
|---|---|---|---|
| Paquete de Composer | yourls/yourls | < 1.10.5 | 1.10.5 |
Referencias
- https://github.com/YOURLS/YOURLS/security/advisories/GHSA-f8ff-652m-j5rx
- https://nvd.nist.gov/vuln/detail/CVE-2026-62858
- https://github.com/YOURLS/YOURLS/pull/4142
- https://github.com/YOURLS/YOURLS/commit/4e85972160a96e03a419a442d5bd8f21f2f02ddb
- https://github.com/YOURLS/YOURLS
- https://github.com/YOURLS/YOURLS/releases/tag/1.10.5
- Vector CVSS
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L- Debilidad (CWE)
CWE-98- Plataforma
- Composer
- Paquete
yourls/yourls- Publicada
- 15.10.2026
- Actualizado
- 22.10.2026 18:07
Fuentes y licencias
OSV / GitHub Advisory Database - GHSA-f8ff-652m-j5rx - CC BY 4.0
Historial de vulnerabilidades: yourls/yourls
Todas las vulnerabilidades publicadas de este paquete (Paquete de Composer), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.
- Entradas en total
- 9
- Primera → última
- 09.2019 10.2026
- Sin corrección
- 4
- Explotada en ataques
- 0
Distribución por gravedad
- Crítica 1
- Alta 2
- Media 5
- Baja 1
Divulgaciones por año
- 2019: 1
- 2020: 0
- 2021: 3
- 2022: 2
- 2023: 0
- 2024: 0
- 2025: 1
- 2026: 2
Identifica las vulnerabilidades de tu aplicación
Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.