{"id":"CVE-2026-43901","aliases":["EUVD-2026-29338","GHSA-3r68-x3xc-rxpg","PYSEC-2026-3426","UBUNTU-CVE-2026-43901"],"status":"published","title":"Wireshark MCP: Arbitrary file write via export_objects when WIRESHARK_MCP_ALLOWED_DIRS is not configured","description":"Wireshark MCP is an MCP Server that turns tshark into a structured analysis interface, then layers in optional Wireshark suite utilities. In 1.1.5 and earlier, 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.","severity":{"version":"3.1","score":6.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.00345,"percentile":0.28227,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":false},"cwes":["CWE-22"],"published":"2026-05-05T20:15:12Z","modified":"2026-10-28T02:31:03Z","affected":[{"source":"ghsa","ecosystem":"PyPI","package":"wireshark-mcp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"1.1.5"}]}]},{"source":"osv","ecosystem":"PyPI","package":"wireshark-mcp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"1.1.5"}]}],"versions":["0.2.1","0.4.0","0.5.0","0.6.0","0.6.1","0.6.2","0.6.3","0.6.4","0.6.5","1.0.0","1.1.0","1.1.5"]},{"source":"osv","ecosystem":"PyPI","package":"wireshark-mcp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"1.1.5"}]}],"versions":["0.2.1","0.4.0","0.5.0","0.6.0","0.6.1","0.6.2","0.6.3","0.6.4","0.6.5","1.0.0","1.1.0","1.1.5"]},{"source":"osv","ecosystem":"Ubuntu:Pro:14.04:LTS","package":"wireshark","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.10.2-1","1.10.3-1","1.10.5-1ubuntu1","1.10.5-2","1.10.6-1","1.12.1+g01b65bf-4+deb8u11ubuntu0.14.04.1","2.6.3-1~ubuntu14.04.1","2.6.4-2~ubuntu14.04.1","2.6.5-1~ubuntu14.04.1","2.6.6-1~ubuntu14.04.0","2.6.8-1~ubuntu14.04.0~esm1","2.6.10-1~ubuntu14.04.0~esm1","2.6.10-1~ubuntu14.04.0~esm2","2.6.10-1~ubuntu14.04.0~esm3"]},{"source":"osv","ecosystem":"Ubuntu:Pro:16.04:LTS","package":"wireshark","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.12.7+g7fc8978-1","1.12.8+g5b6e543-2","2.0.1+g59ea380-3build1","2.0.2+ga16e22e-1","2.2.6+g32dac6a-2ubuntu0.16.04","2.6.3-1~ubuntu16.04.1","2.6.4-2~ubuntu16.04.0","2.6.5-1~ubuntu16.04.0","2.6.6-1~ubuntu16.04.0","2.6.8-1~ubuntu16.04.0","2.6.10-1~ubuntu16.04.0","2.6.10-1~ubuntu16.04.0+esm1","2.6.10-1~ubuntu16.04.0+esm2"]},{"source":"osv","ecosystem":"Ubuntu:Pro:18.04:LTS","package":"wireshark","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.4.2-1","2.4.3-1","2.4.4-1","2.4.5-1","2.6.3-1~ubuntu18.04.1","2.6.4-2~ubuntu18.04.0","2.6.5-1~ubuntu18.04.0","2.6.6-1~ubuntu18.04.0","2.6.8-1~ubuntu18.04.0","2.6.10-1~ubuntu18.04.0","2.6.10-1~ubuntu18.04.0+esm1","2.6.10-1~ubuntu18.04.0+esm2"]},{"source":"osv","ecosystem":"Ubuntu:Pro:20.04:LTS","package":"wireshark","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.0.5-1","3.0.7-1","3.2.1-1","3.2.2-1","3.2.3-1","3.2.3-1ubuntu0.1~esm1","3.2.3-1ubuntu0.1~esm2"]},{"source":"osv","ecosystem":"Ubuntu:Pro:22.04:LTS","package":"wireshark","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.4.7-1~exp1","3.4.9-1","3.6.2-1ubuntu1","3.6.2-2","3.6.2-2ubuntu0.1~esm1"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"wireshark","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["4.0.8-1","4.0.10-1","4.0.11-1","4.2.0-1","4.2.2-1","4.2.2-1.1build1","4.2.2-1.1build2","4.2.2-1.1build3"]},{"source":"osv","ecosystem":"Ubuntu:25.10","package":"wireshark","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["4.4.5-1","4.4.6-2","4.4.6-2build1","4.4.7-1"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"wireshark","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["4.6.4-1","4.6.6-1","4.6.6-2","4.6.6-2build1"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"wireshark","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["4.4.7-1","4.6.0-1","4.6.1-2","4.6.2-3","4.6.3-1","4.6.4-1"]}],"products":[{"vendor":"bx33661","product":"wireshark-mcp"},{"vendor":"bx33661","product":"wireshark_mcp"}],"references":[{"url":"https://github.com/bx33661/Wireshark-MCP/security/advisories/GHSA-3r68-x3xc-rxpg","tags":["x_refsource_CONFIRM","exploit","Exploit","Mitigation","Patch","Vendor Advisory","advisory","web","report"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-43901","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-3r68-x3xc-rxpg","tags":["advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/43xxx/CVE-2026-43901.json","tags":["advisory"]},{"url":"https://github.com/bx33661/Wireshark-MCP","tags":["package"]},{"url":"https://pypi.org/project/wireshark-mcp","tags":["package"]},{"url":"https://ubuntu.com/security/CVE-2026-43901","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-43901","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2026-43901","title":"Wireshark MCP: Arbitrary file write via export_objects when WIRESHARK_MCP_ALLOWED_DIRS is not configured","description":"Wireshark MCP is an MCP Server that turns tshark into a structured analysis interface, then layers in optional Wireshark suite utilities. In 1.1.5 and earlier, 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.","status":"published","published":"2026-05-11T21:51:41.387Z","modified":"2026-05-13T14:38:55.84Z","cvss":[{"version":"3.1","score":6.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N","level":"medium","assessor":"cna"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T13:37:36.275898Z"}],"euvd":[{"id":"EUVD-2026-29338","description":"Wireshark MCP is an MCP Server that turns tshark into a structured analysis interface, then layers in optional Wireshark suite utilities. In 1.1.5 and earlier, 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.","status":"published","published":"2026-05-11T21:51:41Z","modified":"2026-05-13T14:38:55Z","cvss":[{"version":"3.1","score":6.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N","level":"medium"}],"updated_at":"2026-11-02T19:04:33.75998Z"}],"ghsa":[{"id":"GHSA-3r68-x3xc-rxpg","title":"wireshark-mcp vulnerable to arbitrary file write via export_objects when WIRESHARK_MCP_ALLOWED_DIRS is not configured","description":"## 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","status":"published","published":"2026-05-05T20:15:12Z","modified":"2026-05-13T15:20:16Z","cvss":[{"version":"3.1","score":6.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N","level":"medium"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T14:40:08.003212Z"}],"nvd":[{"id":"CVE-2026-43901","description":"Wireshark MCP is an MCP Server that turns tshark into a structured analysis interface, then layers in optional Wireshark suite utilities. In 1.1.5 and earlier, 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.","status":"published","published":"2026-05-11T23:20:21.697Z","modified":"2026-10-26T18:10:00.173Z","cvss":[{"version":"3.1","score":6.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N","level":"medium","assessor":"secondary"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T14:12:18.239974Z"}],"osv":[{"id":"CVE-2026-43901","title":"Wireshark MCP: Arbitrary file write via export_objects when WIRESHARK_MCP_ALLOWED_DIRS is not configured","description":"Wireshark MCP is an MCP Server that turns tshark into a structured analysis interface, then layers in optional Wireshark suite utilities. In 1.1.5 and earlier, 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.","status":"published","published":"2026-05-11T21:51:41.387Z","modified":"2026-10-28T02:31:03.862036163Z","cvss":[{"version":"3.1","score":6.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N","level":"medium"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T15:45:04.820169Z"},{"id":"GHSA-3r68-x3xc-rxpg","title":"wireshark-mcp vulnerable to arbitrary file write via export_objects when WIRESHARK_MCP_ALLOWED_DIRS is not configured","description":"## 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","status":"published","published":"2026-05-05T20:15:12Z","modified":"2026-07-13T16:43:07.322549535Z","cvss":[{"version":"3.1","score":6.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N","level":"medium"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T15:46:36.092962Z"},{"id":"PYSEC-2026-3426","title":"wireshark-mcp vulnerable to arbitrary file write via export_objects when WIRESHARK_MCP_ALLOWED_DIRS is not configured","description":"## 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","status":"published","published":"2026-07-13T15:15:37.943032Z","modified":"2026-07-13T16:33:05.760985243Z","cvss":[{"version":"3.1","score":6.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N","level":"medium"}],"updated_at":"2026-11-02T15:52:56.847083Z"},{"id":"UBUNTU-CVE-2026-43901","description":"Wireshark MCP is an MCP Server that turns tshark into a structured analysis interface, then layers in optional Wireshark suite utilities. In 1.1.5 and earlier, 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.","status":"published","published":"2026-05-11T23:20:00Z","modified":"2026-10-17T13:00:07.75858827Z","cvss":[{"version":"3.1","score":6.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N","level":"medium"}],"updated_at":"2026-11-02T16:56:22.075798Z"}]}}
