GHSA-f8ff-652m-j5rx

Suggest an improvement
Source
https://github.com/advisories/GHSA-f8ff-652m-j5rx
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-f8ff-652m-j5rx/GHSA-f8ff-652m-j5rx.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-f8ff-652m-j5rx
Aliases
Published
2026-10-15T20:13:02Z
Modified
2026-10-15T20:30:06Z
Severity
  • 5.3 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L CVSS Calculator
Summary
YOURLS: Unauthenticated File Inclusion
Details

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();
?>
image

Attack Request

GET /../../test HTTP/1.1
Host: target.com
Connection: close

Response (Apache Environment)

image

Impact

  1. 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.

  2. 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.

Database specific
{
    "cwe_ids":  [
        "CWE-98"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-10-15T20:13:02Z",
    "nvd_published_at":  "2026-10-14T16:17:47Z",
    "severity":  "MODERATE"
}
References

Affected packages

Packagist / yourls/yourls

Package

Name
yourls/yourls
Purl
pkg:composer/yourls/yourls

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
1.10.5

Affected versions

1.*
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
1.10.0
1.10.1
1.10.2
1.10.3
1.10.4

Database specific

last_known_affected_version_range
"<= 1.10.4"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-f8ff-652m-j5rx/GHSA-f8ff-652m-j5rx.json"