Repository navigation
Conversation
… 1.20) A Seatbelt jail is allow-default for reads, so a folder-confined command could read the user's credential stores and, with network on, send them out. The jail request had no way to say otherwise. Add NativeJailConfig::deny_read (serde default, omitted when empty) and bump the contract to 1.20. The module validates denials like grants, drops paths that do not exist, canonicalizes the rest, and refuses a denial that covers the root or a writable grant, or that lies inside the root or a grant on a backend that cannot subtract from grants (JailBackend::carves_denials, false by default). Seatbelt ends its profile with a file-read*/file-write* deny over the paths. Part of tinyhumansai/openhuman#7819
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Comment |
M3gA-Mind
added a commit
to M3gA-Mind/openhuman
that referenced
this pull request
Oct 15, 2026
Document the two postures jail_isolation picks, who each is accepted for, and the known limitation of folder confinement: Seatbelt reads are allow-default, so credential stores stay readable until TinyBox's deny_read (tinyhumansai/tinybox#87) is released and pinned.
12 tasks done
clippy::assert-is-empty rejects assert!(vec.is_empty()) in the bus test; compare against an empty Vec instead. The module's denial test called prepare(), which refuses every native jail off Unix, so it failed on Windows; gate it on cfg(unix) like the other prepare tests.
Tiny Sweeper review
|
M3gA-Mind
added a commit
to M3gA-Mind/openhuman
that referenced
this pull request
Oct 15, 2026
Document the two postures jail_isolation picks, who each is accepted for, and the known limitation of folder confinement: Seatbelt reads are allow-default, so credential stores stay readable until TinyBox's deny_read (tinyhumansai/tinybox#87) is released and pinned.
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
This adds
NativeJailConfig::deny_read(contract 1.20): absolute paths a jailed child may neither read nor write, even inside the root or a grant.Why it's needed: tinyhumansai/openhuman#7824 accepts Seatbelt as folder confinement for the macOS desktop sandbox, where writes are allowed only in the selected folder. Review flagged a P1 there. Seatbelt reads are allow-default, so with network on a command can read
~/.ssh,~/.gnupg,~/.awsor Keychains and exfiltrate them. The jail request had no way to deny reads, so per openhuman's submodule-ownership rule the capability lands here first.What changes:
(deny file-read* file-write* (subpath …))over the denied paths. It comes after the write allows, which it overrides, andsubpathmatches a single file as well as a tree.tinybus_module/native_jail.rs):MAX_NATIVE_JAIL_GRANTS.INVALID_FILE_PATH.JailBackend::carves_denials(): new method, defaultfalse, and only Seatbelt returnstrue. Landlock and AppContainer are allow-list backends, so a path outside every grant is already unreachable there.Related issue
Part of tinyhumansai/openhuman#7819 (host PR: tinyhumansai/openhuman#7824).
API or behavior changes
These changes are additive and not breaking:
NativeJailConfiggainsdeny_read: Vec<String>. It is serde-default and omitted when empty, so 1.19 requests decode and re-encode unchanged. Rust struct literals need the new field.Jailgainspub deny_read: Vec<PathBuf>, whichJail::newinitialises andJail::canonicalizecovers.JailBackendgainscarves_denials(), which has a default implementation.CONTRACT_VERSIONis now (1, 20). The new spec isdocs/specs/contract-1-20.md.Validation
Commands actually run, with their outcome:
cargo fmt --all -- --check: cleancargo clippy --all-targets --all-features -- -D warnings: not run locally (fleet rule: no local lint/test). I rancargo check -p tinybox-module -p tinybox-jail -p tinybox-bus --testson macOS instead, and it finished clean.cargo build --all-targets --all-features: not run (see above)cargo test --all-features: not run locallymodule-ciruns on this PR. Run 38693710696 at a8f8ccf caught a clippy lint and a Windows-only test gate, both fixed in a66ff39.Tests
tinybox-bus/src/jail_tests.rs:deny_readdefaults empty, a 1.19 request round-trips byte-for-byte, and a non-empty list round-trips.tinybox-bus/src/lib_tests.rs: the contract version snapshot is 1.20.tinybox-jail/src/macos_tests.rs: with no denials the profile has nofile-read*rule. With denials there is onedeny file-read* file-write*block after the write allows, listing every path. Seatbelt carves denials.tinybox-module/src/tinybus_module/native_jail_tests.rs:NativeJailConfigliterals in tests gotdeny_read: Vec::new().Deliberately not tested: Landlock and AppContainer spawning with denials. They are unchanged and never grant a denied path.
Documentation
docs/specs/contract-1-20.md.tinybus_module/README.mdgets the version line and theStartJailedExecadmission paragraph.After merge, in openhuman (not in this PR):
jail_requestfillsdeny_readforfolder_confinedfrom the same credential flooris_always_forbiddenuses (SENSITIVE_COMPONENTS, expanded against$HOME), plus Keychains and the single-file stores.Checklist
#[allow(...)],#[ignore], or relaxed lints.envcontents in the diff or the description