From 1dfb9246a58cde4f3d87311bc619bc978d689d9f Mon Sep 17 00:00:00 2001 From: M3gA-Mind Date: Wed, 11 Nov 2026 15:16:06 +0530 Subject: [PATCH] fix(policy): protect the OCI CLI directory in the credential floor ~/.oci holds the Oracle Cloud CLI config and its API signing key (oci_api_key.pem), but was missing from CREDENTIAL_COMPONENTS, so an agent with file access could read it. Add it beside .aws and .azure. Found by fede-kamel in openhuman#8182. --- crates/tinysecurity-policy/src/floor_tests.rs | 10 +++++++++- crates/tinysecurity-policy/src/path.rs | 1 + .../src/path_scope_host_port_tests.rs | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/crates/tinysecurity-policy/src/floor_tests.rs b/crates/tinysecurity-policy/src/floor_tests.rs index 6ed04c47..91735855 100644 --- a/crates/tinysecurity-policy/src/floor_tests.rs +++ b/crates/tinysecurity-policy/src/floor_tests.rs @@ -164,7 +164,15 @@ fn every_vocabulary_entry_is_recognised_by_the_floor() { #[test] fn vocabulary_splits_directories_from_files_and_keeps_every_constant() { let vocabulary = floor_vocabulary(); - for name in [".ssh", ".gnupg", ".aws", ".azure", ".kube", "keychains"] { + for name in [ + ".ssh", + ".gnupg", + ".aws", + ".azure", + ".oci", + ".kube", + "keychains", + ] { assert!(vocabulary.components.iter().any(|c| c == name), "{name}"); } for name in [".netrc", ".git-credentials", ".pgpass", ".npmrc"] { diff --git a/crates/tinysecurity-policy/src/path.rs b/crates/tinysecurity-policy/src/path.rs index 729beb07..c6d1d1b0 100644 --- a/crates/tinysecurity-policy/src/path.rs +++ b/crates/tinysecurity-policy/src/path.rs @@ -19,6 +19,7 @@ pub(super) const CREDENTIAL_COMPONENTS: &[&str] = &[ ".gnupg", ".aws", ".azure", + ".oci", ".kube", "keychains", ".netrc", diff --git a/crates/tinysecurity-policy/src/path_scope_host_port_tests.rs b/crates/tinysecurity-policy/src/path_scope_host_port_tests.rs index 5d60badc..a9574a55 100644 --- a/crates/tinysecurity-policy/src/path_scope_host_port_tests.rs +++ b/crates/tinysecurity-policy/src/path_scope_host_port_tests.rs @@ -119,6 +119,9 @@ fn sensitive_files_and_directories_are_refused_case_insensitively() { "/home/u/.AWS/credentials", "/home/u/.kube/config", "/home/u/.azure/x", + "/home/u/.oci/config", + "/home/u/.OCI/oci_api_key.pem", + "C:\\Users\\u\\.oci\\oci_api_key.pem", "/home/u/.docker/config.json", "/home/u/.cargo/credentials.toml", "/Users/u/Library/Keychains/login.keychain-db",