Skip to content

Policies with any network rule silently gain read access to system paths not in the written policy #6189

Backlog

Description

@bayesianHimanshu

User Story

I use OpenShell to contain AI agents in a prototype for clinical-development oversight, with one policy per zone and per-zone read allow-lists so each agent can read only its own staged inputs.
I directly encountered extra readable system paths in sandboxes whose policy has any network_policies entry, paths that do not appear in the policy I wrote.
This affects my ability to state and evidence least privilege for each zone from its policy file.

Problem Statement

When a policy contains any network_policies entry, the sandbox can also read system paths that the policy's filesystem section does not list. Nothing in the written policy indicates this; I found it only by comparing the applied policy with the policy file.

On 0.1.7 the applied policy gains read-only /usr, /lib, /etc, /var/log, /proc and /dev/urandom, and read-write /dev/null (reproduction below). An OpenShell contributor reviewing main at 438e07b reports /app is added too (crates/openshell-supervisor/src/lib.rs:2227-2325); I did not see /app on 0.1.7.

Impact / Why This Matters

When this happens, users must compare the applied policy with the policy they wrote to learn what their agents can actually read, and most users will not know to do that.
This results in policies that look least-privilege on paper but are broader in effect. In my project, zones I believed were separated by their policies were, in effect, much closer than their files suggested.
This matters because in regulated settings (GxP-style audit expectations) the policy file is the artefact reviewers inspect. A reviewer reading the file would reach the wrong conclusion about what an agent could read, including /var/log and /proc.

Acceptance Criteria

  • Every path OpenShell adds implicitly is visible in the policy the runtime reports for a sandbox.
  • The documentation lists the paths added when a policy has network rules, with their access mode.
  • A policy author can tell from the docs or the reported policy whether a given system path is readable, without testing from inside the sandbox.

Reproduction Steps

  1. Write two policies that differ only in network_policies.

    policy-a.yaml:

    version: 1
    filesystem_policy:
      include_workdir: false
      read_only:
        - /usr/bin/bash
        - /usr/lib/x86_64-linux-gnu
        - /tmp
      read_write: []
    landlock:
      compatibility: hard_requirement
    process:
      run_as_user: sandbox
      run_as_group: sandbox
    network_policies: {}

    policy-b.yaml: identical, except:

    network_policies:
      example:
        name: example
        endpoints:
          - host: api.example.com
            port: 443
            protocol: rest
            enforcement: enforce
            rules:
              - allow:
                  method: GET
                  path: /
        binaries:
          - path: /usr/bin/curl
  2. Create both sandboxes (both start) and save the applied policies:

    openshell sandbox create --name repro-a --from <IMAGE> --policy policy-a.yaml --detach --no-auto-providers --no-tty
    openshell sandbox create --name repro-b --from <IMAGE> --policy policy-b.yaml --detach --no-auto-providers --no-tty
    openshell sandbox get repro-a --policy-only > applied-a.yaml
    openshell sandbox get repro-b --policy-only > applied-b.yaml
    
  3. In each sandbox, try to read /etc and /var/log using only bash (so no other binary needs to be readable):

    openshell sandbox exec --name repro-a --no-tty --no-login-shell --timeout 60 -- /usr/bin/bash -c 'exec 3< /etc/os-release && echo readable'
    openshell sandbox exec --name repro-a --no-tty --no-login-shell --timeout 60 -- /usr/bin/bash -c 'exec 3< /var/log && echo readable'
    

    Repeat with --name repro-b.

    sandbox read exit output
    repro-a /etc/os-release 1 /etc/os-release: Permission denied
    repro-a /var/log 1 /var/log: Permission denied
    repro-b /etc/os-release 0 readable
    repro-b /var/log 0 readable

    (With cat and ls instead, B also succeeds: cat /etc/os-release prints PRETTY_NAME="Debian GNU/Linux 13 (trixie)".)

  4. diff applied-a.yaml applied-b.yaml: apart from network_policies, B's applied policy contains paths that are in neither input file:

    • read_only: /usr, /lib, /etc, /var/log, /proc, /dev/urandom
    • read_write: /dev/null
  5. Clean up: openshell sandbox delete repro-a and openshell sandbox delete repro-b.

Expected: adding a network rule leaves the filesystem section unchanged, and B refuses the same reads A refuses.
Actual: B silently gains read access to six system paths and read-write /dev/null. Reads that Landlock refuses in A succeed in B, and the policy file gives no sign of it. I found no policy field that turns this off.

Suggested UX (if applicable)

Notional only:

filesystem_policy:
implicit_system_paths: false # opt out entirely or narrow it: implicit_system_paths: [/usr, /lib]

At minimum, openshell sandbox get --policy-only would list the implicit paths, marked as added by the runtime.

Environment

  • OpenShell: 0.1.7 (not retested on main)
  • OS: Ubuntu 26.04.1 LTS, sandbox image based on Debian 13 (trixie)
  • Deployment: Docker driver, gateway as a systemd user unit, Landlock compatibility hard_requirement

Logs

Activity

  1. added
    state:triage-needed
    on Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:triage-needed

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions