# Security policy

[中文](SECURITY.zh.md)

## Supported versions

Only the latest published version receives security fixes.

| Version | Supported |
|---|---|
| the version npm's `latest` tag points at | yes |
| every earlier version | no |

## Reporting a vulnerability

Report a suspected vulnerability privately. Use GitHub's private vulnerability
reporting on this repository:

https://github.com/Big-Dao/dsh-plugin-wsl-env/security/advisories/new

If that form is not available to you, open an ordinary issue that asks for a
private channel. Do not put exploit details in that issue. A maintainer will reply
with a private place to send them.

Do not post exploit details in a public issue, a discussion, or a pull request
before a fix is released.

## What to include in a report

- The plugin version you tested. `npm ls dsh-plugin-wsl-env` prints it, or name the
  tag you built from.
- Your Windows build and the distro you used. `wsl.exe -l -v` lists the distros.
- The DSH version and the profile name.
- What you expected to happen, and what happened instead.
- The smallest reproduction you can produce, with the exact command.
- Whether the sandbox was enabled at the time. `sandbox: true` is the default.

## Response times

These are targets, not a contract.

| Stage | Target |
|---|---|
| Acknowledge the report | within 3 business days |
| Initial assessment and severity | within 10 business days |
| A fix, or a documented mitigation | within 30 business days |

If a report is out of scope, we will say so and explain why.

## Disclosure

A confirmed vulnerability is fixed and disclosed through the ordinary release
process, not through a separate security track.

- The fix ships in the next release of the package, which is the only version the
  Supported versions table above covers.
- That release records the fix in [`CHANGELOG.md`](CHANGELOG.md), and the GitHub
  Release notes are taken from that section.
- The advisory is published on this repository's Security tab, where the private
  report was filed, once the release that carries the fix is out.

A report that is out of scope, or that we cannot confirm as a vulnerability, is
closed without a published advisory.

## Scope

In scope:

- the plugin's own code under `lib/`;
- the published package `dsh-plugin-wsl-env`.

Out of scope:

- the upstream DSH packages under `@deepseek-ai/`. Report those to their own
  projects.
- WSL itself, the Windows kernel, and `bubblewrap`.
- The configuration of a user's own distro. That includes its `sudoers` rules, its
  mounted filesystems, and the interpreters installed in it.
- Anything that requires an attacker to already control the user's Windows account
  or their distro account.

## Sandbox enforcement is `partial` by design

The plugin reports the sandbox enforcement level as `partial`, not `full`. A
process inside the distro can still start a Windows program through WSL interop,
for example `/mnt/c/.../*.exe`. That program runs outside the Linux sandbox.

This is a documented design boundary, not a vulnerability by itself. The command
`npm run probe:sandbox` demonstrates it on your machine when run from inside the
distro, where `bubblewrap` and `node` must be installed; the README states it in
its Sandbox section.

The strict profile (`maskWindowsDrive: true` with `sandbox: true`, without an
overriding `interopVisibility: visible`) narrows this:
confined profiles shadow `/mnt` with an empty tmpfs, so executables at paths
under `/mnt` cannot be launched from there. Other mounts and unrestricted file
reads are not covered. It does not close the hole — a Windows executable
written into the workspace still runs, because WSL's `binfmt_misc` dispatches on
content, not location — so the reported enforcement stays `partial`. The complete
closure is distro-level (`[interop] enabled=false` in `/etc/wsl.conf`). The three
states and their evidence are tabulated in
[docs/CONFIGURATION.md](docs/CONFIGURATION.md#windows-interop).

A report is still welcome if you find an escape that does not depend on interop,
if the masked profile is bypassable from `/mnt`, or if the plugin ever reports
`full` while interop is reachable.

One escape of that kind is known and narrowed by an opt-in profile: a
confined command can ask the distro user's own service manager to start a unit,
and that unit runs outside the mount profile — a write to the distro user's home
succeeds where the same write from inside the fence is refused. Masking `/mnt`
does not narrow this path because it never involves interop. The confined rows'
(`wsl-shell`, `wsl-fs`, `fs-routing`) `socketIsolation` key masks the path when
enabled: `session-bus` binds `/dev/null` over `$XDG_RUNTIME_DIR/bus` and
`$XDG_RUNTIME_DIR/systemd/private` (so `systemd-run --user` fails inside the
profile), and `strict` also masks `/run/dbus/system_bus_socket`, the container
sockets the distro user can reach, and `/run/WSL` (the WSL interop transport);
in strict, an executable copied into the workspace still fails because `/init`
cannot reach the host bridge. The doctor's `sandbox.isolation` row reports the
effective stance and the detected surfaces. The default is `off`: the escape
remains reachable unless an operator chooses a stance, and the masks are a
user-level narrowing, not a closure — same-user `/proc` and other IPC remain,
and `enforcement` stays `partial`. The distro-wide switch is still `[interop]
enabled=false` plus `wsl.exe --shutdown`. The reproduction steps stay private; the exact
paths are listed in
[docs/CONFIGURATION.md](docs/CONFIGURATION.md#socket-isolation) because an
operator must know what the key covers. The finding, its verification and the
remaining decision are recorded in
[docs/superpowers/value-discovery-2026-11-10.md](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/docs/superpowers/value-discovery-2026-11-10.md)
(E4). Report new instances through the private channel above, as with any escape.

## Credentials

No credential, token, or private key belongs in this repository. That includes npm
tokens, GitHub tokens, and distro passwords. If you find one committed here, report
it through the private channel above. Do not open a public issue for it.
