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:
- Why is
http-import enabled in the default CLI feature set?
- Is remote module loading intentionally part of the default security model?
- When network access is denied through the permission/sandbox system, is an HTTP module import guaranteed to fail without making an outbound request?
- If not, is the HTTP module resolver intentionally outside the
Io/SandboxedIo permission boundary?
- Would it be safer to make remote module imports explicit opt-in, for example with
--allow-http-import and --allowed-domain?
- 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
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:
The important point is that an HTTP module is not just data. The fetched
.mqfile becomes source code and is evaluated bymq.That raises a few questions:
http-importenabled in the default CLI feature set?Io/SandboxedIopermission boundary?--allow-http-importand--allowed-domain?I am not reporting this as a vulnerability at this point. I am looking for clarification of the intended security model, particularly whether
SandboxedIois supposed to mean that evaluated mq code has no network access.This matters because
mqis 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