CWE-22
Allowed-with-ReviewImproper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Abstraction: Base · Status: Stable
The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
13233 vulnerabilities reference this CWE, most recent first.
GHSA-765J-3735-W74R
Vulnerability from github – Published: 2022-05-13 01:35 – Updated: 2022-05-13 01:35A vulnerability in Cisco Data Center Network Manager software could allow an authenticated, remote attacker to conduct directory traversal attacks and gain access to sensitive files on the targeted system. The vulnerability is due to improper validation of user requests within the management interface. An attacker could exploit this vulnerability by sending malicious requests containing directory traversal character sequences within the management interface. An exploit could allow the attacker to view or create arbitrary files on the targeted system.
{
"affected": [],
"aliases": [
"CVE-2018-0464"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-10-05T16:29:00Z",
"severity": "HIGH"
},
"details": "A vulnerability in Cisco Data Center Network Manager software could allow an authenticated, remote attacker to conduct directory traversal attacks and gain access to sensitive files on the targeted system. The vulnerability is due to improper validation of user requests within the management interface. An attacker could exploit this vulnerability by sending malicious requests containing directory traversal character sequences within the management interface. An exploit could allow the attacker to view or create arbitrary files on the targeted system.",
"id": "GHSA-765j-3735-w74r",
"modified": "2022-05-13T01:35:06Z",
"published": "2022-05-13T01:35:06Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-0464"
},
{
"type": "WEB",
"url": "https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20180828-dcnm-traversal"
},
{
"type": "WEB",
"url": "https://www.tenable.com/security/research/tra-2018-20"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/105159"
},
{
"type": "WEB",
"url": "http://www.securitytracker.com/id/1041585"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-7664-HCP7-F497
Vulnerability from github – Published: 2023-12-06 09:30 – Updated: 2023-12-12 21:39Mattermost webapp fails to validate route parameters in//channels/ allowing an attacker to perform a client-side path traversal.
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "github.com/mattermost/mattermost-server/v6"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "7.8.14"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Go",
"name": "github.com/mattermost/mattermost/server/v8"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "8.1.5"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Go",
"name": "github.com/mattermost/mattermost/server/v8"
},
"ranges": [
{
"events": [
{
"introduced": "9.0.0"
},
{
"fixed": "9.0.3"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Go",
"name": "github.com/mattermost/mattermost/server"
},
"ranges": [
{
"events": [
{
"introduced": "9.1.0"
},
{
"fixed": "9.1.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2023-6458"
],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-74"
],
"github_reviewed": true,
"github_reviewed_at": "2023-12-08T21:57:03Z",
"nvd_published_at": "2023-12-06T09:15:08Z",
"severity": "HIGH"
},
"details": "Mattermost webapp fails to validate\u00a0route parameters in/\u003cTEAM_NAME\u003e/channels/\u003cCHANNEL_NAME\u003e\u00a0allowing an attacker to perform a client-side path traversal.\n\n",
"id": "GHSA-7664-hcp7-f497",
"modified": "2023-12-12T21:39:48Z",
"published": "2023-12-06T09:30:17Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-6458"
},
{
"type": "PACKAGE",
"url": "https://github.com/mattermost/mattermost"
},
{
"type": "WEB",
"url": "https://mattermost.com/security-updates"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:H/A:L",
"type": "CVSS_V3"
}
],
"summary": "Mattermost Injection vulnerability"
}
GHSA-766V-Q9X3-G744
Vulnerability from github – Published: 2026-04-08 19:21 – Updated: 2026-06-19 21:33Summary
The MultiAgentLedger and MultiAgentMonitor components in the provided code exhibit vulnerabilities that can lead to context leakage and arbitrary file operations. Specifically:
1. Memory State Leakage via Agent ID Collision: The MultiAgentLedger uses a dictionary to store ledgers by agent ID without enforcing uniqueness. This allows agents with the same ID to share ledger instances, leading to potential leakage of sensitive context data.
2. Path Traversal in MultiAgentMonitor: The MultiAgentMonitor constructs file paths by concatenating the base_path and agent ID without sanitization. This allows an attacker to escape the intended directory using path traversal sequences (e.g., ../), potentially leading to arbitrary file read/write.
Details
Vulnerability 1: Memory State Leakage
- File:
examples/context/12_multi_agent_context.py:68 - Description: The
MultiAgentLedgerclass uses a dictionary (self.ledgers) to store ledger instances keyed by agent ID. Theget_agent_ledgermethod creates a new ledger only if the agent ID is not present. If two agents are registered with the same ID, they will share the same ledger instance. This violates the isolation policy and can lead to leakage of sensitive context data (system prompts, conversation history) between agents. - Exploitability: An attacker can register an agent with the same ID as a victim agent to gain access to their ledger. This is particularly dangerous in multi-tenant systems where agents may handle sensitive user data.
Vulnerability 2: Path Traversal
- File:
examples/context/12_multi_agent_context.py:106 - Description: The
MultiAgentMonitorclass constructs file paths for agent monitors by directly concatenating thebase_pathand agent ID. Since the agent ID is not sanitized, an attacker can provide an ID containing path traversal sequences (e.g.,../../malicious). This can result in files being created or read outside the intended directory (base_path). - Exploitability: An attacker can create an agent with a malicious ID (e.g.,
../../etc/passwd) to write or read arbitrary files on the system, potentially leading to information disclosure or file corruption.
PoC
Memory State Leakage
multi_ledger = MultiAgentLedger()
# Victim agent (user1) registers and tracks sensitive data
victim_ledger = multi_ledger.get_agent_ledger('user1_agent')
victim_ledger.track_system_prompt("Sensitive system prompt")
victim_ledger.track_history([{"role": "user", "content": "Secret data"}])
# Attacker registers with the same ID
attacker_ledger = multi_ledger.get_agent_ledger('user1_agent')
# Attacker now has access to victim's ledger
print(attacker_ledger.get_ledger().system_prompt) # Outputs: "Sensitive system prompt"
print(attacker_ledger.get_ledger().history) # Outputs: [{'role': 'user', 'content': 'Secret data'}]
Path Traversal
with tempfile.TemporaryDirectory() as tmpdir:
multi_monitor = MultiAgentMonitor(base_path=tmpdir)
# Create agent with malicious ID
malicious_id = '../../malicious'
monitor = multi_monitor.get_agent_monitor(malicious_id)
# The monitor file is created outside the intended base_path
# Example: if tmpdir is '/tmp/safe_dir', the actual path might be '/tmp/malicious'
print(monitor.path) # Outputs: '/tmp/malicious' (or equivalent)
Impact
- Memory State Leakage: This vulnerability can lead to unauthorized access to sensitive agent context, including system prompts and conversation history. In a multi-tenant system, this could result in cross-user data leakage.
- Path Traversal: An attacker can read or write arbitrary files on the system, potentially leading to information disclosure, denial of service (by overwriting critical files), or remote code execution (if executable files are overwritten).
Recommended Fix
For Memory State Leakage
- Enforce unique agent IDs at the application level. If the application expects unique IDs, add a check during agent registration to prevent duplicates.
- Alternatively, modify the
MultiAgentLedgerto throw an exception if an existing agent ID is reused (unless explicitly allowed).
For Path Traversal
- Sanitize agent IDs before using them in file paths. Replace any non-alphanumeric characters (except safe ones like underscores) or remove path traversal sequences.
- Use
os.path.joinandos.path.realpathto resolve paths, then check that the resolved path starts with the intended base directory.
Example fix for MultiAgentMonitor:
import os
def get_agent_monitor(self, agent_id: str):
# Sanitize agent_id to remove path traversal
safe_id = os.path.basename(agent_id.replace('../', '').replace('..\\', ''))
# Alternatively, use a strict allow-list of characters
# Construct path and ensure it's within base_path
agent_path = os.path.join(self.base_path, safe_id)
real_path = os.path.realpath(agent_path)
real_base = os.path.realpath(self.base_path)
if not real_path.startswith(real_base):
raise ValueError(f"Invalid agent ID: {agent_id}")
...
Additionally, consider using a dedicated function for sanitizing filenames.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 1.5.114"
},
"package": {
"ecosystem": "PyPI",
"name": "praisonaiagents"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.5.115"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-56078"
],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-668"
],
"github_reviewed": true,
"github_reviewed_at": "2026-04-08T19:21:32Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "## Summary\nThe `MultiAgentLedger` and `MultiAgentMonitor` components in the provided code exhibit vulnerabilities that can lead to context leakage and arbitrary file operations. Specifically:\n1. **Memory State Leakage via Agent ID Collision**: The `MultiAgentLedger` uses a dictionary to store ledgers by agent ID without enforcing uniqueness. This allows agents with the same ID to share ledger instances, leading to potential leakage of sensitive context data.\n2. **Path Traversal in MultiAgentMonitor**: The `MultiAgentMonitor` constructs file paths by concatenating the `base_path` and agent ID without sanitization. This allows an attacker to escape the intended directory using path traversal sequences (e.g., `../`), potentially leading to arbitrary file read/write.\n\n## Details\n### Vulnerability 1: Memory State Leakage\n- **File**: `examples/context/12_multi_agent_context.py:68`\n- **Description**: The `MultiAgentLedger` class uses a dictionary (`self.ledgers`) to store ledger instances keyed by agent ID. The `get_agent_ledger` method creates a new ledger only if the agent ID is not present. If two agents are registered with the same ID, they will share the same ledger instance. This violates the isolation policy and can lead to leakage of sensitive context data (system prompts, conversation history) between agents.\n- **Exploitability**: An attacker can register an agent with the same ID as a victim agent to gain access to their ledger. This is particularly dangerous in multi-tenant systems where agents may handle sensitive user data.\n\n### Vulnerability 2: Path Traversal\n- **File**: `examples/context/12_multi_agent_context.py:106`\n- **Description**: The `MultiAgentMonitor` class constructs file paths for agent monitors by directly concatenating the `base_path` and agent ID. Since the agent ID is not sanitized, an attacker can provide an ID containing path traversal sequences (e.g., `../../malicious`). This can result in files being created or read outside the intended directory (`base_path`).\n- **Exploitability**: An attacker can create an agent with a malicious ID (e.g., `../../etc/passwd`) to write or read arbitrary files on the system, potentially leading to information disclosure or file corruption.\n\n## PoC\n### Memory State Leakage\n```python\nmulti_ledger = MultiAgentLedger()\n\n# Victim agent (user1) registers and tracks sensitive data\nvictim_ledger = multi_ledger.get_agent_ledger(\u0027user1_agent\u0027)\nvictim_ledger.track_system_prompt(\"Sensitive system prompt\")\nvictim_ledger.track_history([{\"role\": \"user\", \"content\": \"Secret data\"}])\n\n# Attacker registers with the same ID\nattacker_ledger = multi_ledger.get_agent_ledger(\u0027user1_agent\u0027)\n\n# Attacker now has access to victim\u0027s ledger\nprint(attacker_ledger.get_ledger().system_prompt) # Outputs: \"Sensitive system prompt\"\nprint(attacker_ledger.get_ledger().history) # Outputs: [{\u0027role\u0027: \u0027user\u0027, \u0027content\u0027: \u0027Secret data\u0027}]\n```\n\n### Path Traversal\n```python\nwith tempfile.TemporaryDirectory() as tmpdir:\n multi_monitor = MultiAgentMonitor(base_path=tmpdir)\n \n # Create agent with malicious ID\n malicious_id = \u0027../../malicious\u0027\n monitor = multi_monitor.get_agent_monitor(malicious_id)\n \n # The monitor file is created outside the intended base_path\n # Example: if tmpdir is \u0027/tmp/safe_dir\u0027, the actual path might be \u0027/tmp/malicious\u0027\n print(monitor.path) # Outputs: \u0027/tmp/malicious\u0027 (or equivalent)\n```\n\n## Impact\n- **Memory State Leakage**: This vulnerability can lead to unauthorized access to sensitive agent context, including system prompts and conversation history. In a multi-tenant system, this could result in cross-user data leakage.\n- **Path Traversal**: An attacker can read or write arbitrary files on the system, potentially leading to information disclosure, denial of service (by overwriting critical files), or remote code execution (if executable files are overwritten).\n\n## Recommended Fix\n### For Memory State Leakage\n- Enforce unique agent IDs at the application level. If the application expects unique IDs, add a check during agent registration to prevent duplicates.\n- Alternatively, modify the `MultiAgentLedger` to throw an exception if an existing agent ID is reused (unless explicitly allowed).\n\n### For Path Traversal\n- Sanitize agent IDs before using them in file paths. Replace any non-alphanumeric characters (except safe ones like underscores) or remove path traversal sequences.\n- Use `os.path.join` and `os.path.realpath` to resolve paths, then check that the resolved path starts with the intended base directory.\n\nExample fix for `MultiAgentMonitor`:\n```python\nimport os\n\ndef get_agent_monitor(self, agent_id: str):\n # Sanitize agent_id to remove path traversal\n safe_id = os.path.basename(agent_id.replace(\u0027../\u0027, \u0027\u0027).replace(\u0027..\\\\\u0027, \u0027\u0027))\n # Alternatively, use a strict allow-list of characters\n \n # Construct path and ensure it\u0027s within base_path\n agent_path = os.path.join(self.base_path, safe_id)\n real_path = os.path.realpath(agent_path)\n real_base = os.path.realpath(self.base_path)\n \n if not real_path.startswith(real_base):\n raise ValueError(f\"Invalid agent ID: {agent_id}\")\n \n ...\n```\nAdditionally, consider using a dedicated function for sanitizing filenames.",
"id": "GHSA-766v-q9x3-g744",
"modified": "2026-06-19T21:33:34Z",
"published": "2026-04-08T19:21:32Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-766v-q9x3-g744"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-56078"
},
{
"type": "PACKAGE",
"url": "https://github.com/MervinPraison/PraisonAI"
},
{
"type": "WEB",
"url": "https://www.vulncheck.com/advisories/praisonai-arbitrary-file-read-and-write-via-path-traversal-in-multiagentmonitor"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "PraisonAI has Memory State Leakage and Path Traversal in MultiAgent Context Handling"
}
GHSA-7675-H57G-R24M
Vulnerability from github – Published: 2023-12-07 18:30 – Updated: 2023-12-12 21:31A web server in the Intelligent Platform Management Interface (IPMI) baseboard management controller (BMC) implementation on Supermicro X11 and M11 based devices, with firmware versions up to 3.17.02, allows remote unauthenticated users to perform directory traversal, potentially disclosing sensitive information.
{
"affected": [],
"aliases": [
"CVE-2023-33411"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-12-07T18:15:07Z",
"severity": "HIGH"
},
"details": "A web server in the Intelligent Platform Management Interface (IPMI) baseboard management controller (BMC) implementation on Supermicro X11 and M11 based devices, with firmware versions up to 3.17.02, allows remote unauthenticated users to perform directory traversal, potentially disclosing sensitive information.",
"id": "GHSA-7675-h57g-r24m",
"modified": "2023-12-12T21:31:08Z",
"published": "2023-12-07T18:30:33Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-33411"
},
{
"type": "WEB",
"url": "https://www.supermicro.com/en/support/security_BMC_Dec_2023"
},
{
"type": "WEB",
"url": "http://supermicro.com"
}
],
"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-769J-489V-6C4G
Vulnerability from github – Published: 2022-05-02 06:20 – Updated: 2022-05-02 06:20Directory traversal vulnerability in the JA News (com_janews) component 1.0 for Joomla! allows remote attackers to read arbitrary local files via a .. (dot dot) in the controller parameter to index.php. NOTE: some of these details are obtained from third party information.
{
"affected": [],
"aliases": [
"CVE-2010-1219"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2010-03-30T23:30:00Z",
"severity": "MODERATE"
},
"details": "Directory traversal vulnerability in the JA News (com_janews) component 1.0 for Joomla! allows remote attackers to read arbitrary local files via a .. (dot dot) in the controller parameter to index.php. NOTE: some of these details are obtained from third party information.",
"id": "GHSA-769j-489v-6c4g",
"modified": "2022-05-02T06:20:14Z",
"published": "2022-05-02T06:20:14Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2010-1219"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/56901"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/38952"
},
{
"type": "WEB",
"url": "http://www.exploit-db.com/exploits/11757"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/38746"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-76C5-V32J-JJ2X
Vulnerability from github – Published: 2024-06-13 12:30 – Updated: 2024-06-13 12:30Acrobat Mobile Sign Android versions 24.4.2.33155 and earlier are affected by an Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability that could result in a security feature bypass. An attacker could exploit this vulnerability to access files and directories that are outside the restricted directory and also to overwrite arbitrary files. Exploitation of this issue does not requires user interaction and attack complexity is high.
{
"affected": [],
"aliases": [
"CVE-2024-34129"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-06-13T12:15:11Z",
"severity": "MODERATE"
},
"details": "Acrobat Mobile Sign Android versions 24.4.2.33155 and earlier are affected by an Improper Limitation of a Pathname to a Restricted Directory (\u0027Path Traversal\u0027) vulnerability that could result in a security feature bypass. An attacker could exploit this vulnerability to access files and directories that are outside the restricted directory and also to overwrite arbitrary files. Exploitation of this issue does not requires user interaction and attack complexity is high.",
"id": "GHSA-76c5-v32j-jj2x",
"modified": "2024-06-13T12:30:34Z",
"published": "2024-06-13T12:30:34Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-34129"
},
{
"type": "WEB",
"url": "https://helpx.adobe.com/security/products/acrobat-android/apsb24-50.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-76CM-FCFW-PHWH
Vulnerability from github – Published: 2022-05-01 18:33 – Updated: 2022-05-01 18:33Directory traversal vulnerability in index.php in Artmedic CMS 3.4 and earlier allows remote attackers to include and execute arbitrary local files via a .. (dot dot) in the page parameter.
{
"affected": [],
"aliases": [
"CVE-2007-5489"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-10-17T18:17:00Z",
"severity": "HIGH"
},
"details": "Directory traversal vulnerability in index.php in Artmedic CMS 3.4 and earlier allows remote attackers to include and execute arbitrary local files via a .. (dot dot) in the page parameter.",
"id": "GHSA-76cm-fcfw-phwh",
"modified": "2022-05-01T18:33:57Z",
"published": "2022-05-01T18:33:57Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-5489"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/37240"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/4538"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/27269"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/26090"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-76CV-J9HJ-683M
Vulnerability from github – Published: 2025-05-21 15:30 – Updated: 2025-05-21 15:30A vulnerability has been found in Kingdee Cloud Galaxy Private Cloud BBC System up to 9.0 Patch April 2025 and classified as critical. Affected by this vulnerability is the function BaseServiceFactory.getFileUploadService.deleteFileAction of the file fileUpload/deleteFileAction.jhtml of the component File Handler. The manipulation of the argument filePath leads to path traversal. The attack can be launched remotely. The exploit has been disclosed to the public and may be used. It is recommended to apply a patch to fix this issue.
{
"affected": [],
"aliases": [
"CVE-2025-5029"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-05-21T15:16:05Z",
"severity": "MODERATE"
},
"details": "A vulnerability has been found in Kingdee Cloud Galaxy Private Cloud BBC System up to 9.0 Patch April 2025 and classified as critical. Affected by this vulnerability is the function BaseServiceFactory.getFileUploadService.deleteFileAction of the file fileUpload/deleteFileAction.jhtml of the component File Handler. The manipulation of the argument filePath leads to path traversal. The attack can be launched remotely. The exploit has been disclosed to the public and may be used. It is recommended to apply a patch to fix this issue.",
"id": "GHSA-76cv-j9hj-683m",
"modified": "2025-05-21T15:30:34Z",
"published": "2025-05-21T15:30:34Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-5029"
},
{
"type": "WEB",
"url": "https://vip.kingdee.com/knowledge/708656434111770368"
},
{
"type": "WEB",
"url": "https://vip.kingdee.com/school/detail/713028702245944320?productLineId=1\u0026lang=zh-CN"
},
{
"type": "WEB",
"url": "https://vuldb.com/?ctiid.309847"
},
{
"type": "WEB",
"url": "https://vuldb.com/?id.309847"
},
{
"type": "WEB",
"url": "https://vuldb.com/?submit.570956"
},
{
"type": "WEB",
"url": "https://wx.mail.qq.com/s?k=nFbp0U0gSX0QVechIO"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:L/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"
}
]
}
GHSA-76HW-P97H-883F
Vulnerability from github – Published: 2026-04-14 01:11 – Updated: 2026-04-24 20:51Summary
The gdown library (tested on v5.2.1) is vulnerable to a Path Traversal attack within its extractall functionality. When extracting a maliciously crafted ZIP or TAR archive, the library fails to sanitize or validate the filenames of the archive members. This allow files to be written outside the intended destination directory, potentially leading to arbitrary file overwrite and Remote Code Execution (RCE).
Details
The vulnerability exists in gdown/extractall.py within the extractall() function. The function takes an archive path and a destination directory (to), then calls the underlying extractall() method of Python's tarfile or zipfile modules without validating whether the archive members stay within the to boundary.
Vulnerable Code:
# gdown/extractall.py
def extractall(path, to=None):
# ... (omitted) ...
with opener(path, mode) as f:
f.extractall(path=to) # Vulnerable: No path validation or filters`
Even on modern Python versions (3.12+), if the filter parameter is not explicitly set or if the library's wrapper logic bypasses modern protections, path traversal remains possible as demonstrated in the PoC.
PoC
Steps to Reproduce
- Create the Malicious Archive (
poc.py):
import tarfile
import io
import os
# Create a target directory
os.makedirs("./safe_target/subfolder", exist_ok=True)
# Generate a TAR file containing a member with path traversal
with tarfile.open("evil.tar", "w") as tar:
# Target: escape the subfolder and write to the parent 'safe_target'
payload = tarfile.TarInfo(name="../escape.txt")
content = b"Path Traversal Success!"
payload.size = len(content)
tar.addfile(payload, io.BytesIO(content))
print("[+] evil.tar created.")`
- Execute the Vulnerable Function:
`python3 -c "from gdown import extractall; extractall('evil.tar', to='./safe_target/subfolder')"`
- Verify the Escape:
ls -l ./safe_target/escape.txt
# Output: -rw-r--r-- 1 user user 23 Mar 15 2026 ./safe_target/escape.txt`
Impact
An attacker can provide a specially crafted archive that, when extracted via gdown, overwrites critical files on the victim's system.
- Arbitrary File Overwrite: Overwriting
.bashrc,.ssh/authorized_keys, or configuration files. - Remote Code Execution (RCE): By overwriting executable scripts or Python modules within a virtual environment.
Recommended Mitigation
mplement path validation to ensure that all extracted files are contained within the target directory.
Suggested Fix:
import os
def is_within_directory(directory, target):
abs_directory = os.path.abspath(directory)
abs_target = os.path.abspath(target)
prefix = os.path.commonpath([abs_directory])
return os.path.commonpath([abs_directory, abs_target]) == prefix
# Inside [extractall.py](http://extractall.py/)
with opener(path, mode) as f:
if isinstance(f, tarfile.TarFile):
for member in f.getmembers():
member_path = os.path.join(to, [member.name](http://member.name/))
if not is_within_directory(to, member_path):
raise Exception("Attempted Path Traversal in Tar File")
f.extractall(path=to)
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 5.2.1"
},
"package": {
"ecosystem": "PyPI",
"name": "gdown"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "5.2.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-40491"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": true,
"github_reviewed_at": "2026-04-14T01:11:30Z",
"nvd_published_at": "2026-04-18T03:16:13Z",
"severity": "MODERATE"
},
"details": "### Summary\nThe gdown library (tested on v5.2.1) is vulnerable to a Path Traversal attack within its extractall functionality. When extracting a maliciously crafted ZIP or TAR archive, the library fails to sanitize or validate the filenames of the archive members. This allow files to be written outside the intended destination directory, potentially leading to arbitrary file overwrite and Remote Code Execution (RCE).\n\n### Details\nThe vulnerability exists in `gdown/extractall.py` within the `extractall()` function. The function takes an archive path and a destination directory (`to`), then calls the underlying `extractall()` method of Python\u0027s `tarfile` or `zipfile` modules without validating whether the archive members stay within the `to` boundary.\n\nVulnerable Code:\n```\n# gdown/extractall.py\ndef extractall(path, to=None):\n # ... (omitted) ...\n with opener(path, mode) as f:\n f.extractall(path=to) # Vulnerable: No path validation or filters`\n```\nEven on modern Python versions (3.12+), if the `filter` parameter is not explicitly set or if the library\u0027s wrapper logic bypasses modern protections, path traversal remains possible as demonstrated in the PoC.\n\n\n### PoC\n## Steps to Reproduce\n\n1. Create the Malicious Archive (`poc.py`):\n```\nimport tarfile\nimport io\nimport os\n\n# Create a target directory\nos.makedirs(\"./safe_target/subfolder\", exist_ok=True)\n\n# Generate a TAR file containing a member with path traversal\nwith tarfile.open(\"evil.tar\", \"w\") as tar:\n # Target: escape the subfolder and write to the parent \u0027safe_target\u0027\n payload = tarfile.TarInfo(name=\"../escape.txt\")\n content = b\"Path Traversal Success!\"\n payload.size = len(content)\n tar.addfile(payload, io.BytesIO(content))\n\nprint(\"[+] evil.tar created.\")`\n```\n1. Execute the Vulnerable Function:\n```\n`python3 -c \"from gdown import extractall; extractall(\u0027evil.tar\u0027, to=\u0027./safe_target/subfolder\u0027)\"`\n```\n1. Verify the Escape:\n```\nls -l ./safe_target/escape.txt\n# Output: -rw-r--r-- 1 user user 23 Mar 15 2026 ./safe_target/escape.txt`\n```\n\n### Impact\nAn attacker can provide a specially crafted archive that, when extracted via `gdown`, overwrites critical files on the victim\u0027s system.\n\n- Arbitrary File Overwrite: Overwriting `.bashrc`, `.ssh/authorized_keys`, or configuration files.\n- Remote Code Execution (RCE): By overwriting executable scripts or Python modules within a virtual environment.\n\n\n### Recommended Mitigation \nmplement path validation to ensure that all extracted files are contained within the target directory.\n\n**Suggested Fix:**\n\n```\nimport os\n\ndef is_within_directory(directory, target):\n abs_directory = os.path.abspath(directory)\n abs_target = os.path.abspath(target)\n prefix = os.path.commonpath([abs_directory])\n return os.path.commonpath([abs_directory, abs_target]) == prefix\n\n# Inside [extractall.py](http://extractall.py/)\nwith opener(path, mode) as f:\n if isinstance(f, tarfile.TarFile):\n for member in f.getmembers():\n member_path = os.path.join(to, [member.name](http://member.name/))\n if not is_within_directory(to, member_path):\n raise Exception(\"Attempted Path Traversal in Tar File\")\n f.extractall(path=to)\n```",
"id": "GHSA-76hw-p97h-883f",
"modified": "2026-04-24T20:51:54Z",
"published": "2026-04-14T01:11:30Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/wkentaro/gdown/security/advisories/GHSA-76hw-p97h-883f"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-40491"
},
{
"type": "WEB",
"url": "https://github.com/wkentaro/gdown/commit/af569fc6ed300b7974dee66dc51e9f01b57b4dff"
},
{
"type": "PACKAGE",
"url": "https://github.com/wkentaro/gdown"
},
{
"type": "WEB",
"url": "https://github.com/wkentaro/gdown/releases/tag/v5.2.2"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N",
"type": "CVSS_V3"
}
],
"summary": "gdown Affected by Arbitrary File Write via Path Traversal in gdown.extractall"
}
GHSA-76J8-M22Q-R2R6
Vulnerability from github – Published: 2022-05-24 17:40 – Updated: 2022-05-24 17:40SolarWinds Serv-U before 15.2.2 allows Authenticated Directory Traversal.
{
"affected": [],
"aliases": [
"CVE-2020-27994"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2021-02-03T16:15:00Z",
"severity": "HIGH"
},
"details": "SolarWinds Serv-U before 15.2.2 allows Authenticated Directory Traversal.",
"id": "GHSA-76j8-m22q-r2r6",
"modified": "2022-05-24T17:40:47Z",
"published": "2022-05-24T17:40:47Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-27994"
},
{
"type": "WEB",
"url": "https://documentation.solarwinds.com/en/success_center/servu/Content/Release_Notes/Servu_15-2-2_release_notes.htm"
},
{
"type": "WEB",
"url": "https://www.themissinglink.com.au/security-advisories-cve-2020-27994"
},
{
"type": "WEB",
"url": "http://packetstormsecurity.com/files/161399/SolarWinds-Serv-U-FTP-Server-15.2.1-Path-Traversal.html"
},
{
"type": "WEB",
"url": "http://seclists.org/fulldisclosure/2021/Feb/36"
}
],
"schema_version": "1.4.0",
"severity": []
}
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-15
For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.
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-4
Strategy: Libraries or Frameworks
Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482].
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].
Mitigation MIT-17
Strategy: Environment Hardening
Run your code using the lowest privileges that are required to accomplish the necessary tasks [REF-76]. If possible, create isolated accounts with limited privileges that are only used for a single task. That way, a successful attack will not immediately give the attacker access to the rest of the software or its environment. For example, database applications rarely need to run as the database administrator, especially in day-to-day operations.
Mitigation MIT-21.1
Strategy: Enforcement by Conversion
- When the set of acceptable objects, such as filenames or URLs, is limited or known, create a mapping from a set of fixed input values (such as numeric IDs) to the actual filenames or URLs, and reject all other inputs.
- For example, ID 1 could map to "inbox.txt" and ID 2 could map to "profile.txt". Features such as the ESAPI AccessReferenceMap [REF-185] provide this capability.
Mitigation MIT-22
Strategy: Sandbox or Jail
- Run the code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which files can be accessed in a particular directory or which commands can be executed by the software.
- OS-level examples include the Unix chroot jail, AppArmor, and SELinux. In general, managed code may provide some protection. For example, java.io.FilePermission in the Java SecurityManager allows the software to specify restrictions on file operations.
- This may not be a feasible solution, and it only limits the impact to the operating system; the rest of the application may still be subject to compromise.
- Be careful to avoid CWE-243 and other weaknesses related to jails.
Mitigation MIT-34
Strategy: Attack Surface Reduction
- Store library, include, and utility files outside of the web document root, if possible. Otherwise, store them in a separate directory and use the web server's access control capabilities to prevent attackers from directly requesting them. One common practice is to define a fixed constant in each calling program, then check for the existence of the constant in the library/include file; if the constant does not exist, then the file was directly requested, and it can exit immediately.
- This significantly reduces the chance of an attacker being able to bypass any protection mechanisms that are in the base program but not in the include files. It will also reduce the attack surface.
Mitigation MIT-39
- Ensure that error messages only contain minimal details that are useful to the intended audience and no one else. The messages need to strike the balance between being too cryptic (which can confuse users) or being too detailed (which may reveal more than intended). The messages should not reveal the methods that were used to determine the error. Attackers can use detailed information to refine or optimize their original attack, thereby increasing their chances of success.
- If errors must be captured in some detail, record them in log messages, but consider what could occur if the log messages can be viewed by attackers. Highly sensitive information such as passwords should never be saved to log files.
- Avoid inconsistent messaging that might accidentally tip off an attacker about internal state, such as whether a user account exists or not.
- In the context of path traversal, error messages which disclose path information can help attackers craft the appropriate attack strings to move through the file system hierarchy.
Mitigation MIT-16
Strategy: Environment Hardening
When using PHP, configure the application so that it does not use register_globals. During implementation, develop the application so that it does not rely on this feature, but be wary of implementing a register_globals emulation that is subject to weaknesses such as CWE-95, CWE-621, and similar issues.
CAPEC-126: Path Traversal
An adversary uses path manipulation methods to exploit insufficient input validation of a target to obtain access to data that should be not be retrievable by ordinary well-formed requests. A typical variety of this attack involves specifying a path to a desired file together with dot-dot-slash characters, resulting in the file access API or function traversing out of the intended directory structure and into the root file system. By replacing or modifying the expected path information the access function or API retrieves the file desired by the attacker. These attacks either involve the attacker providing a complete path to a targeted file or using control characters (e.g. path separators (/ or \) and/or dots (.)) to reach desired directories or files.
CAPEC-64: Using Slashes and URL Encoding Combined to Bypass Validation Logic
This attack targets the encoding of the URL combined with the encoding of the slash characters. An attacker can take advantage of the multiple ways of encoding a URL and abuse the interpretation of the URL. A URL may contain special character that need special syntax handling in order to be interpreted. Special characters are represented using a percentage character followed by two digits representing the octet code of the original character (%HEX-CODE). For instance US-ASCII space character would be represented with %20. This is often referred as escaped ending or percent-encoding. Since the server decodes the URL from the requests, it may restrict the access to some URL paths by validating and filtering out the URL requests it received. An attacker will try to craft an URL with a sequence of special characters which once interpreted by the server will be equivalent to a forbidden URL. It can be difficult to protect against this attack since the URL can contain other format of encoding such as UTF-8 encoding, Unicode-encoding, etc.
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.
CAPEC-78: Using Escaped Slashes in Alternate Encoding
This attack targets the use of the backslash in alternate encoding. An adversary can provide a backslash as a leading character and causes a parser to believe that the next character is special. This is called an escape. By using that trick, the adversary tries to exploit alternate ways to encode the same character which leads to filter problems and opens avenues to attack.
CAPEC-79: Using Slashes in Alternate Encoding
This attack targets the encoding of the Slash characters. An adversary would try to exploit common filtering problems related to the use of the slashes characters to gain access to resources on the target host. Directory-driven systems, such as file systems and databases, typically use the slash character to indicate traversal between directories or other container components. For murky historical reasons, PCs (and, as a result, Microsoft OSs) choose to use a backslash, whereas the UNIX world typically makes use of the forward slash. The schizophrenic result is that many MS-based systems are required to understand both forms of the slash. This gives the adversary many opportunities to discover and abuse a number of common filtering problems. The goal of this pattern is to discover server software that only applies filters to one version, but not the other.