Skip to content

Commit 9f7b5fc

Browse files
committed
docs: update security documentation and installation instructions to address CVE-2025-69872 and clarify usage of optional disk backend
1 parent e6d0da4 commit 9f7b5fc

File tree

16 files changed

+63
-22
lines changed

16 files changed

+63
-22
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ assignees: ''
77

88
---
99

10+
Do **not** use this template for undisclosed security issues—use **[Security advisories](https://github.com/sirstig/yokedcache/security/advisories/new)** instead. Known third-party notes (e.g. optional **diskcache** / **CVE-2025-69872**) are summarized in [`SECURITY.md`](https://github.com/sirstig/yokedcache/blob/main/SECURITY.md).
11+
1012
**Describe the bug**
1113
A clear and concise description of what the bug is.
1214

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
10+
### Documentation
11+
12+
- Documented the optional **diskcache** advisory (**CVE-2025-69872** / [GHSA-w8v5-vhqr-4h9v](https://github.com/advisories/GHSA-w8v5-vhqr-4h9v)) in `SECURITY.md`, the README Security section, the docs site *Security* page, `CONTRIBUTING.md`, and the GitHub bug report template (no patched upstream wheel at the time of writing; trust boundaries and mitigations).
13+
814
## [1.0.0] - 2026-03-23
915

1016
First stable 1.x release. Published as **1.0.0** (not a PEP 440 pre-release) so a plain `pip install yokedcache` resolves to this line ahead of 0.x. Focus: security hardening, safer Redis usage, and clearer HTTP cache semantics.

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ yokedcache/
219219
- **Discussions:** Use GitHub Discussions for questions
220220
- **Chat:** Join our community chat (link TBD)
221221

222+
## Security
223+
224+
Report vulnerabilities through [GitHub Security Advisories](https://github.com/sirstig/yokedcache/security/advisories/new). Maintainer-facing notes on trust boundaries, optional backends, and known third-party advisories (including **diskcache** / **CVE-2025-69872** for the optional `disk` extra) live in **[SECURITY.md](SECURITY.md)** in the repository root.
225+
222226
## Code of Conduct
223227

224228
By participating in this project, you agree to abide by our Code of Conduct:

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ Async-first Python caching for FastAPI and other asyncio services: Redis-oriente
2424

2525
## Installation
2626

27-
Current stable line: **1.0.0** (default on PyPI).
27+
Install the latest **1.x** from PyPI; you do not need to pin an exact version unless your policy requires it.
2828

2929
```bash
3030
pip install yokedcache
3131
```
3232

33-
To require 1.x or newer:
33+
To require 1.x or newer explicitly:
3434

3535
```bash
3636
pip install "yokedcache>=1.0.0"
@@ -86,7 +86,9 @@ Other backends impose their own dependencies when you install the matching extra
8686

8787
## Security
8888

89-
Treat Redis and Memcached as **trusted** stores: anyone who can write arbitrary keys can affect deserialization. From **1.0.0**, new values are written with a typed envelope; set `allow_legacy_insecure_deserialization=False` on `CacheConfig` once legacy entries are migrated. Do not use `HTTPCacheMiddleware` on authenticated routes without a `key_builder` that varies the key per user or session. See the changelog for details. The **[SECURITY.md](SECURITY.md)** file covers the optional disk backend (pickle / `diskcache`) and how we pin vulnerable transitive deps in `uv.lock`.
89+
Treat Redis and Memcached as **trusted** stores: anyone who can write arbitrary keys can affect deserialization. From **1.0.0**, new values are written with a typed envelope; set `allow_legacy_insecure_deserialization=False` on `CacheConfig` once legacy entries are migrated. Do not use `HTTPCacheMiddleware` on authenticated routes without a `key_builder` that varies the key per user or session. See the changelog for details.
90+
91+
**Optional `disk` extra:** installs **diskcache**, which uses **pickle** by default. **[CVE-2025-69872](https://github.com/advisories/GHSA-w8v5-vhqr-4h9v)** (GHSA-w8v5-vhqr-4h9v) documents unsafe pickle deserialization when an attacker can write the cache directory; **there is no patched diskcache release on PyPI yet**, so dependency scanners may still alert. Use a non-world-writable cache path and skip `yokedcache[disk]` if you do not need disk persistence. Full write-up: **[SECURITY.md](SECURITY.md)** (also covers how we pin transitive deps in `uv.lock`).
9092

9193
## Development
9294

SECURITY.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,27 @@ Report vulnerabilities via [GitHub Security Advisories](https://github.com/sirst
55
## Trust boundaries
66

77
- **Redis / Memcached**: Treat as trusted stores. Anyone who can write arbitrary keys can influence what your app deserializes. Use `CacheConfig.allow_legacy_insecure_deserialization=False` once legacy blobs are gone (see changelog).
8-
- **Disk backend (`yokedcache[disk]`)**: The optional `diskcache` library persists values with **pickle** by default. There is **no patched diskcache release** yet for [CVE-2025-69872](https://github.com/advisories/GHSA-w8v5-vhqr-4h9v) (unsafe pickle deserialization if an attacker can write the cache directory). Only use the disk extra when the cache directory is **not writable by untrusted users**; prefer JSON/msgpack serialization at the application layer where feasible.
8+
9+
## Optional disk backend (`diskcache`)
10+
11+
The **`yokedcache[disk]`** extra pulls in **[diskcache](https://pypi.org/project/diskcache/)** (python-diskcache). That library persists values with **pickle** by default.
12+
13+
| | |
14+
| --- | --- |
15+
| **Advisory** | [GHSA-w8v5-vhqr-4h9v](https://github.com/advisories/GHSA-w8v5-vhqr-4h9v) (**CVE-2025-69872**) |
16+
| **Affected** | diskcache **through 5.6.3** (current PyPI line as of this writing) |
17+
| **Patched PyPI version** | **None** yet; automated scanners may flag the dependency until upstream ships a release |
18+
19+
**Threat model:** someone who can **write or replace files under the cache directory** can supply a malicious pickle payload; when your process reads that entry, that can lead to **arbitrary code execution**.
20+
21+
**What we recommend**
22+
23+
- Do **not** install the disk extra unless you need a filesystem-backed cache.
24+
- Keep the cache directory **writable only by the application user** (no shared multi-tenant paths, no world-writable directories, careful with network mounts).
25+
- Prefer **Redis, SQLite, or memory** backends when untrusted parties could influence the filesystem.
26+
- At the application layer, only cache payloads you could treat as **trusted after deserialization**; JSON or msgpack at the boundary does not remove the pickle risk inside diskcache until you stop using pickle-backed storage for those keys.
27+
28+
**Upstream note:** diskcache also provides **`JSONDisk`** (JSON + zlib instead of pickle). **YokedCache’s `DiskCacheBackend`** currently constructs `diskcache.Cache` with the default disk (pickle). Callers who require disk without pickle need a custom integration or another backend until this project exposes a supported switch.
929

1030
## Dependency scanning
1131

site-src/pages/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The CLI is automatically available after installing YokedCache:
88

99
```bash
1010
# Install YokedCache
11-
pip install "yokedcache==1.0.0"
11+
pip install yokedcache
1212

1313
# Verify CLI installation
1414
yokedcache --version

site-src/pages/getting-started.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ This guide will walk you through installing YokedCache and setting up your first
1414

1515
```bash
1616
# Install the core YokedCache package for Python FastAPI Redis caching
17-
pip install "yokedcache==1.0.0"
17+
pip install yokedcache
18+
```
19+
20+
If you want an explicit 1.x floor (optional):
21+
22+
```bash
23+
pip install "yokedcache>=1.0.0"
1824
```
1925

2026
### Recommended Installation for Production FastAPI Applications
@@ -23,7 +29,7 @@ For production FastAPI applications, install YokedCache with all Redis caching f
2329

2430
```bash
2531
# Install with all Redis caching features (recommended for FastAPI)
26-
pip install "yokedcache[full]==1.0.0"
32+
pip install "yokedcache[full]"
2733
```
2834

2935
### Feature-Specific Installation for Custom Python Setups
@@ -32,19 +38,19 @@ Install only the Redis caching features you need for your Python application:
3238

3339
```bash
3440
# Vector similarity search caching
35-
pip install "yokedcache[vector]==1.0.0"
41+
pip install "yokedcache[vector]"
3642

3743
# Production monitoring for Redis cache (Prometheus, StatsD)
38-
pip install "yokedcache[monitoring]==1.0.0"
44+
pip install "yokedcache[monitoring]"
3945

4046
# Memcached backend support
41-
pip install "yokedcache[memcached]==1.0.0"
47+
pip install "yokedcache[memcached]"
4248

4349
# Fuzzy search capabilities for cached data
44-
pip install "yokedcache[fuzzy]==1.0.0"
50+
pip install "yokedcache[fuzzy]"
4551

4652
# Combine multiple caching features
47-
pip install "yokedcache[vector,monitoring,fuzzy]==1.0.0"
53+
pip install "yokedcache[vector,monitoring,fuzzy]"
4854
```
4955

5056
## Python versions
@@ -510,7 +516,7 @@ pip list | grep yokedcache
510516

511517
# Reinstall if needed
512518
pip uninstall yokedcache
513-
pip install "yokedcache[full]==1.0.0"
519+
pip install "yokedcache[full]"
514520
```
515521

516522
### Performance Issues

site-src/pages/monitoring.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ The NoOpCollector allows you to disable metrics collection without changing your
143143

144144
```bash
145145
# Install Prometheus dependencies
146-
pip install "yokedcache[monitoring]==1.0.0"
146+
pip install "yokedcache[monitoring]"
147147

148148
# Or install manually
149149
pip install prometheus_client
@@ -221,7 +221,7 @@ collector = PrometheusCollector(
221221

222222
```bash
223223
# Install StatsD dependencies
224-
pip install "yokedcache[monitoring]==1.0.0"
224+
pip install "yokedcache[monitoring]"
225225

226226
# Or install manually
227227
pip install statsd

site-src/pages/security.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Security
22

33
- **Versions:** 1.x targets **Python 3.10+** (CI covers through **3.14**). On **Python 3.9**, use **`yokedcache==0.3.0`** (or `yokedcache<1`) only as a stopgap—that branch does **not** receive the same security fixes as 1.x; upgrade when you can. Details: [SECURITY.md](https://github.com/sirstig/yokedcache/blob/main/SECURITY.md) in the repo.
4+
- **Optional disk extra (`diskcache`):** the `yokedcache[disk]` extra depends on **diskcache**, which serializes with **pickle** by default. **[CVE-2025-69872](https://github.com/advisories/GHSA-w8v5-vhqr-4h9v)** describes arbitrary code execution if an attacker can write under the cache directory. **No patched PyPI release** is available yet; scanners may flag the package. Prefer strict filesystem permissions, avoid the extra if you do not need disk caching, and read the **Disk / diskcache** section in [SECURITY.md](https://github.com/sirstig/yokedcache/blob/main/SECURITY.md).
45
- Use `rediss://` and TLS-enabled Redis in production.
56
- Limit Redis access to your VPC/private network; avoid public endpoints.
67
- For multi-tenant apps, include tenant namespace in keys and enforce isolation.

site-src/pages/tutorials/fastapi-redis-caching.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ This comprehensive tutorial shows you how to implement high-performance caching
2828
Install YokedCache with full features for your FastAPI application:
2929

3030
```bash
31-
pip install "yokedcache[full]==1.0.0"
31+
pip install "yokedcache[full]"
3232
```
3333

3434
This includes:

0 commit comments

Comments
 (0)