# CVE-2023-22466: Tokio's reject_remote_clients configuration may get dropped when creating a Windows named pipe

> Tokio library allows remote access to Windows named pipes by silently disabling the reject_remote_clients security setting when pipe_mode is configured.

- **Severity:** Medium 5.4 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 4 Jan 2023
- **Updated:** 10 Mar 2025
- **Also known as:** DEBIAN-CVE-2023-22466, GHSA-7rrj-xr53-82p7, RUSTSEC-2023-0001, UBUNTU-CVE-2023-22466

## What is CVE-2023-22466?

CVE-2023-22466 is a medium-severity vulnerability in tokio-rs tokio, published on 4 Jan 2023. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Tokio is a runtime for writing applications with Rust. Starting with version 1.7.0 and prior to versions 1.18.4, 1.20.3, and 1.23.1, when configuring a Windows named pipe server, setting `pipe_mode` will reset `reject_remote_clients` to `false`. If the application has previously configured `reject_remote_clients` to `true`, this effectively undoes the configuration. Remote clients may only access the named pipe if the named pipe's associated path is accessible via a publicly shared folder (SMB). Versions 1.23.1, 1.20.3, and 1.18.4 have been patched. The fix will also be present in all releases starting from version 1.24.0. Named pipes were introduced to Tokio in version 1.7.0, so releases older than 1.7.0 are not affected. As a workaround, ensure that `pipe_mode` is set first after initializing a `ServerOptions`.

Weakness: CWE-665 (Improper Initialization)

## Which versions are affected by CVE-2023-22466?

7 open source packages ship an affected version, including tokio. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `tokio` | crates.io | From 1.19.0 | 1.20.3 |
| `tokio` | crates.io | From 1.19.0 | 1.20.3 |
| `tokio` | crates.io | From 1.21.0 | 1.23.1 |
| `tokio` | crates.io | From 1.21.0 | 1.23.1 |
| `tokio` | crates.io | From 1.7.0 | 1.18.4, 1.20.3, 1.23.1 |
| `tokio` | crates.io | From 1.7.0 | 1.18.4 |
| `tokio` | crates.io | From 1.7.0 | 1.18.4 |

Products: Tokio Tokio.

## How do I fix CVE-2023-22466?

Upgrade tokio to a fixed version for your release line: 1.20.3, 1.23.1 or 1.18.4.

## Is CVE-2023-22466 being exploited?

There is no known exploitation of CVE-2023-22466 in the wild and no public exploit code.

## Other vulnerabilities in tokio-rs tokio

- [CVE-2021-45710](https://insights.sbomify.com/CVE-2021-45710/): Race Condition in tokio (high 8.1)
- [CVE-2021-38191](https://insights.sbomify.com/CVE-2021-38191/): Race condition in tokio (medium 5.9)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-22466 and fix it if it is affected.

What it is: CVE-2023-22466 is a medium-severity vulnerability in tokio-rs tokio, published on 4 Jan 2023. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2023-22466 in the wild and no public exploit code.

Affected packages and fixed versions:
- tokio (crates.io): affected from 1.19.0; fixed in 1.20.3
- tokio (crates.io): affected from 1.19.0; fixed in 1.20.3
- tokio (crates.io): affected from 1.21.0; fixed in 1.23.1
- tokio (crates.io): affected from 1.21.0; fixed in 1.23.1
- tokio (crates.io): affected from 1.7.0; fixed in 1.18.4, 1.20.3, 1.23.1
- tokio (crates.io): affected from 1.7.0; fixed in 1.18.4
- tokio (crates.io): affected from 1.7.0; fixed in 1.18.4

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-22466/ (Markdown: https://insights.sbomify.com/CVE-2023-22466/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-22466
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-22466
- OSV: https://osv.dev/vulnerability/CVE-2023-22466

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-22466/
Summaries are generated and may contain mistakes; the official description above is the record.
