Files
marqdo-cli/docs/evidence/2026-11-20-strict-resource-cm-a11.md
T
cflmy 67a6d35daf docs(security): record CM-A11 strict resource verification
- Checked-in raw G-C lane log for 00bdcad: 7/7 adversarial helper matrix,
  positive CLI (Compat-C print via bundled stdlib), strict file-resource
  refusal, external-surface rejection, forged-marker rejection, lane PASS.
- Evidence documents the read-only /run/marqdo-stdlib bind, strict stdio-only
  policy, refused file/TCP/provider resources, and the remaining no-CI-URL /
  Windows/macOS limits.
- STATUS updated to the current 426-test gate and 00bdcad strict result.

Gate: fmt, clippy -D warnings, 426 tests passed; VM lane PASS.
2026-11-20 23:08:23 +08:00

2.9 KiB

RFC-CM CM-A11 evidence: strict resource verification

Date: 2026-11-20 (Asia/Shanghai) Repository: marqdo-cli Source under test: git archive 00bdcad (current HEAD) Related: ADR-0021, ADR-0030, ADR-0034, STATUS §1. Raw lane log: 2026-11-20-strict-resource-cm-a11.log

Environment

Ubuntu 26.04 disposable QEMU/TCG VM, kernel 7.0.0-43-generic, ordinary user dev (uid 1000), systemd-detect-virt --container = none, bubblewrap 0.11.1 with the packaged bwrap-userns-restrict profile. The dev container cannot create namespaces, so this is VM-only evidence.

What was verified

./tests/security/run-lane.sh
  adversarial helper matrix: 7 passed, 0 failed, 0 ignored
  positive CLI contract: PASS
  strict language resources are console-only: PASS
  external-execution surfaces refused: PASS
  forged active marker rejected: PASS
  G-C security lane: PASS

The 7-test helper matrix covers: no host-file reads beyond /project, no writes outside or into the project, no network, unprivileged namespaces, no capability escalation, fd/process limits, and memory/CPU/output limits.

The positive CLI contract runs hello (Compat-C 打印 through the bundled stdlib), factorial --mode strict, multi-module, and --json.

The new strict-resource check runs a .mq.md program that calls resource.open("file", "README.md", ["read"]) under --mode strict; the run must be non-zero and the diagnostic must contain permission.denied. The bundled stdlib is bind-mounted read-only at /run/marqdo-stdlib and its digest is still verified in the child; this grants no new OS capability.

Policy verified in code/tests

  • Strict permits only stdio/stdout with console grant.
  • Strict refuses project-file, TCP and registered-provider resource kinds; pure refuses file/TCP/providers too.
  • --allow-read/--allow-write/--allow-foreign/--allow-plugin/--allow-net/ --trace-file/--kernel/--trust-native-plugin are rejected at the strict L1 flag boundary.
  • Strict permits the read-only bundled stdlib so 打印 works; file/network/ process/device remain refused.
  • TCP is project-only and strict refuses it (host tests), so the new TCP endpoint does not widen strict L1.

Gate

Local container: fmt/clippy/426 tests PASS. VM: 7/7 adversarial + full lane PASS. Log is checked in; this is a local VM lane, not a self-hosted GitHub Actions security URL and not Windows/macOS evidence.

Limits

  • No remote CI URL for 00bdcad; G-C remains VM-verified, not CI-signed.
  • Windows/macOS strict behavior is not exercised here.
  • Strict L2 (Worker/Foreign/native plugin under real isolation) is still not implemented; L1 refuses those surfaces.
  • TCP/HTTP/DNS under strict are refused rather than isolated.