CVE-2026-43901: Wireshark mcp Wireshark-mcp Vulnerable To Arbitrary File Vulnerability

MODERATE
Advisory Identifier: GHSA-3r68-x3xc-rxpg
CVSS 6.8
CWE-22
Published
Advisory Summary

CVE-2026-43901 is a MODERATE (CVSS 6.8) wireshark-mcp vulnerable to arbitrary file vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Wireshark mcp libraries in the PyPI ecosystem. The issue involves wireshark-mcp vulnerable to arbitrary file write via export_objects when wireshark_mcp_allowed_dirs is not configured. Remediation is available in the latest vendor maintenance releases.

CVE-2026-43901 at a Glance

CVE Identifier CVE-2026-43901
GHSA Identifier GHSA-3r68-x3xc-rxpg
Severity MODERATE
CVSS v3.1 Base Score 6.8
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Wireshark mcp
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-43901

To remediate this vulnerability, upgrade all affected Wireshark mcp dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

wireshark-mcp fixed: Latest secure release
pip install wireshark-mcp>=Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show wireshark-mcp

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-43901, inspect your installed packages using pip:

pip show wireshark-mcp

Analyze the terminal output to locate any version of Wireshark mcp in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: The pip show wireshark-mcp command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where 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. In Wireshark mcp, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Description ### Impact `wireshark-mcp` exposes a `wireshark_export_objects` MCP tool that accepts an attacker-controlled `dest_dir` parameter and passes it to tshark's `--export-objects` flag with **no mandatory path restriction**. The path sandbox (`_allowed_dirs`) is `None` by default and only activates when the environment variable `WIRESHARK_MCP_ALLOWED_DIRS` is explicitly set. In a default installation, any directory on the filesystem can be used as the export destination. **Affected code** (`src/wireshark_mcp/tshark/client.py:531-543`): ```python output_validation = self._validate_output_path(dest_dir) # _validate_output_path only enforces the sandbox when _allowed_dirs is set. # Default: _allowed_dirs = None → no restriction. os.makedirs(dest_dir, exist_ok=True) # creates arbitrary directories cmd = [..., "--export-objects", f"{protocol},{dest_dir}"] ``` ### Attack Scenario An attacker embeds a crafted HTTP response in a pcap file (e.g. `Content-Disposition: filename=authorized_keys`). Via prompt injection in the pcap payload, an AI model using this MCP server is manipulated into calling `wireshark_export_objects` with: ```bash dest_dir=/home/user/.ssh/ ``` `tshark` then extracts and writes the HTTP object to that path, granting the attacker SSH access. The same technique can target: - `/etc/cron.d/` - Writable web roots - Other sensitive filesystem locations ### Additional Affected Operations The same missing sandbox affects: - `merge_pcap_files` - `editcap_trim` - `editcap_split` - `editcap_time_shift` - `editcap_deduplicate` - `text2pcap_import` ### Proof of Concept Confirmed on **wireshark-mcp v1.1.5** with **tshark 4.6.4**. A crafted pcap’s HTTP object was successfully written to an arbitrary filesystem path when: ```python _allowed_dirs = None ``` --- ## Patches Not yet patched. A fix should make the path sandbox **mandatory** for all file-write operations rather than optional: ```python # Reject all write operations when no sandbox is configured if not self._allowed_dirs: return json.dumps({ "success": False, "error": { "type": "SecurityError", "message": "Set WIRESHARK_MCP_ALLOWED_DIRS before using file-write operations" } }) ``` --- ## Workarounds Set `WIRESHARK_MCP_ALLOWED_DIRS` to a restricted safe directory before starting the server: ```bash export WIRESHARK_MCP_ALLOWED_DIRS=/tmp/wireshark_mcp_safe ``` This activates the existing sandbox and blocks writes outside the allowed path. --- ## Resources - Vulnerable code: - `src/wireshark_mcp/tshark/client.py` lines 521–543 - `src/wireshark_mcp/tshark/client.py` lines 685–839 - CWE-22: Improper Limitation of a Pathname to a Restricted Directory - CWE-73: External Control of File Name or Path

CVE-2026-43901 Affected Wireshark mcp Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
wireshark-mcp
PyPI
≤ 1.1.5

References

Frequently Asked Questions

What is CVE-2026-43901?
CVE-2026-43901 is a security vulnerability in Wireshark mcp involving wireshark-mcp vulnerable to arbitrary file write via export_objects when WIRESHARK_MCP_ALLOWED_DIRS is not configured under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Wireshark mcp versions are affected?
Affected versions include releases prior to current release patches across affected packages: wireshark-mcp.
What version fixes CVE-2026-43901?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is wireshark-mcp affected?
Yes, wireshark-mcp is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2026-43901?
CVE-2026-43901 has a CVSS v3.1 base score of 6.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2026-43901?
CVE-2026-43901 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (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.).
How can I check PyPI dependencies for CVE-2026-43901?
Run the dependency tree command: 'pip show wireshark-mcp'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-3r68-x3xc-rxpg",
  "modified" : "2026-05-13T15:20:15Z",
  "published" : "2026-05-05T20:15:12Z",
  "aliases" : [ "CVE-2026-43901" ],
  "summary" : "wireshark-mcp vulnerable to arbitrary file write via export_objects when WIRESHARK_MCP_ALLOWED_DIRS is not configured",
  "details" : "## Description\n\n### Impact\n\n`wireshark-mcp` exposes a `wireshark_export_objects` MCP tool that accepts an attacker-controlled `dest_dir` parameter and passes it to tshark's `--export-objects` flag with **no mandatory path restriction**.\n\nThe path sandbox (`_allowed_dirs`) is `None` by default and only activates when the environment variable `WIRESHARK_MCP_ALLOWED_DIRS` is explicitly set. In a default installation, any directory on the filesystem can be used as the export destination.\n\n**Affected code** (`src/wireshark_mcp/tshark/client.py:531-543`):\n\n```python\n\noutput_validation = self._validate_output_path(dest_dir)\n\n# _validate_output_path only enforces the sandbox when _allowed_dirs is set.\n\n# Default: _allowed_dirs = None → no restriction.\n\nos.makedirs(dest_dir, exist_ok=True)   # creates arbitrary directories\n\ncmd = [..., \"--export-objects\", f\"{protocol},{dest_dir}\"]\n\n```\n\n### Attack Scenario\n\nAn attacker embeds a crafted HTTP response in a pcap file (e.g. `Content-Disposition: filename=authorized_keys`). Via prompt injection in the pcap payload, an AI model using this MCP server is manipulated into calling `wireshark_export_objects` with:\n\n```bash\n\ndest_dir=/home/user/.ssh/\n\n```\n\n`tshark` then extracts and writes the HTTP object to that path, granting the attacker SSH access.\n\nThe same technique can target:\n\n- `/etc/cron.d/`\n\n- Writable web roots\n\n- Other sensitive filesystem locations\n\n### Additional Affected Operations\n\nThe same missing sandbox affects:\n\n- `merge_pcap_files`\n\n- `editcap_trim`\n\n- `editcap_split`\n\n- `editcap_time_shift`\n\n- `editcap_deduplicate`\n\n- `text2pcap_import`\n\n### Proof of Concept\n\nConfirmed on **wireshark-mcp v1.1.5** with **tshark 4.6.4**.\n\nA crafted pcap’s HTTP object was successfully written to an arbitrary filesystem path when:\n\n```python\n\n_allowed_dirs = None\n\n```\n\n---\n\n## Patches\n\nNot yet patched.\n\nA fix should make the path sandbox **mandatory** for all file-write operations rather than optional:\n\n```python\n\n# Reject all write operations when no sandbox is configured\n\nif not self._allowed_dirs:\n\n    return json.dumps({\n\n        \"success\": False,\n\n        \"error\": {\n\n            \"type\": \"SecurityError\",\n\n            \"message\": \"Set WIRESHARK_MCP_ALLOWED_DIRS before using file-write operations\"\n\n        }\n\n    })\n\n```\n\n---\n\n## Workarounds\n\nSet `WIRESHARK_MCP_ALLOWED_DIRS` to a restricted safe directory before starting the server:\n\n```bash\n\nexport WIRESHARK_MCP_ALLOWED_DIRS=/tmp/wireshark_mcp_safe\n\n```\n\nThis activates the existing sandbox and blocks writes outside the allowed path.\n\n---\n\n## Resources\n\n- Vulnerable code:\n\n  - `src/wireshark_mcp/tshark/client.py` lines 521–543\n\n  - `src/wireshark_mcp/tshark/client.py` lines 685–839\n\n- CWE-22: Improper Limitation of a Pathname to a Restricted Directory\n\n- CWE-73: External Control of File Name or Path",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "wireshark-mcp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "1.1.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/bx33661/Wireshark-MCP/security/advisories/GHSA-3r68-x3xc-rxpg"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-43901"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/bx33661/Wireshark-MCP"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-05T20:15:12Z",
    "nvd_published_at" : "2026-05-11T23:20:21Z"
  }
}