Skip to content

Commit 7b2ed72

Browse files
authored
Release v0.5.1 (#48)
* test: add regression tests for indirect symlink to /proc/PID/root bypass These tests validate the security bug where symlinks pointing to /proc/PID/root bypass protection because the input path doesn't lexically start with /proc/. Tests are expected to FAIL until proc-canonicalize is upgraded to v0.0.3+ Related: proc-canonicalize indirect symlink bypass issue * docs: update CHANGELOG for indirect symlink bypass fix * chore: bump version to v0.5.1
1 parent 6d74479 commit 7b2ed72

4 files changed

Lines changed: 402 additions & 108 deletions

File tree

CHANGELOG.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,26 @@ 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.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased]
8+
## [0.5.1] - 2025-12-11
9+
10+
### Fixed
11+
12+
- **Indirect symlinks to `/proc/PID/root` now correctly preserve namespace boundaries**
13+
- Previously, symlinks pointing to `/proc/PID/root` (e.g., `/tmp/container -> /proc/self/root`) would resolve to `/`, bypassing namespace protection
14+
- This was because the input path didn't lexically start with `/proc/`, so `proc-canonicalize` delegated to `std::fs::canonicalize`
15+
- Upgraded `proc-canonicalize` dependency from 0.0.2 to 0.0.3 which fixes this security bypass
16+
- **Security**: Critical fix for container boundary enforcement - prevents attackers from escaping container isolation via indirect symlinks
17+
18+
### Added
19+
20+
- **Regression test suite for indirect `/proc/PID/root` symlink bypass** (`tests/linux_proc_indirect_symlink.rs`)
21+
- 10 tests covering: direct symlinks, chained symlinks, suffix paths, attack scenarios, anchored API
22+
- Tests validate that namespace boundaries are preserved for indirect symlinks
23+
- Covers `/proc/self/root`, `/proc/PID/root`, and `/proc/thread-self/root` variants
24+
25+
### Changed
26+
27+
- **Dependency**: Upgraded `proc-canonicalize` from 0.0.2 to 0.0.3
928

1029
## [0.5.0] - 2025-12-10
1130

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "soft-canonicalize"
3-
version = "0.5.0"
3+
version = "0.5.1"
44
edition = "2021"
55
authors = ["David Krasnitsky <dikaveman@gmail.com>"]
66
description = "Path canonicalization that works with non-existing paths."
@@ -19,7 +19,7 @@ rust-version = "1.70.0"
1919
[dependencies]
2020
# Optional: fixes std::fs::canonicalize for Linux /proc/PID/root magic symlinks.
2121
# Enabled by default. Disable with `default-features = false` if you need std behavior.
22-
proc-canonicalize = { version = "0.0.2", optional = true }
22+
proc-canonicalize = { version = "0.0.3", optional = true }
2323

2424
# Optional dunce dependency for path simplification (Windows-only)
2525
[target.'cfg(windows)'.dependencies]

SOFT_CANONICALIZE_BUG_REPORT.md

Lines changed: 0 additions & 105 deletions
This file was deleted.

0 commit comments

Comments
 (0)