fix(security): harden runtime against critical/high vulnerabilities#25
Merged
miguelgila merged 2 commits intomainfrom Mar 1, 2026
Merged
fix(security): harden runtime against critical/high vulnerabilities#25miguelgila merged 2 commits intomainfrom
miguelgila merged 2 commits intomainfrom
Conversation
- Gate REAPER_NO_OVERLAY behind #[cfg(test)] so overlay bypass is impossible in release builds (Critical) - Validate container/exec IDs against path traversal: reject empty, '..', slashes, and non-alphanumeric chars (Critical) - Restrict config file to REAPER_ prefixed keys only, preventing injection of LD_PRELOAD, PATH, etc. (High) - Set restrictive permissions (0700 dirs, 0600 files) on state files and directories (High) - Validate PID > 1 before sending kill signals to prevent signalling init or the caller's process group (High) - Always clear supplementary groups during privilege drop, even when additional_gids is empty, to prevent inheriting root's groups (High) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
#[cfg(test)] only applies to the test harness, not binary targets built alongside it. Integration tests spawn reaper-runtime as a subprocess, so the overlay bypass was inactive in CI. Switch to #[cfg(debug_assertions)] which is active in debug builds (cargo test) but not in release builds (production). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #25 +/- ##
==========================================
+ Coverage 85.94% 88.09% +2.14%
==========================================
Files 5 5
Lines 185 252 +67
==========================================
+ Hits 159 222 +63
- Misses 26 30 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
REAPER_NO_OVERLAYbehind#[cfg(test)]— overlay bypass impossible in release builds../, empty, special chars)REAPER_prefixed keys only (preventsLD_PRELOAD/PATHinjection)additional_gidsis emptyTest plan
cargo test --bin reaper-runtime)cargo clippy --all-targets)validate_id()(path traversal, empty, special chars, length)REAPER_keys)🤖 Generated with Claude Code