Skip to content

Security: fail-closed shell classifier hardening (waves H-L of PR #48638 series) #49975

Closed as not planned

Description

@AceRothstein71

Context

Part of the fork hardening series proposed in #48638 (branch session-diff-events). Tracker: #49565.

Problem

The shell/command classifier could be steered past the external_directory gate and absorb its own offered grants (fail-open classifications) across many shapes: brace lists, wrappers, absolute paths, redirects, dynamic names, env/eval, ANSI-C escapes, attached options, remote operands, substitutions, variable redirects, and more.

Change set (commit list)

Validation

Linked: PR #48638 · tracker #49565 · sibling tracking issues listed in a follow-up comment.

Activity

  1. AceRothstein71 commented on Sep 19, 2026

    @AceRothstein71
    Author

    Cross-links: sibling tracking issues #49974 (perf/runtime), #49975 (shell classifier H-L), #49976 (shell classifier M-P), #49977 (instance lifecycle), #49978 (MCP/schema), #49979 (server/SSE + event/db), #49980 (updater tooling). Integration PR: #48638. Original tracker: #49565.

  2. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    Thanks for putting this together. As written, this is a list of fork commits rather than a report we can check, so we can't act on it yet.

    If you've seen OpenCode run a command without the external_directory permission prompt you expected, please describe it briefly in your own words:

    • Your OpenCode version (opencode --version)
    • Your relevant permission config, if you changed the defaults
    • One or two exact shell commands the agent ran that reached a path outside the project without asking
    • What you expected (a prompt or a denial) and what happened instead

    Please note that, as SECURITY.md explains, the permission system is a UX feature, not a sandbox, and AI-generated security reports are not accepted. A concrete misclassification is still useful as a normal bug report.

    You can reply here with the details or edit the issue. If you edit it, please also leave a comment saying you've updated it so we know you're done.

    Related items, ordered by likelihood:

  3. opencodejr commented on Oct 31, 2026

    @opencodejr
    Contributor

    Closing this as not planned: we asked for a concrete example and haven't heard back. Without one, we can't confirm that any of the listed command shapes actually get past the external_directory prompt in OpenCode.

    If you do see a specific case, please open a new issue using the Bug Report template. Include your opencode --version, any changes to your permission config, the exact command the agent ran, and what you expected compared with what happened. Please write it in your own words, and note the threat model in SECURITY.md: the permission system is a UX feature, not a sandbox. Thanks!

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions