This document captures the security posture of the bootstrap and the
contracts the package manager + compiler enforce. The detailed
implementation lives in crates/ori-compiler/src/effect_check.rs,
crates/ori-pkg/src/audit.rs, and the security audit test suite under
crates/{ori-compiler,ori-pkg}/tests/.
The bootstrap defends against the following classes of issue:
- Capability creep. A dependency requires
fs.writebut the root package only declaresfs.read. →auditfindingAUD0001of severityerror;effect_checkraisesE0410. - Effect leak through call graph. A function declares
uses db.readbut transitively calls auses db.writecallee. →effect_propagateraisesE0420with achange_signaturePatch IR fix appending the missing effect. - Stale lockfile checksums. Lockfile entries that don't match the
freshly rebuilt lockfile signal tamper. →
lockfile_tampertest asserts detection. - Provenance spoofing. Provenance JSON with an unrecognised
signature is marked
verified: falsewith notes. →provenance_failuretest corpus. unsafeintroduction. Workspace scan asserts every Rust source undercrates/*/src/is free ofunsafe fn / impl / trait / {. →unsafe_surface_reporttest fails if any unsafe surface appears.- Undeclared ambient I/O. Source code that uses unknown effect
names triggers
W0401; with a non-empty package policy, it escalates toE0410viaeffect_check::effect_diagnostics.
The bootstrap does not defend against the following — they are on
docs/ROADMAP.md:
- Sophisticated supply-chain attacks (the lockfile checksum is FNV-1a, not cryptographic).
- Malicious code in dependencies (no real sandboxing).
- Side-channel attacks (no constant-time guarantees in stdlib).
- Network MITM (no TLS verification — no real network stack at all).
- Privilege escalation at runtime (no capability runtime gating; the bootstrap is static-analysis-only).
- Memory safety bugs in
unsafeRust inside the compiler itself (the workspace forbids unsafe Rust —validate_all.pyenforces).
[ori.toml]
[capabilities]
declared = ["http", "db.read", "db.write"]
│
│ read by ori-pkg/Manifest
│
▼
[ori-pkg/audit::run_audit]
┌── declared - used → AUD0002 info "unused capability"
└── used - declared → AUD0001 error "missing capability"
│
▼
[ori-compiler/effect_check::effect_diagnostics]
┌── undeclared(used) → E0410 error
└── (with body parser)
└── propagated → E0420 error with Patch IR fix
│
▼
[ori capability --json] → ori.capability.v1
[ori audit --json] → ori.audit_report.v1
Use .github/ISSUE_TEMPLATE/bug_report.md for vulnerability reports
until the project has a dedicated security policy at SECURITY.md.
Do not post proof-of-concept exploit code in public issues until the
underlying fix is merged.
Every PR must:
- Re-run the security test suite (
cargo test --workspace). - Verify the
unsafe_surface_reporttest still asserts zero. - Add a new test under
crates/ori-pkg/tests/orcrates/ori-compiler/tests/for any new capability check or effect rule.
CI workflows static.yml, test.yml, sbom.yml enforce the suite on
every push and the SBOM artefact on every release.