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.

13338 vulnerabilities reference this CWE, most recent first.

GHSA-J95M-RCJP-Q69H

Vulnerability from github – Published: 2025-03-28 14:45 – Updated: 2025-11-07 16:43
VLAI
Summary
github.com/jaredallard/archives Has Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Details

Impact

A malicious user could feed a specially crafted archive to this library causing RCE, modification of files or other bad things in the context of whatever user is running this library as, through the program that imports it.

The severity highly depends on the user's permissions and environment it is being ran in (e.g., non root, read only root container would likely have no impact vs running something as root on a production system).

The severity is also dependent on arbitrary archives being passed or not.

Based on the above, severity high was picked to be safe.

Patches

Patched with the help of snyk and gosec in v1.0.1

Workarounds

The only workaround is to manually validate archives before submitting them to this library, however that is not recommended vs upgrading to unaffected versions.

References

https://security.snyk.io/research/zip-slip-vulnerability

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/jaredallard/archives"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "1.0.1"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2025-64346"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2025-03-28T14:45:59Z",
    "nvd_published_at": "2025-11-07T06:15:33Z",
    "severity": "MODERATE"
  },
  "details": "### Impact\n\nA malicious user could feed a specially crafted archive to this library causing RCE, modification of files or other bad things in the context of whatever user is running this library as, through the program that imports it.\n\nThe severity highly depends on the user\u0027s permissions and environment it is being ran in (e.g., non root, read only root container would likely have no impact vs running something as root on a production system).\n\nThe severity is also dependent on **arbitrary archives** being passed or not.\n\nBased on the above, severity high was picked to be safe.\n\n### Patches\n\nPatched with the help of snyk and gosec in v1.0.1\n\n### Workarounds\n\nThe only workaround is to manually validate archives before submitting them to this library, however that is not recommended vs upgrading to unaffected versions.\n\n### References\n\nhttps://security.snyk.io/research/zip-slip-vulnerability",
  "id": "GHSA-j95m-rcjp-q69h",
  "modified": "2025-11-07T16:43:11Z",
  "published": "2025-03-28T14:45:59Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/jaredallard/archives/security/advisories/GHSA-j95m-rcjp-q69h"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-64346"
    },
    {
      "type": "WEB",
      "url": "https://github.com/jaredallard/archives/commit/3bddec7bd3f38afbe97ae61d1c8a8487e9ea4ef1"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/jaredallard/archives"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": "github.com/jaredallard/archives Has Improper Limitation of a Pathname to a Restricted Directory (\u0027Path Traversal\u0027)"
}

GHSA-J977-C76J-564G

Vulnerability from github – Published: 2023-09-27 15:30 – Updated: 2024-04-04 07:53
VLAI
Details

Path traversal vulnerability in Welcart e-Commerce versions 2.7 to 2.8.21 allows a user with author or higher privilege to obtain partial information of the files on the web server.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2023-40532"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2023-09-27T15:19:19Z",
    "severity": "MODERATE"
  },
  "details": "Path traversal vulnerability in Welcart e-Commerce versions 2.7 to 2.8.21 allows a user with author or higher privilege to obtain partial information of the files on the web server.",
  "id": "GHSA-j977-c76j-564g",
  "modified": "2024-04-04T07:53:19Z",
  "published": "2023-09-27T15:30:36Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2023-40532"
    },
    {
      "type": "WEB",
      "url": "https://jvn.jp/en/jp/JVN97197972"
    },
    {
      "type": "WEB",
      "url": "https://www.welcart.com/archives/20106.html"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-J977-QQWC-8RMM

Vulnerability from github – Published: 2024-01-16 18:31 – Updated: 2024-10-23 18:33
VLAI
Details

The WooCommerce Currency Switcher FOX WordPress plugin before 1.3.7 was vulnerable to LFI attacks via the "woocs" shortcode.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2021-24566"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2024-01-16T16:15:09Z",
    "severity": "HIGH"
  },
  "details": "The WooCommerce Currency Switcher FOX WordPress plugin before 1.3.7 was vulnerable to LFI attacks via the \"woocs\" shortcode.",
  "id": "GHSA-j977-qqwc-8rmm",
  "modified": "2024-10-23T18:33:06Z",
  "published": "2024-01-16T18:31:08Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2021-24566"
    },
    {
      "type": "WEB",
      "url": "https://jetpack.com/2021/07/22/severe-vulnerability-patched-in-woocommerce-currency-switcher"
    },
    {
      "type": "WEB",
      "url": "https://wpscan.com/vulnerability/a0bc4b13-53fe-462d-8306-8915196d3a5a"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-J98M-W3XP-9F56

Vulnerability from github – Published: 2026-04-14 00:03 – Updated: 2026-04-24 20:44
VLAI
Summary
excel-mcp-server has a Path Traversal issue
Details

Summary

A path traversal vulnerability exists in excel-mcp-server versions up to and including 0.1.7. When running in SSE or Streamable-HTTP transport mode (the documented way to use this server remotely), an unauthenticated attacker on the network can read, write, and overwrite arbitrary files on the host filesystem by supplying crafted filepath arguments to any of the 25 exposed MCP tool handlers.

The server is intended to confine file operations to a directory set by the EXCEL_FILES_PATH environment variable. The function responsible for enforcing this boundary — get_excel_path() — fails to do so due to two independent flaws: it passes absolute paths through without any check, and it joins relative paths without resolving or validating the result. Combined with zero authentication on the default network-facing transport and a default bind address of 0.0.0.0 (all interfaces), this allows trivial remote exploitation.


Details

Field Value
Package excel-mcp-server (PyPI)
Repository https://github.com/haris-musa/excel-mcp-server
Affected versions <= 0.1.7
Tested version 0.1.7 — commit de4dc75
CWE CWE-22 — Improper Limitation of a Pathname to a Restricted Directory
CVSS 3.1 8.2 HighAV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H
Transports affected sse, streamable-http (network-facing)
Authentication required None

Vulnerable Code

The root cause is in src/excel_mcp/server.py, lines 75–94:

def get_excel_path(filename: str) -> str:
    """Get full path to Excel file."""

    # FLAW 1 — absolute paths bypass the sandbox entirely
    if os.path.isabs(filename):
        return filename                     # line 86: returned as-is

    # In SSE/HTTP mode, EXCEL_FILES_PATH is set
    if EXCEL_FILES_PATH is None:
        raise ValueError(...)

    # FLAW 2 — relative paths joined without boundary validation
    return os.path.join(EXCEL_FILES_PATH, filename)   # line 94: "../" escapes

Why this is exploitable

Flaw 1 — Absolute path bypass (line 86): If the attacker passes filepath="/etc/shadow" or filepath="/home/user/secrets.xlsx", the function returns it unchanged. The sandbox directory EXCEL_FILES_PATH is never consulted.

Flaw 2 — Relative traversal (line 94): os.path.join("/srv/sandbox", "../../etc/passwd") produces "/srv/sandbox/../../etc/passwd", which resolves to "/etc/passwd". No os.path.realpath() or os.path.commonpath() check is performed, so ../ sequences escape the sandbox.

Contributing factors that increase severity

  1. Default bind address is 0.0.0.0 (all interfaces) — server.py line 70: python host=os.environ.get("FASTMCP_HOST", "0.0.0.0"), A user who follows the README and runs uvx excel-mcp-server streamable-http without explicitly setting FASTMCP_HOST exposes the server to their entire LAN.

  2. Zero authentication — FastMCP's SSE and Streamable-HTTP transports ship with no authentication. The server adds none. Any TCP client that reaches port 8017 can call any tool.

  3. All 25 tool handlers are affected — every @mcp.tool() decorated function calls get_excel_path(filepath) as its first action. This is not an isolated endpoint; it is the entire API surface.

  4. Arbitrary directory creationsrc/excel_mcp/workbook.py line 24 runs path.parent.mkdir(parents=True, exist_ok=True) before saving, meaning the attacker can create directory trees at any writable location.


Proof of Concept

Video demonstration

asciicast

asciinema recording: https://asciinema.org/a/2HVA3uKvVeFahIXY

I have also attached the full PoC shell script (record-poc.sh) and the Python exploit script (exploit_test.py) to a Google Drive for the maintainer to review and reproduce independently:

Google Drive (PoC scripts): Shared privately via email

Contents: - record-poc.sh — automated PoC recording script (bash) - exploit_test.py — Python exploit that tests all 7 primitives against a running server

Setup

# install
pip install excel-mcp-server mcp httpx

# start server with a sandbox directory
mkdir -p /tmp/sandbox
EXCEL_FILES_PATH=/tmp/sandbox FASTMCP_HOST=127.0.0.1 FASTMCP_PORT=8017 \
    excel-mcp-server streamable-http

Exploit script

The following Python script connects to the server with zero credentials and demonstrates all exploitation primitives:

{REMOVING CAUSE FOR SAFETY CONCERNS}

Results

All 7 test cases passed against a live server instance:

CONFIRMED: 7  |  FAILED: 0

[CONFIRMED] AUTH: Connected with ZERO authentication. 25 tools exposed.
[CONFIRMED] P1-WRITE-ABS: file exists=True size=4783B (outside sandbox)
[CONFIRMED] P2-WRITE-TRAVERSAL: escaped sandbox via ../ exists=True
[CONFIRMED] P3-MKDIR: attacker directory tree created=True
[CONFIRMED] P4-READ: exfiltrated SSN=True name=True
[CONFIRMED] P5-OVERWRITE: victim data replaced=True
[CONFIRMED] P6-STAT: server attempted to open /etc/hostname (format error confirms file access)

Filesystem evidence (independently verified after exploit)

Files created outside the sandbox:

$ ls -la /tmp/cve-hunt/outside_sandbox/
-rw-rw-r-- 1 hitarth hitarth 4783 Apr 10 17:36 P1_absolute_write.xlsx
-rw-rw-r-- 1 hitarth hitarth 4783 Apr 10 17:36 P2_traversal_write.xlsx

Attacker-created directory tree:

$ find /tmp/cve-hunt/attacker_dir
/tmp/cve-hunt/attacker_dir
/tmp/cve-hunt/attacker_dir/deep
/tmp/cve-hunt/attacker_dir/deep/nested
/tmp/cve-hunt/attacker_dir/deep/nested/x.xlsx

Victim file after overwrite (original SSN destroyed):

  ('SSN', 'Name')
  ('ATTACKER-CONTROLLED', 'PWNED')     # was: ('123-45-6789', 'Alice Johnson')
  ('987-65-4321', 'Bob Smith')

Impact

An unauthenticated network attacker can:

What How Severity
Read any .xlsx file on the host Supply absolute path to read_data_from_excel Confidentiality loss — cross-tenant data theft of financial data, HR records, reports
Write .xlsx files anywhere on the filesystem Supply absolute path or ../ traversal to create_workbook or write_data_to_excel Integrity loss — destroy or corrupt any writable .xlsx, plant malicious files
Create arbitrary directories anywhere writable create_workbook triggers mkdir(parents=True) on attacker-controlled path Precursor to privilege escalation or DoS
Overwrite existing business files with attacker content write_data_to_excel with absolute path to target Silent data corruption — audit reports, salary sheets, financial models
Fill disk via repeated writes Loop create_workbook with unique filenames Denial of service — crash services dependent on free disk
Plant macro-enabled templates (.xltm) at known shared paths create_workbook at path like /home/user/Templates/report.xltm Client-side RCE chain when downstream user opens the template in Excel

Who is affected

Anyone running excel-mcp-server in SSE or Streamable-HTTP mode on a reachable network — which is the documented and recommended deployment for remote use. The project README explicitly states: - "Works both locally and as a remote service" - "Streamable HTTP Transport (Recommended for remote connections)"

The server has 3,655+ GitHub stars and is published on PyPI with active downloads.


Suggested Fix

Replace get_excel_path() with a version that enforces the sandbox boundary:

import os

def get_excel_path(filename: str) -> str:
    if EXCEL_FILES_PATH is None:
        # stdio mode: local caller is trusted
        if not os.path.isabs(filename):
            raise ValueError("must be absolute path in stdio mode")
        return filename

    # Remote mode (SSE / streamable-http): enforce sandbox
    if os.path.isabs(filename):
        raise ValueError("absolute paths are not permitted in remote mode")
    if "\x00" in filename:
        raise ValueError("NUL byte in filename")

    base = os.path.realpath(EXCEL_FILES_PATH)
    candidate = os.path.realpath(os.path.join(base, filename))

    if not candidate.startswith(base + os.sep) and candidate != base:
        raise ValueError(f"path escapes EXCEL_FILES_PATH: {filename}")

    return candidate

References

Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 0.1.7"
      },
      "package": {
        "ecosystem": "PyPI",
        "name": "excel-mcp-server"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "0.1.8"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-40576"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-04-14T00:03:17Z",
    "nvd_published_at": "2026-04-21T17:16:55Z",
    "severity": "CRITICAL"
  },
  "details": "## Summary\n\nA path traversal vulnerability exists in [`excel-mcp-server`](https://github.com/haris-musa/excel-mcp-server) versions up to and including `0.1.7`. When running in SSE or Streamable-HTTP transport mode (the documented way to use this server remotely), an unauthenticated attacker on the network can read, write, and overwrite arbitrary files on the host filesystem by supplying crafted `filepath` arguments to any of the 25 exposed MCP tool handlers.\n\nThe server is intended to confine file operations to a directory set by the `EXCEL_FILES_PATH` environment variable. The function responsible for enforcing this boundary \u2014 `get_excel_path()` \u2014 fails to do so due to two independent flaws: it passes absolute paths through without any check, and it joins relative paths without resolving or validating the result. Combined with zero authentication on the default network-facing transport and a default bind address of `0.0.0.0` (all interfaces), this allows trivial remote exploitation.\n\n---\n\n## Details\n\n| Field | Value |\n|-------|-------|\n| **Package** | [`excel-mcp-server`](https://pypi.org/project/excel-mcp-server/) (PyPI) |\n| **Repository** | https://github.com/haris-musa/excel-mcp-server |\n| **Affected versions** | `\u003c= 0.1.7` |\n| **Tested version** | `0.1.7` \u2014 commit [`de4dc75`](https://github.com/haris-musa/excel-mcp-server/commit/de4dc75f6ba629ccd2e097f5963235846be622e6) |\n| **CWE** | [CWE-22](https://cwe.mitre.org/data/definitions/22.html) \u2014 Improper Limitation of a Pathname to a Restricted Directory |\n| **CVSS 3.1** | **8.2 High** \u2014 `AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H` |\n| **Transports affected** | `sse`, `streamable-http` (network-facing) |\n| **Authentication required** | **None** |\n\n---\n\n## Vulnerable Code\n\nThe root cause is in `src/excel_mcp/server.py`, lines 75\u201394:\n\n```python\ndef get_excel_path(filename: str) -\u003e str:\n    \"\"\"Get full path to Excel file.\"\"\"\n\n    # FLAW 1 \u2014 absolute paths bypass the sandbox entirely\n    if os.path.isabs(filename):\n        return filename                     # line 86: returned as-is\n\n    # In SSE/HTTP mode, EXCEL_FILES_PATH is set\n    if EXCEL_FILES_PATH is None:\n        raise ValueError(...)\n\n    # FLAW 2 \u2014 relative paths joined without boundary validation\n    return os.path.join(EXCEL_FILES_PATH, filename)   # line 94: \"../\" escapes\n```\n\n### Why this is exploitable\n\n**Flaw 1 \u2014 Absolute path bypass (line 86):**\nIf the attacker passes `filepath=\"/etc/shadow\"` or `filepath=\"/home/user/secrets.xlsx\"`, the function returns it unchanged. The sandbox directory `EXCEL_FILES_PATH` is never consulted.\n\n**Flaw 2 \u2014 Relative traversal (line 94):**\n`os.path.join(\"/srv/sandbox\", \"../../etc/passwd\")` produces `\"/srv/sandbox/../../etc/passwd\"`, which resolves to `\"/etc/passwd\"`. No `os.path.realpath()` or `os.path.commonpath()` check is performed, so `../` sequences escape the sandbox.\n\n### Contributing factors that increase severity\n\n1. **Default bind address is `0.0.0.0`** (all interfaces) \u2014 `server.py` line 70:\n   ```python\n   host=os.environ.get(\"FASTMCP_HOST\", \"0.0.0.0\"),\n   ```\n   A user who follows the README and runs `uvx excel-mcp-server streamable-http` without explicitly setting `FASTMCP_HOST` exposes the server to their entire LAN.\n\n2. **Zero authentication** \u2014 FastMCP\u0027s SSE and Streamable-HTTP transports ship with no authentication. The server adds none. Any TCP client that reaches port 8017 can call any tool.\n\n3. **All 25 tool handlers are affected** \u2014 every `@mcp.tool()` decorated function calls `get_excel_path(filepath)` as its first action. This is not an isolated endpoint; it is the entire API surface.\n\n4. **Arbitrary directory creation** \u2014 `src/excel_mcp/workbook.py` line 24 runs `path.parent.mkdir(parents=True, exist_ok=True)` before saving, meaning the attacker can create directory trees at any writable location.\n\n---\n\n## Proof of Concept\n\n### Video demonstration\n\n[![asciicast](https://asciinema.org/a/2HVA3uKvVeFahIXY.svg)](https://asciinema.org/a/2HVA3uKvVeFahIXY)\n\n**asciinema recording:** https://asciinema.org/a/2HVA3uKvVeFahIXY\n\nI have also attached the full PoC shell script (`record-poc.sh`) and the Python exploit script (`exploit_test.py`) to a Google Drive for the maintainer to review and reproduce independently:\n\n**Google Drive (PoC scripts):**  Shared privately via email\n\nContents:\n- `record-poc.sh` \u2014 automated PoC recording script (bash)\n- `exploit_test.py` \u2014 Python exploit that tests all 7 primitives against a running server\n\n### Setup\n\n```bash\n# install\npip install excel-mcp-server mcp httpx\n\n# start server with a sandbox directory\nmkdir -p /tmp/sandbox\nEXCEL_FILES_PATH=/tmp/sandbox FASTMCP_HOST=127.0.0.1 FASTMCP_PORT=8017 \\\n    excel-mcp-server streamable-http\n```\n\n### Exploit script\n\nThe following Python script connects to the server with zero credentials and demonstrates all exploitation primitives:\n\n{REMOVING CAUSE FOR SAFETY CONCERNS}\n\n### Results\n\nAll 7 test cases passed against a live server instance:\n\n```\nCONFIRMED: 7  |  FAILED: 0\n\n[CONFIRMED] AUTH: Connected with ZERO authentication. 25 tools exposed.\n[CONFIRMED] P1-WRITE-ABS: file exists=True size=4783B (outside sandbox)\n[CONFIRMED] P2-WRITE-TRAVERSAL: escaped sandbox via ../ exists=True\n[CONFIRMED] P3-MKDIR: attacker directory tree created=True\n[CONFIRMED] P4-READ: exfiltrated SSN=True name=True\n[CONFIRMED] P5-OVERWRITE: victim data replaced=True\n[CONFIRMED] P6-STAT: server attempted to open /etc/hostname (format error confirms file access)\n```\n\n### Filesystem evidence (independently verified after exploit)\n\n**Files created outside the sandbox:**\n```\n$ ls -la /tmp/cve-hunt/outside_sandbox/\n-rw-rw-r-- 1 hitarth hitarth 4783 Apr 10 17:36 P1_absolute_write.xlsx\n-rw-rw-r-- 1 hitarth hitarth 4783 Apr 10 17:36 P2_traversal_write.xlsx\n```\n\n**Attacker-created directory tree:**\n```\n$ find /tmp/cve-hunt/attacker_dir\n/tmp/cve-hunt/attacker_dir\n/tmp/cve-hunt/attacker_dir/deep\n/tmp/cve-hunt/attacker_dir/deep/nested\n/tmp/cve-hunt/attacker_dir/deep/nested/x.xlsx\n```\n\n**Victim file after overwrite (original SSN destroyed):**\n```\n  (\u0027SSN\u0027, \u0027Name\u0027)\n  (\u0027ATTACKER-CONTROLLED\u0027, \u0027PWNED\u0027)     # was: (\u0027123-45-6789\u0027, \u0027Alice Johnson\u0027)\n  (\u0027987-65-4321\u0027, \u0027Bob Smith\u0027)\n```\n\n---\n\n## Impact\n\nAn unauthenticated network attacker can:\n\n| What | How | Severity |\n|------|-----|----------|\n| **Read any `.xlsx` file** on the host | Supply absolute path to `read_data_from_excel` | Confidentiality loss \u2014 cross-tenant data theft of financial data, HR records, reports |\n| **Write `.xlsx` files anywhere** on the filesystem | Supply absolute path or `../` traversal to `create_workbook` or `write_data_to_excel` | Integrity loss \u2014 destroy or corrupt any writable `.xlsx`, plant malicious files |\n| **Create arbitrary directories** anywhere writable | `create_workbook` triggers `mkdir(parents=True)` on attacker-controlled path | Precursor to privilege escalation or DoS |\n| **Overwrite existing business files** with attacker content | `write_data_to_excel` with absolute path to target | Silent data corruption \u2014 audit reports, salary sheets, financial models |\n| **Fill disk** via repeated writes | Loop `create_workbook` with unique filenames | Denial of service \u2014 crash services dependent on free disk |\n| **Plant macro-enabled templates** (`.xltm`) at known shared paths | `create_workbook` at path like `/home/user/Templates/report.xltm` | Client-side RCE chain when downstream user opens the template in Excel |\n\n### Who is affected\n\nAnyone running `excel-mcp-server` in SSE or Streamable-HTTP mode on a reachable network \u2014 which is the documented and recommended deployment for remote use. The project README explicitly states:\n- *\"Works both locally and as a remote service\"*\n- *\"Streamable HTTP Transport (Recommended for remote connections)\"*\n\nThe server has **3,655+ GitHub stars** and is published on **PyPI** with active downloads.\n\n---\n\n## Suggested Fix\n\nReplace `get_excel_path()` with a version that enforces the sandbox boundary:\n\n```python\nimport os\n\ndef get_excel_path(filename: str) -\u003e str:\n    if EXCEL_FILES_PATH is None:\n        # stdio mode: local caller is trusted\n        if not os.path.isabs(filename):\n            raise ValueError(\"must be absolute path in stdio mode\")\n        return filename\n\n    # Remote mode (SSE / streamable-http): enforce sandbox\n    if os.path.isabs(filename):\n        raise ValueError(\"absolute paths are not permitted in remote mode\")\n    if \"\\x00\" in filename:\n        raise ValueError(\"NUL byte in filename\")\n\n    base = os.path.realpath(EXCEL_FILES_PATH)\n    candidate = os.path.realpath(os.path.join(base, filename))\n\n    if not candidate.startswith(base + os.sep) and candidate != base:\n        raise ValueError(f\"path escapes EXCEL_FILES_PATH: {filename}\")\n\n    return candidate\n```\n\n## References\n\n- [CWE-22: Improper Limitation of a Pathname to a Restricted Directory](https://cwe.mitre.org/data/definitions/22.html)\n- [OWASP Path Traversal](https://owasp.org/www-community/attacks/Path_Traversal)\n- [Model Context Protocol Specification](https://modelcontextprotocol.io/)\n- [FastMCP Documentation](https://github.com/jlowin/fastmcp)",
  "id": "GHSA-j98m-w3xp-9f56",
  "modified": "2026-04-24T20:44:55Z",
  "published": "2026-04-14T00:03:17Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/haris-musa/excel-mcp-server/security/advisories/GHSA-j98m-w3xp-9f56"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-40576"
    },
    {
      "type": "WEB",
      "url": "https://github.com/haris-musa/excel-mcp-server/commit/f51340ecd5778952405044b203d3a2d4c8a46833"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/haris-musa/excel-mcp-server"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "excel-mcp-server has a Path Traversal issue"
}

GHSA-J9C4-4MG9-MWFH

Vulnerability from github – Published: 2026-07-08 06:31 – Updated: 2026-07-08 06:31
VLAI
Details

The Jssor Slider by jssor.com plugin for WordPress is vulnerable to Directory Traversal in all versions up to, and including, 3.1.24 via the 'url' parameter parameter. This makes it possible for unauthenticated attackers to read the contents of arbitrary files on the server, which can contain sensitive information.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-14244"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-07-08T05:16:26Z",
    "severity": "HIGH"
  },
  "details": "The Jssor Slider by jssor.com plugin for WordPress is vulnerable to Directory Traversal in all versions up to, and including, 3.1.24 via the \u0027url\u0027 parameter parameter. This makes it possible for unauthenticated attackers to read the contents of arbitrary files on the server, which can contain sensitive information.",
  "id": "GHSA-j9c4-4mg9-mwfh",
  "modified": "2026-07-08T06:31:35Z",
  "published": "2026-07-08T06:31:35Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-14244"
    },
    {
      "type": "WEB",
      "url": "https://plugins.trac.wordpress.org/browser/jssor-slider/tags/3.1.24/interface/api/class-jssor-slider-admin-controller.php#L307"
    },
    {
      "type": "WEB",
      "url": "https://plugins.trac.wordpress.org/browser/jssor-slider/tags/3.1.24/interface/api/class-jssor-slider-admin-controller.php#L414"
    },
    {
      "type": "WEB",
      "url": "https://plugins.trac.wordpress.org/browser/jssor-slider/tags/3.1.24/interface/api/class-jssor-slider-admin-controller.php#L43"
    },
    {
      "type": "WEB",
      "url": "https://plugins.trac.wordpress.org/browser/jssor-slider/tags/3.1.24/interface/api/class-jssor-slider-admin-controller.php#L506"
    },
    {
      "type": "WEB",
      "url": "https://plugins.trac.wordpress.org/browser/jssor-slider/tags/3.1.24/jssor-slider-dispatcher.php#L96"
    },
    {
      "type": "WEB",
      "url": "https://plugins.trac.wordpress.org/browser/jssor-slider/tags/3.1.24/jssor-slider.php#L128"
    },
    {
      "type": "WEB",
      "url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/0cd880c9-75fe-420b-ae41-558678adb57b?source=cve"
    }
  ],
  "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-J9G7-MQHH-9HXF

Vulnerability from github – Published: 2025-03-20 12:32 – Updated: 2025-03-21 17:24
VLAI
Summary
DB-GPT Absolute Path Traversal in knowledge/{space_name}/document/upload
Details

eosphoros-ai/db-gpt version 0.6.0 is vulnerable to an arbitrary file write through the knowledge API. The endpoint for uploading files as 'knowledge' is susceptible to absolute path traversal, allowing attackers to write files to arbitrary locations on the target server. This vulnerability arises because the 'doc_file.filename' parameter is user-controllable, enabling the construction of absolute paths.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "dbgpt"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "0.6.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2024-10833"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22",
      "CWE-36"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2025-03-21T17:24:47Z",
    "nvd_published_at": "2025-03-20T10:15:20Z",
    "severity": "CRITICAL"
  },
  "details": "eosphoros-ai/db-gpt version 0.6.0 is vulnerable to an arbitrary file write through the knowledge API. The endpoint for uploading files as \u0027knowledge\u0027 is susceptible to absolute path traversal, allowing attackers to write files to arbitrary locations on the target server. This vulnerability arises because the \u0027doc_file.filename\u0027 parameter is user-controllable, enabling the construction of absolute paths.",
  "id": "GHSA-j9g7-mqhh-9hxf",
  "modified": "2025-03-21T17:24:48Z",
  "published": "2025-03-20T12:32:40Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-10833"
    },
    {
      "type": "WEB",
      "url": "https://github.com/eosphoros-ai/DB-GPT/commit/780ce803e325b87f4ddfbe5824451e379aeee56c"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/eosphoros-ai/DB-GPT"
    },
    {
      "type": "WEB",
      "url": "https://huntr.com/bounties/dc58e981-e325-4c11-b4e1-1095890fd15a"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "DB-GPT Absolute Path Traversal in knowledge/{space_name}/document/upload"
}

GHSA-J9HF-98C3-WRM8

Vulnerability from github – Published: 2024-06-04 18:12 – Updated: 2025-06-27 22:08
VLAI
Summary
malicious container creates symlink "mtab" on the host External
Details

Impact

A malicious container can affect the host by taking advantage of code cri-o added to show the container mounts on the host.

A workload built from this Dockerfile:

FROM docker.io/library/busybox as source
RUN mkdir /extra && cd /extra && ln -s ../../../../../../../../root etc

FROM scratch

COPY --from=source /bin /bin
COPY --from=source /lib /lib
COPY --from=source /extra .

and this container config:

{
  "metadata": {
      "name": "busybox"
  },
  "image":{
      "image": "localhost/test"
  },
  "command": [
      "/bin/true"
  ],
  "linux": {
  }
}


and this sandbox config

{
  "metadata": {
    "name": "test-sandbox",
    "namespace": "default",
    "attempt": 1,
    "uid": "edishd83djaideaduwk28bcsb"
  },
  "linux": {
    "security_context": {
      "namespace_options": {
        "network": 2
      }
    }
  }
}

will create a file on host /host/mtab

Patches

1.30.1, 1.29.5, 1.28.7

Workarounds

Unfortunately not

References

Are there any links users can visit to find out more?

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/cri-o/cri-o"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "1.28.6"
            },
            {
              "fixed": "1.28.7"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/cri-o/cri-o"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "1.29.4"
            },
            {
              "fixed": "1.29.5"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/cri-o/cri-o"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "1.30.0"
            },
            {
              "fixed": "1.30.1"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2024-5154"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22",
      "CWE-668"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2024-06-04T18:12:31Z",
    "nvd_published_at": "2024-06-12T09:15:19Z",
    "severity": "HIGH"
  },
  "details": "### Impact\nA malicious container can affect the host by taking advantage of code cri-o added to show the container mounts on the host.\n\nA workload built from this Dockerfile:\n```\nFROM docker.io/library/busybox as source\nRUN mkdir /extra \u0026\u0026 cd /extra \u0026\u0026 ln -s ../../../../../../../../root etc\n\nFROM scratch\n\nCOPY --from=source /bin /bin\nCOPY --from=source /lib /lib\nCOPY --from=source /extra .\n\n```\n\nand this container config:\n\n```\n{\n  \"metadata\": {\n      \"name\": \"busybox\"\n  },\n  \"image\":{\n      \"image\": \"localhost/test\"\n  },\n  \"command\": [\n      \"/bin/true\"\n  ],\n  \"linux\": {\n  }\n}\n\n\n```\nand this sandbox config  \n```\n{\n  \"metadata\": {\n    \"name\": \"test-sandbox\",\n    \"namespace\": \"default\",\n    \"attempt\": 1,\n    \"uid\": \"edishd83djaideaduwk28bcsb\"\n  },\n  \"linux\": {\n    \"security_context\": {\n      \"namespace_options\": {\n        \"network\": 2\n      }\n    }\n  }\n}\n\n```\n\nwill create a file on host `/host/mtab`\n\n### Patches\n1.30.1, 1.29.5, 1.28.7\n\n### Workarounds\nUnfortunately not\n\n### References\n_Are there any links users can visit to find out more?_",
  "id": "GHSA-j9hf-98c3-wrm8",
  "modified": "2025-06-27T22:08:30Z",
  "published": "2024-06-04T18:12:31Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/cri-o/cri-o/security/advisories/GHSA-j9hf-98c3-wrm8"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-5154"
    },
    {
      "type": "WEB",
      "url": "https://access.redhat.com/errata/RHSA-2024:10818"
    },
    {
      "type": "WEB",
      "url": "https://access.redhat.com/errata/RHSA-2024:3676"
    },
    {
      "type": "WEB",
      "url": "https://access.redhat.com/errata/RHSA-2024:3700"
    },
    {
      "type": "WEB",
      "url": "https://access.redhat.com/errata/RHSA-2024:4008"
    },
    {
      "type": "WEB",
      "url": "https://access.redhat.com/errata/RHSA-2024:4159"
    },
    {
      "type": "WEB",
      "url": "https://access.redhat.com/errata/RHSA-2024:4486"
    },
    {
      "type": "WEB",
      "url": "https://access.redhat.com/security/cve/CVE-2024-5154"
    },
    {
      "type": "WEB",
      "url": "https://bugzilla.redhat.com/show_bug.cgi?id=2280190"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/cri-o/cri-o"
    },
    {
      "type": "WEB",
      "url": "https://pkg.go.dev/vuln/GO-2024-2919"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "malicious container creates symlink \"mtab\" on the host External"
}

GHSA-J9M8-735Q-6M8V

Vulnerability from github – Published: 2022-05-02 03:34 – Updated: 2022-05-02 03:34
VLAI
Details

Directory traversal vulnerability in test/index.php in PHP-Sugar 0.80 allows remote attackers to read arbitrary files via a ..// (dot dot slash slash) in the t parameter.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2009-2398"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2009-07-09T16:30:00Z",
    "severity": "MODERATE"
  },
  "details": "Directory traversal vulnerability in test/index.php in PHP-Sugar 0.80 allows remote attackers to read arbitrary files via a ..// (dot dot slash slash) in the t parameter.",
  "id": "GHSA-j9m8-735q-6m8v",
  "modified": "2022-05-02T03:34:42Z",
  "published": "2022-05-02T03:34:42Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2009-2398"
    },
    {
      "type": "WEB",
      "url": "http://www.exploit-db.com/exploits/9036"
    },
    {
      "type": "WEB",
      "url": "http://www.vupen.com/english/advisories/2009/1735"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-J9MR-P9R5-6RH3

Vulnerability from github – Published: 2025-08-13 09:30 – Updated: 2025-08-13 09:30
VLAI
Details

Organization Portal System developed by WellChoose has an Arbitrary File Reading vulnerability, allowing remote attackers with regular privileges to exploit Absolute Path Traversal to download arbitrary system files.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2025-8909"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22",
      "CWE-36"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2025-08-13T09:15:29Z",
    "severity": "HIGH"
  },
  "details": "Organization Portal System developed by WellChoose has an Arbitrary File Reading vulnerability, allowing remote attackers with regular privileges to exploit Absolute Path Traversal to download arbitrary system files.",
  "id": "GHSA-j9mr-p9r5-6rh3",
  "modified": "2025-08-13T09:30:32Z",
  "published": "2025-08-13T09:30:32Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-8909"
    },
    {
      "type": "WEB",
      "url": "https://www.twcert.org.tw/en/cp-139-10325-70192-2.html"
    },
    {
      "type": "WEB",
      "url": "https://www.twcert.org.tw/tw/cp-132-10321-3cae5-1.html"
    }
  ],
  "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"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/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"
    }
  ]
}

GHSA-J9Q2-Q6GV-W438

Vulnerability from github – Published: 2024-12-10 00:31 – Updated: 2024-12-12 03:33
VLAI
Details

An issue was discovered in Digi ConnectPort LTS before 1.4.12. A Directory Traversal vulnerability exists in WebFS. This allows an attacker on the local area network to manipulate URLs to include traversal sequences, potentially leading to unauthorized access to data.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2024-50626"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2024-12-09T22:15:22Z",
    "severity": "HIGH"
  },
  "details": "An issue was discovered in Digi ConnectPort LTS before 1.4.12. A Directory Traversal vulnerability exists in WebFS. This allows an attacker on the local area network to manipulate URLs to include traversal sequences, potentially leading to unauthorized access to data.",
  "id": "GHSA-j9q2-q6gv-w438",
  "modified": "2024-12-12T03:33:01Z",
  "published": "2024-12-10T00:31:26Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-50626"
    },
    {
      "type": "WEB",
      "url": "https://www.digi.com/getattachment/Resources/Security/Alerts/Digi-ConnectPort-LTS-Firmware-Update/ConnectPort-LTS-KB.pdf"
    },
    {
      "type": "WEB",
      "url": "https://www.digi.com/resources/documentation/digidocs/pdfs/90001001.pdf"
    },
    {
      "type": "WEB",
      "url": "https://www.digi.com/resources/security"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

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.