Docs / SECURITY-INDEPENDENT-REVIEW

Independent security review

Source: docs/SECURITY-INDEPENDENT-REVIEW.md

Reviewed revision: 321e188727d82dca419181c143d700a8f66febc3
Scope: gamecomposer/ CLI and runtime, both example serve.py servers, sdk/, and the desktop boundary.
Result: One conditional security finding; no source changes made.

Findings

MEDIUM — HTTPS asset URLs can redirect the host downloader to other schemes/hosts

gamecomposer/core.py:66-70 checks only the manifest's initial asset URL for an HTTPS scheme. gamecomposer/runtime.py:129-135 passes that URL directly to urllib.request.urlopen, whose default redirect handling follows server-supplied redirects without reapplying the manifest's HTTPS/host policy. A project manifest can therefore name a trusted-looking HTTPS URL that redirects to an HTTP endpoint or a host-local service; up makes the redirected request from the host running Game Composer. This is a server-side request forgery / unintended host-network access primitive when a user runs a crafted or compromised project manifest. The response still has to match the declared SHA-256 before it is used as an asset, but that check occurs after the request and does not prevent request-side effects or access attempts.

Recommendation: Validate every redirect hop and final URL, reject non-HTTPS schemes, and apply an explicit host/address policy that blocks loopback, link-local, and private destinations (including after DNS resolution). Consider disabling redirects unless required.

Reviewed boundaries with no additional confirmed finding

  • The CLI/API routes to the same manifest loader and runtime (gamecomposer/cli.py:14-20, gamecomposer/api.py:8-17). Runtime commands are passed to Kiri as an argument vector rather than through a shell (gamecomposer/runtime.py:51-55, 288-331); project manifests can still request arbitrary container images, build contexts, and processes, so running an untrusted manifest is a trust decision.
  • Project-relative source/build/storage paths are resolved and checked against the project root (gamecomposer/core.py:41-56, gamecomposer/runtime.py:101-111). URL asset downloads are size-limited and hash-checked (gamecomposer/runtime.py:128-149), subject to the redirect issue above.
  • The NES example exposes a fixed route table and bounds checkpoint POST size (examples/nes/image/serve.py:11-14, 17-34, 36-44). The SNES example also uses fixed routes (examples/snes/image/serve.py:10-14, 17-33). Both listen on all container interfaces (examples/nes/image/serve.py:52, examples/snes/image/serve.py:36); the declared runtime publishes the browser port on host loopback (gamecomposer/runtime.py:311-313).
  • The TypeScript SDK parser checks YAML syntax and root shape, while lifecycle methods delegate to the supplied transport (sdk/src/config.ts:21-43, sdk/src/lifecycle.ts:17-40). It does not claim schema validation or provide a concrete privileged transport.
  • The Electron shell disables Node integration and enables context isolation (desktop/src/main.cjs:12-16). Its preload exposes only the contract adapter, whose lifecycle runner rejects when not connected (desktop/src/preload.cjs:6-12, desktop/src/contract-adapter.cjs:7-13). The UI remains disabled/unverified (desktop/src/index.html:33, 55).

Limits

This is a source review of the specified revision, not a live Kiri/container deployment assessment. The redirect finding is based on the standard behavior of Python's urllib.request.urlopen; no external endpoint was contacted and no runtime was launched.

Back to all docs