GHSA-WJ7F-468M-6MV8
Vulnerability from github – Published: 2023-12-01 22:46 – Updated: 2023-12-01 22:46
VLAI
Summary
Environment variables still accessible through /proc
Details
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.
Severity
4.0 (Medium)
{
"affected": [
{
"package": {
"ecosystem": "crates.io",
"name": "birdcage"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.7.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-200"
],
"github_reviewed": true,
"github_reviewed_at": "2023-12-01T22:46:37Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "### Impact\n\nEnvironment variables can be read from procfs unless a new process is started.\n\n### PoC\n\n```\nuse birdcage::{Birdcage, Sandbox};\nuse std::{env, fs};\n\nfn main() {\n Birdcage::new().lock().unwrap();\n\n assert_eq!(env::var_os(\"SECRET\"), None);\n\n let environ = fs::read_to_string(\"/proc/self/environ\").unwrap();\n assert!(!environ.contains(\"SECRET\"), \"ENVIRON CONTAINS SECRET:\\n{environ}\");\n}\n```\n\n```\n$ SECRET=test cargo run\nthread \u0027main\u0027 panicked at src/main.rs:10:5:\nENVIRON CONTAINS SECRET:\n [truncated]\n ```\n\n### Possible Solutions\n\nThe simplest solution would be relying on the ptrace isolation and **always** spawning a new process by changing birdcage\u0027s API to create a new command. With an additional PID namespace the guarantees could be even further reinforced.\n",
"id": "GHSA-wj7f-468m-6mv8",
"modified": "2023-12-01T22:46:37Z",
"published": "2023-12-01T22:46:37Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/phylum-dev/birdcage/security/advisories/GHSA-wj7f-468m-6mv8"
},
{
"type": "PACKAGE",
"url": "https://github.com/phylum-dev/birdcage"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "Environment variables still accessible through /proc"
}
Loading…
Loading…
Experimental. This forecast is provided for visualization only and may change without notice. Do not use it for operational decisions.
Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Loading…
Loading…