Skip to content

Clarify security model for fetching remote content with HTTP module imports #2194

Description

@til2000

Description

Clarify security model for HTTP module imports

I was reviewing the security model around network access and found an ambiguity worth clarifying.

Issue #1147 established network access as a permission-controlled capability. However, I could not find documentation or an issue explaining whether HTTP module imports are covered by the same permission boundary.

The relevant code is:

crates/mq-run/Cargo.toml
    default = ["std", "use_mimalloc", "http-import", "css-selector", "watch"]

crates/mq-lang/Cargo.toml
    http-import-ureq = ["http-import", "http"]

crates/mq-lang/src/module/resolver.rs
    HTTP module resolver setup

crates/mq-lang/src/module/resolver/http_import.rs
    HTTP/GitHub import handling

crates/mq-lang/src/module/resolver/http_resolver.rs
    Fetching remote modules

The important point is that an HTTP module is not just data. The fetched .mq file becomes source code and is evaluated by mq.

That raises a few questions:

  1. Why is http-import enabled in the default CLI feature set?
  2. Is remote module loading intentionally part of the default security model?
  3. When network access is denied through the permission/sandbox system, is an HTTP module import guaranteed to fail without making an outbound request?
  4. If not, is the HTTP module resolver intentionally outside the Io/SandboxedIo permission boundary?
  5. Would it be safer to make remote module imports explicit opt-in, for example with --allow-http-import and --allowed-domain?
  6. Is the first download of a remote module intentionally trust-on-first-use, or is the lockfile expected to be present first for reproducible/CI use?

I am not reporting this as a vulnerability at this point. I am looking for clarification of the intended security model, particularly whether SandboxedIo is supposed to mean that evaluated mq code has no network access.

This matters because mq is commonly used as a local data-processing tool, while the default build also enables retrieval and execution of remote mq source.

Steps to Reproduce

.

Environment

.

Additional Context

No response

Checklist

  • I searched existing issues to make sure this bug hasn't already been reported.
  • I am using the latest version of mq.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    Status
    In review

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions