CVE-2026-32116: Magic Wormhole "wormhole Receive" Allows Arbitrary Local Vulnerability

HIGH
Advisory Identifier: GHSA-4g4c-mfqg-pj8r
CWE-22
Published
Advisory Summary

CVE-2026-32116 is a HIGH "wormhole receive" allows arbitrary local vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Magic Wormhole libraries in the PyPI ecosystem. The issue involves "wormhole receive" allows arbitrary local file overwrite. Remediation is available by upgrading affected packages to version 0.23.0.

CVE-2026-32116 at a Glance

CVE Identifier CVE-2026-32116
GHSA Identifier GHSA-4g4c-mfqg-pj8r
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Magic Wormhole
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2026-32116

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

magic-wormhole fixed: 0.23.0
pip install magic-wormhole>=0.23.0
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 magic-wormhole

How to Check if You Are Affected

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

pip show magic-wormhole

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

Note: The pip show magic-wormhole 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 Magic Wormhole, 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

### Impact _What kind of vulnerability is it? Who is impacted?_ Receiving a file (`wormhole receive`) from a malicious party could result in overwriting critical local files, including `~/.ssh/authorized_keys` and `.bashrc`. This could be used to compromise the receiver's computer. Only the sender of the file (the party who runs `wormhole send`) can mount the attack. Other parties (including the transit/relay servers) are excluded by the wormhole protocol. ### Patches _Has the problem been patched? What versions should users upgrade to?_ The bug has been fixed in magic-wormhole 0.23.0. All users should upgrade to this version. The vulnerability first surfaced in the 0.21.0 release on 23-Oct-2025. ### Workarounds _Is there a way for users to fix or remediate the vulnerability without upgrading?_ As a workaround, the receiver can override the sender's filename with the `--output` or `-o` option. For example: `wormhole receive -o shopping-list.txt` will write the file to `shopping-list.txt` in the local directory, regardless of what the sender tries to do. To be effective, this option must be added to every invocation of `wormhole receive` / `wormhole rx`. ### References _Are there any links users can visit to find out more?_ Incoming file transfer requests include a `filename`, used to decide where the file contents will be written. Well-behaving senders compute this from the `basename()` of the sent file (which discards all but the last segment of the path). To guard against malicious senders, the receiver also applies `basename()` to the incoming filename. During refactoring in version 0.21.0, this receiver-side check was accidentally dropped. The check was restored in version 0.23.0 along with a unit test. Many thanks to Ian McKenzie (@ikmckenz) for spotting the bug and reaching out with a fix.

CVE-2026-32116 Affected Magic Wormhole Versions

1 component(s)
Fixed Versions:
0.23.0
Product / Package Ecosystem Affected Versions Fixed Version
magic-wormhole
PyPI
≥ 0.21.0
< 0.23.0
0.23.0

References

Frequently Asked Questions

What is CVE-2026-32116?
CVE-2026-32116 is a security vulnerability in Magic Wormhole involving "wormhole receive" allows arbitrary local file overwrite under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Magic Wormhole versions are affected?
Affected versions include releases prior to 0.23.0 across affected packages: magic-wormhole.
What version fixes CVE-2026-32116?
Upgrading to 0.23.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is magic-wormhole affected?
Yes, magic-wormhole is affected in releases prior to 0.23.0. Upgrade your dependency to 0.23.0 or later.
What CWE is associated with CVE-2026-32116?
CVE-2026-32116 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-32116?
Run the dependency tree command: 'pip show magic-wormhole'. 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-4g4c-mfqg-pj8r",
  "modified" : "2026-03-13T15:40:20Z",
  "published" : "2026-03-13T15:40:20Z",
  "aliases" : [ "CVE-2026-32116" ],
  "summary" : "Magic Wormhole: \"wormhole receive\" allows arbitrary local file overwrite",
  "details" : "### Impact\n_What kind of vulnerability is it? Who is impacted?_\n\nReceiving a file (`wormhole receive`) from a malicious party could result in overwriting critical local files, including `~/.ssh/authorized_keys` and `.bashrc`. This could be used to compromise the receiver's computer.\n\nOnly the sender of the file (the party who runs `wormhole send`) can mount the attack. Other parties (including the transit/relay servers) are excluded by the wormhole protocol.\n\n### Patches\n_Has the problem been patched? What versions should users upgrade to?_\n\nThe bug has been fixed in magic-wormhole 0.23.0. All users should upgrade to this version.\n\nThe vulnerability first surfaced in the 0.21.0 release on 23-Oct-2025.\n\n### Workarounds\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n\nAs a workaround, the receiver can override the sender's filename with the `--output` or `-o` option. For example: `wormhole receive -o shopping-list.txt` will write the file to `shopping-list.txt` in the local directory, regardless of what the sender tries to do. To be effective, this option must be added to every invocation of `wormhole receive` / `wormhole rx`.\n\n### References\n_Are there any links users can visit to find out more?_\n\nIncoming file transfer requests include a `filename`, used to decide where the file contents will be written. Well-behaving senders compute this from the `basename()` of the sent file (which discards all but the last segment of the path). To guard against malicious senders, the receiver also applies `basename()` to the incoming filename. During refactoring in version 0.21.0, this receiver-side check was accidentally dropped. The check was restored in version 0.23.0 along with a unit test.\n\nMany thanks to Ian McKenzie (@ikmckenz) for spotting the bug and reaching out with a fix.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:A/VC:N/VI:H/VA:N/SC:N/SI:H/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "magic-wormhole"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.21.0"
      }, {
        "fixed" : "0.23.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/magic-wormhole/magic-wormhole/security/advisories/GHSA-4g4c-mfqg-pj8r"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-32116"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/magic-wormhole/magic-wormhole"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-13T15:40:20Z",
    "nvd_published_at" : "2026-03-12T18:16:24Z"
  }
}