birdcage
Affected
- introduced
0, fixed0.7.0(semver)
Fixed versions
0.7.0
Fix
- Fixed version
0.7.0cargo update -p birdcage --precise 0.7.0
Advisory
Also known as: None
Environment variables still accessible through /proc
Impact
Environment variables can be read from procfs unless a new process is started.
PoC
use birdcage::{Birdcage, Sandbox};
use std::{env, fs};
fn main() {
Birdcage::new().lock().unwrap();
assert_eq!(env::var_os("SECRET"), None);
let environ = fs::read_to_string("/proc/self/environ").unwrap();
assert!(!environ.contains("SECRET"), "ENVIRON CONTAINS SECRET:\n{environ}");
}
$ SECRET=test cargo run
thread 'main' panicked at src/main.rs:10:5:
ENVIRON CONTAINS SECRET:
[truncated]
Possible Solutions
The simplest solution would be relying on the ptrace isolation and always spawning a new process by changing birdcage's API to create a new command. With an additional PID namespace the guarantees could be even further reinforced.
Medium Basis: The source's own band: MODERATE
0, fixed 0.7.0 (semver)0.7.0
0.7.0cargo update -p birdcage --precise 0.7.0Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0