CWE-59
Weakness AllowedImproper 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.
Modes of introduction
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
updated Time_of_Introduction
updated Alternate_Terms, Applicable_Platforms, Relationships, Other_Notes, Relationship_Notes, Taxonomy_Mappings, Weakness_Ordinalities
updated Relationships, Taxonomy_Mappings
updated Relationships
updated Description, Name
updated Background_Details, Other_Notes
updated Potential_Mitigations, Relationships
updated Related_Attack_Patterns
updated Common_Consequences
updated Relationships, Taxonomy_Mappings
updated Common_Consequences, Observed_Examples, References, Relationships
updated Potential_Mitigations
updated Common_Consequences, Other_Notes
updated Detection_Factors, Relationships, Taxonomy_Mappings
updated Relationships
updated Affected_Resources, Applicable_Platforms, Causal_Nature, Common_Consequences, Functional_Areas, Likelihood_of_Exploit, Modes_of_Introduction, Relationships, Taxonomy_Mappings
updated Taxonomy_Mappings
updated Relationships
updated Relationships
updated Relationships
updated Relationships
updated Research_Gaps
updated Relationships
updated Alternate_Terms, Background_Details, Observed_Examples, References, Relationship_Notes, Theoretical_Notes
updated Description
updated Relationships
updated Mapping_Notes
updated Detection_Factors, References
updated Applicable_Platforms, Relationships
updated Alternate_Terms, Name, Observed_Examples
2748 vulnerabilities reference this CWE, most recent first.
GHSA-6VJH-65XF-7489
Vulnerability from github – Published: 2022-05-24 22:01 – Updated: 2025-10-22 00:31An elevation of privilege vulnerability exists when the Windows AppX Deployment Extensions improperly performs privilege management, resulting in access to system files.To exploit this vulnerability, an authenticated attacker would need to run a specially crafted application to elevate privileges.The security update addresses the vulnerability by correcting how AppX Deployment Extensions manages privileges., aka 'Windows AppX Deployment Extensions Elevation of Privilege Vulnerability'.
{
"affected": [],
"aliases": [
"CVE-2019-1385"
],
"database_specific": {
"cwe_ids": [
"CWE-59"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2019-11-12T19:15:00Z",
"severity": "HIGH"
},
"details": "An elevation of privilege vulnerability exists when the Windows AppX Deployment Extensions improperly performs privilege management, resulting in access to system files.To exploit this vulnerability, an authenticated attacker would need to run a specially crafted application to elevate privileges.The security update addresses the vulnerability by correcting how AppX Deployment Extensions manages privileges., aka \u0027Windows AppX Deployment Extensions Elevation of Privilege Vulnerability\u0027.",
"id": "GHSA-6vjh-65xf-7489",
"modified": "2025-10-22T00:31:48Z",
"published": "2022-05-24T22:01:10Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2019-1385"
},
{
"type": "WEB",
"url": "https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2019-1385"
},
{
"type": "WEB",
"url": "https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2019-1385"
},
{
"type": "WEB",
"url": "https://www.zerodayinitiative.com/advisories/ZDI-19-979"
}
],
"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-6VJJ-WJQ4-W7HV
Vulnerability from github – Published: 2022-05-02 06:19 – Updated: 2022-05-02 06:19Certain patch-installation scripts in Oracle Solaris allow local users to append data to arbitrary files via a symlink attack on the /tmp/CLEANUP temporary file, related to use of Update Manager.
{
"affected": [],
"aliases": [
"CVE-2010-1183"
],
"database_specific": {
"cwe_ids": [
"CWE-59"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2010-03-29T22:30:00Z",
"severity": "LOW"
},
"details": "Certain patch-installation scripts in Oracle Solaris allow local users to append data to arbitrary files via a symlink attack on the /tmp/CLEANUP temporary file, related to use of Update Manager.",
"id": "GHSA-6vjj-wjq4-w7hv",
"modified": "2022-05-02T06:19:58Z",
"published": "2022-05-02T06:19:58Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2010-1183"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/57149"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/510305/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/510311/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/38928"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-6VWQ-GG49-HJ9W
Vulnerability from github – Published: 2024-10-11 15:30 – Updated: 2024-10-12 00:30The Improper link resolution before file access ('Link Following') vulnerability in SonicWall Connect Tunnel (version 12.4.3.271 and earlier of Windows client) allows users with standard privileges to delete arbitrary folders and files, potentially leading to local privilege escalation attack.
{
"affected": [],
"aliases": [
"CVE-2024-45316"
],
"database_specific": {
"cwe_ids": [
"CWE-59"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-10-11T13:15:16Z",
"severity": "HIGH"
},
"details": "The Improper link resolution before file access (\u0027Link Following\u0027) vulnerability in SonicWall Connect Tunnel (version 12.4.3.271 and earlier of Windows client) allows users with standard privileges to delete arbitrary folders and files, potentially leading to local privilege escalation attack.",
"id": "GHSA-6vwq-gg49-hj9w",
"modified": "2024-10-12T00:30:47Z",
"published": "2024-10-11T15:30:32Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-45316"
},
{
"type": "WEB",
"url": "https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2024-0017"
}
],
"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-6WCV-RJ3C-MHV3
Vulnerability from github – Published: 2026-11-10 15:56 – Updated: 2026-11-10 15:56Impact
compose-lint fills in ${VAR} references from the .env file next to the Compose file. It is meant to read nothing outside the project directory, and env_file:, include: and extends: paths are checked for that. The .env read is not. If .env is a symlink, compose-lint follows it wherever it points.
A pull request can add a .env symlink to any file on the CI runner and a Compose file that references a variable from it. compose-lint substitutes the value and quotes it in finding messages, which go to the log and to JSON and SARIF output.
The worst target is /proc/self/environ, the linter's own environment. The Compose file only needs to reference the name of the first variable in it: because that file separates variables with NUL bytes rather than newlines, the substituted value is the entire rest of the environment. On a CI runner that environment holds whatever the workflow put there, including secrets. GitHub masks registered secrets in the job log, but not in uploaded JSON or SARIF artifacts or in Code Scanning alert text.
An include: entry's project_directory: has the same gap from 0.28.0: a directory symlink named there makes compose-lint read .env from wherever the link points.
Pull requests from forks normally run without secrets, and GitHub masks registered secrets in the job log, so in the common setup what can be read is runner metadata and whatever unmasked values the job's environment holds. That is why this is scored as low confidentiality impact. The impact is high in a job that runs untrusted pull requests with secrets in its environment, such as a pull_request_target workflow, or on a CI system that does not mask secrets, and also wherever the JSON or SARIF output is uploaded. The pass/fail result is not affected.
Found during an internal pre-1.0 security review.
Patches
Fixed in 0.31.0. Every .env read now applies the same containment check as env_file:. A .env that resolves outside the project is treated as missing and reported as an unread input. A project_directory: that resolves outside the project is refused, and that entry's files resolve against their own directories. A .env line containing a NUL byte is skipped.
Workarounds
- Run with
--no-env, which skips the sibling.enventirely. - Don't run compose-lint on untrusted pull requests in a job whose environment holds secrets.
Reproduction
project/.env -> /proc/self/environ (symlink)
project/compose.yml:
services:
web:
image: "${FIRST_VAR_NAME}"
compose-lint check compose.yml --format json quotes the environment in the CL-0004 message ("Image '...' has no tag").
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 0.30.0"
},
"package": {
"ecosystem": "PyPI",
"name": "compose-lint"
},
"ranges": [
{
"events": [
{
"introduced": "0.22.0"
},
{
"fixed": "0.31.0"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 0.30.0"
},
"package": {
"ecosystem": "GitHub Actions",
"name": "tmatens/compose-lint"
},
"ranges": [
{
"events": [
{
"introduced": "0.22.0"
},
{
"fixed": "0.31.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-123368"
],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-59"
],
"github_reviewed": true,
"github_reviewed_at": "2026-11-10T15:56:56Z",
"nvd_published_at": "2026-11-09T18:17:25Z",
"severity": "LOW"
},
"details": "### Impact\n\ncompose-lint fills in `${VAR}` references from the `.env` file next to the Compose file. It is meant to read nothing outside the project directory, and `env_file:`, `include:` and `extends:` paths are checked for that. The `.env` read is not. If `.env` is a symlink, compose-lint follows it wherever it points.\n\nA pull request can add a `.env` symlink to any file on the CI runner and a Compose file that references a variable from it. compose-lint substitutes the value and quotes it in finding messages, which go to the log and to JSON and SARIF output.\n\nThe worst target is `/proc/self/environ`, the linter\u0027s own environment. The Compose file only needs to reference the name of the first variable in it: because that file separates variables with NUL bytes rather than newlines, the substituted value is the entire rest of the environment. On a CI runner that environment holds whatever the workflow put there, including secrets. GitHub masks registered secrets in the job log, but not in uploaded JSON or SARIF artifacts or in Code Scanning alert text.\n\nAn `include:` entry\u0027s `project_directory:` has the same gap from 0.28.0: a directory symlink named there makes compose-lint read `.env` from wherever the link points.\n\nPull requests from forks normally run without secrets, and GitHub masks registered secrets in the job log, so in the common setup what can be read is runner metadata and whatever unmasked values the job\u0027s environment holds. That is why this is scored as low confidentiality impact. The impact is high in a job that runs untrusted pull requests with secrets in its environment, such as a `pull_request_target` workflow, or on a CI system that does not mask secrets, and also wherever the JSON or SARIF output is uploaded. The pass/fail result is not affected.\n\nFound during an internal pre-1.0 security review.\n\n### Patches\n\nFixed in 0.31.0. Every `.env` read now applies the same containment check as `env_file:`. A `.env` that resolves outside the project is treated as missing and reported as an unread input. A `project_directory:` that resolves outside the project is refused, and that entry\u0027s files resolve against their own directories. A `.env` line containing a NUL byte is skipped.\n\n### Workarounds\n\n- Run with `--no-env`, which skips the sibling `.env` entirely.\n- Don\u0027t run compose-lint on untrusted pull requests in a job whose environment holds secrets.\n\n### Reproduction\n\n```\nproject/.env -\u003e /proc/self/environ (symlink)\nproject/compose.yml:\n services:\n web:\n image: \"${FIRST_VAR_NAME}\"\n```\n\n`compose-lint check compose.yml --format json` quotes the environment in the CL-0004 message (\"Image \u0027...\u0027 has no tag\").",
"id": "GHSA-6wcv-rj3c-mhv3",
"modified": "2026-11-10T15:56:56Z",
"published": "2026-11-10T15:56:56Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/tmatens/compose-lint/security/advisories/GHSA-6wcv-rj3c-mhv3"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-123368"
},
{
"type": "WEB",
"url": "https://github.com/tmatens/compose-lint/pull/917"
},
{
"type": "WEB",
"url": "https://github.com/tmatens/compose-lint/commit/c43204ad4dab11d54e20574a52bc4e5835246ca5"
},
{
"type": "PACKAGE",
"url": "https://github.com/tmatens/compose-lint"
},
{
"type": "WEB",
"url": "https://github.com/tmatens/compose-lint/releases/tag/v0.31.0"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:N/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"
}
],
"summary": "compose-lint: .env read through a symlink outside the project can expose the CI job\u0027s environment"
}
GHSA-6WGP-VX5W-7923
Vulnerability from github – Published: 2022-05-17 05:53 – Updated: 2022-05-17 05:53editcomment in crip 3.7 allows local users to overwrite arbitrary files via a symlink attack on a /tmp/*.tag.tmp temporary file.
{
"affected": [],
"aliases": [
"CVE-2008-5376"
],
"database_specific": {
"cwe_ids": [
"CWE-59"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-12-08T23:30:00Z",
"severity": "MODERATE"
},
"details": "editcomment in crip 3.7 allows local users to overwrite arbitrary files via a symlink attack on a /tmp/*.tag.tmp temporary file.",
"id": "GHSA-6wgp-vx5w-7923",
"modified": "2022-05-17T05:53:18Z",
"published": "2022-05-17T05:53:18Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-5376"
},
{
"type": "WEB",
"url": "http://lists.debian.org/debian-devel/2008/08/msg00347.html"
},
{
"type": "WEB",
"url": "http://uvw.ru/report.sid.txt"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-6WW7-MX3F-8CQ3
Vulnerability from github – Published: 2022-05-02 04:00 – Updated: 2025-04-11 03:48The (1) configure and (2) config.guess scripts in GNU troff (aka groff) 1.20.1 on Openwall GNU/*/Linux (aka Owl) improperly create temporary files upon a failure of the mktemp function, which makes it easier for local users to overwrite arbitrary files via a symlink attack on a temporary file.
{
"affected": [],
"aliases": [
"CVE-2009-5082"
],
"database_specific": {
"cwe_ids": [
"CWE-59"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2011-06-30T15:55:00Z",
"severity": "LOW"
},
"details": "The (1) configure and (2) config.guess scripts in GNU troff (aka groff) 1.20.1 on Openwall GNU/*/Linux (aka Owl) improperly create temporary files upon a failure of the mktemp function, which makes it easier for local users to overwrite arbitrary files via a symlink attack on a temporary file.",
"id": "GHSA-6ww7-mx3f-8cq3",
"modified": "2025-04-11T03:48:11Z",
"published": "2022-05-02T04:00:53Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2009-5082"
},
{
"type": "WEB",
"url": "http://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/groff/groff-1.20.1-owl-tmp.diff"
},
{
"type": "WEB",
"url": "http://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/groff/groff-1.20.1-owl-tmp.diff.diff?r1=1.1%3Br2=1.2%3Bf=h"
},
{
"type": "WEB",
"url": "http://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/groff/groff-1.20.1-owl-tmp.diff.diff?r1=1.1;r2=1.2;f=h"
},
{
"type": "WEB",
"url": "http://openwall.com/lists/oss-security/2009/08/14/4"
},
{
"type": "WEB",
"url": "http://openwall.com/lists/oss-security/2009/08/14/5"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-6WWR-G865-F46R
Vulnerability from github – Published: 2026-12-02 00:58 – Updated: 2026-12-02 00:58Summary
With default preservePaths: false, tar 7.5.22 can extract a symbolic link whose effective target is outside the extraction directory. A crafted archive first creates one in-root symlink and then a second symlink whose target contains that symlink followed by ... The containment check simplifies the target lexically before checking filesystem symlinks, but the stored target is resolved by the OS through the first symlink. A later consumer following the extracted link can access a file outside the intended root.
This was reproduced locally on commit 2a22bfc5d3a432a606d9da0e2d87ba634aa3b1cb (package version 7.5.22). Earlier versions were not assessed. The PoC only reads a marker that it creates in its own temporary directory. No preexisting file is touched.
Root cause
STRIPABSOLUTEPATH accepts a symlink linkpath containing .. if path.posix.normalize(path.posix.join(entryDir, linkpath)) appears to stay inside the extraction root (src/unpack.ts:263-302). Later, SYMLINK derives parts using path.resolve(dirname(entry.absolute), entry.linkpath) (src/unpack.ts:640-659), which also removes b/.. before ENSURE_NO_SYMLINK inspects each component (src/unpack.ts:679-698). LINK then writes the original unsimplified entry.linkpath with fs.symlink (src/unpack.ts:866-880).
For a/b -> ../x and a/c -> b/../.., the lexical check reduces the second target to the extraction root and never checks a/b. Actual filesystem traversal follows a/b to x first and then processes two parent components, ending in the extraction root's parent.
Safe local PoC
Run from a built checkout of 7.5.22:
import { mkdtempSync, mkdirSync, writeFileSync, readFileSync } from 'node:fs'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { Header, extract } from 'tar'
const parent = mkdtempSync(join(tmpdir(), 'node-tar-link-poc-'))
const out = join(parent, 'out')
mkdirSync(out)
writeFileSync(join(parent, 'outside-marker.txt'), 'OUTSIDE MARKER\n')
const block = h => {
const b = Buffer.alloc(512)
new Header(h).encode(b)
return b
}
const input = join(parent, 'input.tar')
writeFileSync(input, Buffer.concat([
block({ path: 'x/', type: 'Directory', size: 0 }),
block({ path: 'a/', type: 'Directory', size: 0 }),
block({ path: 'a/b', type: 'SymbolicLink', linkpath: '../x', size: 0 }),
block({ path: 'a/c', type: 'SymbolicLink', linkpath: 'b/../..', size: 0 }),
Buffer.alloc(1024),
]))
const warnings = []
await extract({ file: input, cwd: out, onwarn: (code, message) => warnings.push({ code, message }) })
console.log(readFileSync(join(out, 'a/c/outside-marker.txt'), 'utf8').trim())
console.log(warnings)
// OUTSIDE MARKER
// []
The marker is outside out; the access passes through a symlink extracted under out. This demonstrates the target containment bypass. It does not claim that node-tar itself writes outside out while extracting a subsequent member; its existing path checks may stop such an entry.
Impact and suggested fix
An attacker needs to supply a tar archive to an application that extracts links and later follows or serves files from the extracted tree. The resulting link crosses the documented default target confinement. The downstream read/write impact depends on that consumer.
Validate link targets using filesystem semantics before accepting them, or conservatively reject a target that traverses .. after a symlink component. In particular, inspect the unsimplified components before path.resolve() removes them. Add a regression case with a symlink component followed by .., and assert that the second link is rejected under default options.
Credit goes to GitHub user @mikkel32 as finder/reporter in the published advisory.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "tar"
},
"ranges": [
{
"events": [
{
"introduced": "7.5.22"
},
{
"fixed": "8.0.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-140248"
],
"database_specific": {
"cwe_ids": [
"CWE-59"
],
"github_reviewed": true,
"github_reviewed_at": "2026-12-02T00:58:18Z",
"nvd_published_at": "2026-12-01T18:17:29Z",
"severity": "HIGH"
},
"details": "## Summary\n\nWith default `preservePaths: false`, `tar` 7.5.22 can extract a symbolic link whose effective target is outside the extraction directory. A crafted archive first creates one in-root symlink and then a second symlink whose target contains that symlink followed by `..`. The containment check simplifies the target lexically before checking filesystem symlinks, but the stored target is resolved by the OS through the first symlink. A later consumer following the extracted link can access a file outside the intended root.\n\nThis was reproduced locally on commit `2a22bfc5d3a432a606d9da0e2d87ba634aa3b1cb` (package version 7.5.22). Earlier versions were not assessed. The PoC only reads a marker that it creates in its own temporary directory. No preexisting file is touched.\n\n## Root cause\n\n`STRIPABSOLUTEPATH` accepts a symlink `linkpath` containing `..` if `path.posix.normalize(path.posix.join(entryDir, linkpath))` appears to stay inside the extraction root (`src/unpack.ts:263-302`). Later, `SYMLINK` derives `parts` using `path.resolve(dirname(entry.absolute), entry.linkpath)` (`src/unpack.ts:640-659`), which also removes `b/..` before `ENSURE_NO_SYMLINK` inspects each component (`src/unpack.ts:679-698`). `LINK` then writes the original unsimplified `entry.linkpath` with `fs.symlink` (`src/unpack.ts:866-880`).\n\nFor `a/b -\u003e ../x` and `a/c -\u003e b/../..`, the lexical check reduces the second target to the extraction root and never checks `a/b`. Actual filesystem traversal follows `a/b` to `x` first and then processes two parent components, ending in the extraction root\u0027s parent.\n\n## Safe local PoC\n\nRun from a built checkout of 7.5.22:\n\n```js\nimport { mkdtempSync, mkdirSync, writeFileSync, readFileSync } from \u0027node:fs\u0027\nimport { tmpdir } from \u0027node:os\u0027\nimport { join } from \u0027node:path\u0027\nimport { Header, extract } from \u0027tar\u0027\n\nconst parent = mkdtempSync(join(tmpdir(), \u0027node-tar-link-poc-\u0027))\nconst out = join(parent, \u0027out\u0027)\nmkdirSync(out)\nwriteFileSync(join(parent, \u0027outside-marker.txt\u0027), \u0027OUTSIDE MARKER\\n\u0027)\nconst block = h =\u003e {\n const b = Buffer.alloc(512)\n new Header(h).encode(b)\n return b\n}\nconst input = join(parent, \u0027input.tar\u0027)\nwriteFileSync(input, Buffer.concat([\n block({ path: \u0027x/\u0027, type: \u0027Directory\u0027, size: 0 }),\n block({ path: \u0027a/\u0027, type: \u0027Directory\u0027, size: 0 }),\n block({ path: \u0027a/b\u0027, type: \u0027SymbolicLink\u0027, linkpath: \u0027../x\u0027, size: 0 }),\n block({ path: \u0027a/c\u0027, type: \u0027SymbolicLink\u0027, linkpath: \u0027b/../..\u0027, size: 0 }),\n Buffer.alloc(1024),\n]))\n\nconst warnings = []\nawait extract({ file: input, cwd: out, onwarn: (code, message) =\u003e warnings.push({ code, message }) })\nconsole.log(readFileSync(join(out, \u0027a/c/outside-marker.txt\u0027), \u0027utf8\u0027).trim())\nconsole.log(warnings)\n// OUTSIDE MARKER\n// []\n```\n\nThe marker is outside `out`; the access passes through a symlink extracted under `out`. This demonstrates the target containment bypass. It does not claim that node-tar itself writes outside `out` while extracting a subsequent member; its existing path checks may stop such an entry.\n\n## Impact and suggested fix\n\nAn attacker needs to supply a tar archive to an application that extracts links and later follows or serves files from the extracted tree. The resulting link crosses the documented default target confinement. The downstream read/write impact depends on that consumer.\n\nValidate link targets using filesystem semantics before accepting them, or conservatively reject a target that traverses `..` after a symlink component. In particular, inspect the unsimplified components before `path.resolve()` removes them. Add a regression case with a symlink component followed by `..`, and assert that the second link is rejected under default options.\n\nCredit goes to GitHub user `@mikkel32` as finder/reporter in the published advisory.",
"id": "GHSA-6wwr-g865-f46r",
"modified": "2026-12-02T00:58:18Z",
"published": "2026-12-02T00:58:18Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/isaacs/node-tar/security/advisories/GHSA-6wwr-g865-f46r"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-140248"
},
{
"type": "WEB",
"url": "https://github.com/isaacs/node-tar/commit/23b368128b6cf7d4c26f2e302c0e4a82f70a6e3d"
},
{
"type": "PACKAGE",
"url": "https://github.com/isaacs/node-tar"
},
{
"type": "WEB",
"url": "https://github.com/isaacs/node-tar/releases/tag/v8.0.0"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:H/VA:L/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "node-tar: Nested symlink target can escape node-tar extraction root"
}
GHSA-6X2M-P4XP-WG22
Vulnerability from github – Published: 2026-06-19 21:42 – Updated: 2026-06-19 21:42Summary
EnvironmentManager.backup() recursively collects files using _collectBackupFiles(). _collectBackupFiles() uses statSync(full), which follows symlinks. If data/<env> contains a symlink to a directory outside the environment root, backup recursion follows the symlink and copies external files into data/<env>/.backups/<backupId>/.
An attacker who can place a symlink under the environment data directory can cause backup operations to disclose files outside the environment root into backup artifacts. Confirmed in Network-AI 5.12.1.
Details
backup() collects file paths and copies them into the backup directory:
const files = this._collectBackupFiles(envDir);
for (const rel of files) {
const src = join(envDir, rel);
const dst = join(backupPath, rel);
mkdirSync(join(backupPath, rel.includes('/') ? rel.substring(0, rel.lastIndexOf('/')) : '.'), { recursive: true });
try { copyFileSync(src, dst); } catch { /* skip unreadable */ }
}
_collectBackupFiles() follows symlinked directories because it calls statSync(), not lstatSync():
const info = statSync(full);
if (info.isDirectory()) {
walk(full, rel);
} else {
results.push(rel);
}
Default CLI reachability exists through network-ai env backup create --env <env>. backup() also runs automatically before promotion and restore operations.
Affected source evidence:
lib/env-manager.ts:435-460— backup copy logic.lib/env-manager.ts:596-617— symlink-following_collectBackupFiles().bin/cli.ts:413-420— default CLI exposes backup creation.lib/env-manager.ts:294-297and483-484— backup also runs before promote/restore.
PoC
This PoC uses only temporary files. It creates a symlink inside data/dev pointing to an external directory, then runs backup('dev') and observes that the external file is copied into the backup:
TMP=$(mktemp -d)
TMPBASE="$TMP" node -r ts-node/register/transpile-only - <<'TS'
const { EnvironmentManager } = require('./lib/env-manager');
const fs = require('fs');
const path = require('path');
const base = process.env.TMPBASE;
const data = path.join(base, 'data');
const outside = path.join(base, 'outside');
fs.mkdirSync(outside, { recursive: true });
fs.writeFileSync(path.join(outside, 'secret.txt'), 'secret-through-symlink');
const mgr = new EnvironmentManager(data, {
chain: ['dev', 'st'],
gates: { dev: 'auto', st: 'auto' },
});
mgr.init('dev');
fs.symlinkSync(outside, path.join(data, 'dev', 'linked-outside'), 'dir');
const result = mgr.backup('dev');
const copied = path.join(result.path, 'linked-outside', 'secret.txt');
console.log(JSON.stringify({
copied: fs.existsSync(copied),
content: fs.readFileSync(copied, 'utf8'),
}, null, 2));
fs.rmSync(base, { recursive: true, force: true });
TS
Observed result: copied is true and content is secret-through-symlink.
Impact
An attacker who can place a symlink in data/<env> can cause backup creation to copy arbitrary readable files from outside the environment root into data/<env>/.backups/<backupId>/. This can disclose secrets or local files to any actor/process that can later read or export Network-AI backup artifacts. No RCE chain was confirmed.
Resolution (maintainer)
Fixed in v5.12.2 (commit a59c13a). Install: npm install network-ai@5.12.2 — published to npm with provenance.
_collectBackupFiles() now uses lstatSync instead of statSync and skips any entry where isSymbolicLink() is true. Symlinks are never traversed, so backup() can no longer follow a link out of the environment root and copy external files into a backup artifact.
All 3,269 tests pass against the patched build. Thanks to @sondt99 for the responsible disclosure.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 5.12.1"
},
"package": {
"ecosystem": "npm",
"name": "network-ai"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "5.12.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-59"
],
"github_reviewed": true,
"github_reviewed_at": "2026-06-19T21:42:36Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "### Summary\n`EnvironmentManager.backup()` recursively collects files using `_collectBackupFiles()`. `_collectBackupFiles()` uses `statSync(full)`, which follows symlinks. If `data/\u003cenv\u003e` contains a symlink to a directory outside the environment root, backup recursion follows the symlink and copies external files into `data/\u003cenv\u003e/.backups/\u003cbackupId\u003e/`.\n\nAn attacker who can place a symlink under the environment data directory can cause backup operations to disclose files outside the environment root into backup artifacts. Confirmed in Network-AI 5.12.1.\n\n### Details\n`backup()` collects file paths and copies them into the backup directory:\n\n```ts\nconst files = this._collectBackupFiles(envDir);\nfor (const rel of files) {\n const src = join(envDir, rel);\n const dst = join(backupPath, rel);\n mkdirSync(join(backupPath, rel.includes(\u0027/\u0027) ? rel.substring(0, rel.lastIndexOf(\u0027/\u0027)) : \u0027.\u0027), { recursive: true });\n try { copyFileSync(src, dst); } catch { /* skip unreadable */ }\n}\n```\n\n`_collectBackupFiles()` follows symlinked directories because it calls `statSync()`, not `lstatSync()`:\n\n```ts\nconst info = statSync(full);\nif (info.isDirectory()) {\n walk(full, rel);\n} else {\n results.push(rel);\n}\n```\n\nDefault CLI reachability exists through `network-ai env backup create --env \u003cenv\u003e`. `backup()` also runs automatically before promotion and restore operations.\n\nAffected source evidence:\n\n- `lib/env-manager.ts:435-460` \u2014 backup copy logic.\n- `lib/env-manager.ts:596-617` \u2014 symlink-following `_collectBackupFiles()`.\n- `bin/cli.ts:413-420` \u2014 default CLI exposes backup creation.\n- `lib/env-manager.ts:294-297` and `483-484` \u2014 backup also runs before promote/restore.\n\n### PoC\nThis PoC uses only temporary files. It creates a symlink inside `data/dev` pointing to an external directory, then runs `backup(\u0027dev\u0027)` and observes that the external file is copied into the backup:\n\n```bash\nTMP=$(mktemp -d)\nTMPBASE=\"$TMP\" node -r ts-node/register/transpile-only - \u003c\u003c\u0027TS\u0027\nconst { EnvironmentManager } = require(\u0027./lib/env-manager\u0027);\nconst fs = require(\u0027fs\u0027);\nconst path = require(\u0027path\u0027);\nconst base = process.env.TMPBASE;\nconst data = path.join(base, \u0027data\u0027);\nconst outside = path.join(base, \u0027outside\u0027);\n\nfs.mkdirSync(outside, { recursive: true });\nfs.writeFileSync(path.join(outside, \u0027secret.txt\u0027), \u0027secret-through-symlink\u0027);\n\nconst mgr = new EnvironmentManager(data, {\n chain: [\u0027dev\u0027, \u0027st\u0027],\n gates: { dev: \u0027auto\u0027, st: \u0027auto\u0027 },\n});\n\nmgr.init(\u0027dev\u0027);\nfs.symlinkSync(outside, path.join(data, \u0027dev\u0027, \u0027linked-outside\u0027), \u0027dir\u0027);\n\nconst result = mgr.backup(\u0027dev\u0027);\nconst copied = path.join(result.path, \u0027linked-outside\u0027, \u0027secret.txt\u0027);\n\nconsole.log(JSON.stringify({\n copied: fs.existsSync(copied),\n content: fs.readFileSync(copied, \u0027utf8\u0027),\n}, null, 2));\n\nfs.rmSync(base, { recursive: true, force: true });\nTS\n```\n\nObserved result: `copied` is `true` and `content` is `secret-through-symlink`.\n\n### Impact\nAn attacker who can place a symlink in `data/\u003cenv\u003e` can cause backup creation to copy arbitrary readable files from outside the environment root into `data/\u003cenv\u003e/.backups/\u003cbackupId\u003e/`. This can disclose secrets or local files to any actor/process that can later read or export Network-AI backup artifacts. No RCE chain was confirmed.\n\n\n---\n\n### Resolution (maintainer)\n\n**Fixed in [v5.12.2](https://github.com/Jovancoding/Network-AI/releases/tag/v5.12.2) (commit `a59c13a`).** Install: `npm install network-ai@5.12.2` \u2014 published to npm with provenance.\n\n`_collectBackupFiles()` now uses `lstatSync` instead of `statSync` and skips any entry where `isSymbolicLink()` is true. Symlinks are never traversed, so `backup()` can no longer follow a link out of the environment root and copy external files into a backup artifact.\n\nAll 3,269 tests pass against the patched build. Thanks to @sondt99 for the responsible disclosure.",
"id": "GHSA-6x2m-p4xp-wg22",
"modified": "2026-06-19T21:42:36Z",
"published": "2026-06-19T21:42:36Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/Jovancoding/Network-AI/security/advisories/GHSA-6x2m-p4xp-wg22"
},
{
"type": "WEB",
"url": "https://github.com/Jovancoding/Network-AI/commit/a59c13a1f0ce0e8a0779a90343eef92fac5ab4c3"
},
{
"type": "PACKAGE",
"url": "https://github.com/Jovancoding/Network-AI"
},
{
"type": "WEB",
"url": "https://github.com/Jovancoding/Network-AI/releases/tag/v5.12.2"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "Network-AI: EnvironmentManager.backup() follows symlinked directories and copies files outside the environment root into backups"
}
GHSA-6XWP-X9RH-9CVM
Vulnerability from github – Published: 2026-08-25 21:31 – Updated: 2026-08-27 06:31The NEService auto-upgrade process insecurely handles temporary files in SonicWall NetExtender Linux client which allows an attacker to manipulate file paths.
{
"affected": [],
"aliases": [
"CVE-2026-66153"
],
"database_specific": {
"cwe_ids": [
"CWE-59"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-08-25T20:17:01Z",
"severity": "HIGH"
},
"details": "The NEService auto-upgrade process insecurely handles temporary files in SonicWall NetExtender Linux client which allows an attacker to manipulate file paths.",
"id": "GHSA-6xwp-x9rh-9cvm",
"modified": "2026-08-27T06:31:24Z",
"published": "2026-08-25T21:31:30Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-66153"
},
{
"type": "WEB",
"url": "https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2026-0013"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-6XWQ-H856-Q7W6
Vulnerability from github – Published: 2022-05-17 02:18 – Updated: 2022-05-17 02:18asciiview in aview 1.3.0 allows local users to overwrite arbitrary files via a symlink attack on a /tmp/aview#####.pgm temporary file.
{
"affected": [],
"aliases": [
"CVE-2008-4935"
],
"database_specific": {
"cwe_ids": [
"CWE-59"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-11-05T15:00:00Z",
"severity": "MODERATE"
},
"details": "asciiview in aview 1.3.0 allows local users to overwrite arbitrary files via a symlink attack on a /tmp/aview#####.pgm temporary file.",
"id": "GHSA-6xwq-h856-q7w6",
"modified": "2022-05-17T02:18:33Z",
"published": "2022-05-17T02:18:33Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-4935"
},
{
"type": "WEB",
"url": "https://bugs.gentoo.org/235808"
},
{
"type": "WEB",
"url": "https://bugs.gentoo.org/show_bug.cgi?id=235770"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/44837"
},
{
"type": "WEB",
"url": "http://bugs.debian.org/496422"
},
{
"type": "WEB",
"url": "http://dev.gentoo.org/~rbu/security/debiantemp/aview"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/33139"
},
{
"type": "WEB",
"url": "http://security.gentoo.org/glsa/glsa-200812-14.xml"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2008/10/30/2"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/30885"
}
],
"schema_version": "1.4.0",
"severity": []
}
Mitigation MIT-48.1
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.