Skip to content

File browser API can access files outside the Minions workspace #30

Description

@ujjwalredd

Summary

The file browser routes resolve user-provided paths directly. Absolute paths and expanded home paths can escape MINIONS_HOME/workspace, even though the project documentation describes the file browser as operating on the workspace directory.

The server also listens on all interfaces by default and allows wildcard CORS, which makes the local API reachable from arbitrary browser origins while Minions is running.

Impact

A request to the file API can read, download, write, rename, or delete paths outside the workspace. Symlinks inside the workspace can also point to files outside the workspace unless real paths are checked.

Example affected surface:

  • GET /api/files/read?path=/absolute/path
  • GET /api/files/download?path=/absolute/path
  • PUT /api/files/write
  • PATCH /api/files/rename
  • DELETE /api/files

Suggested fix

Bind to loopback by default, reject browser requests whose Origin does not match the app host, and require every file API path to stay inside the Minions workspace. Existing paths should be checked with realpath so symlink escapes are blocked.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions