Skip to main content

LunaPack Usage Threat Model

This explanation describes threats, controls, and residual risks when you use LunaPack with local or Git sources. LunaPack manages project files and can run pack-provided lifecycle scripts. It is not a sandbox or privilege boundary. Treat every pack and source as publisher code.

Trust Boundaries

  • A project owner chooses local directories or Git repositories as pack sources.
  • Luna reads project configuration, lock state, manifests, templates, selected files, and the current workspace.
  • Managed-file transactions cross from resolved pack content into the workspace.
  • Approved lifecycle scripts cross into a process with the current user's authority.
  • Git hosts are external identity and transport boundaries.
  • The operating system, Git client, and container runtime remain responsible for their own security boundaries.

Spoofing

TM-S01: Source or Publisher Impersonation

FieldAssessment
ComponentConfigured local and Git sources, pack resolution
AssetPack identity, selected source, resolved content
ScenarioAn attacker presents a repository, moved tag, or duplicate pack ID as content from the expected publisher.
PreconditionsThe consumer adds the source, accepts a mutable ref, or resolves an ambiguous ID.
LikelihoodMedium
ImpactMalicious files or hooks can be selected under a trusted-looking pack ID.
SeverityHigh
ControlsNormalized source identities, source-name binding, exact Git commit lock evidence, ID conflict rejection, graph-wide external-source consent, and dry-run reporting.
FixUse full commit IDs for immutable automation. Publisher signatures and rollback-resistant metadata are required before introducing a hosted catalog.
PriorityFuture hardening before hosted-catalog launch
StatusMitigated for current local and configured Git sources
VerificationSource identity, mutable-ref, conflict, consent, and lock-provenance tests.
Residual riskA pack ID and locked commit establish provenance, not cryptographic publisher identity. Protected tags remain a Git-host policy.

Tampering

TM-T01: Workspace Escape Through Filesystem Aliases

FieldAssessment
ComponentInstall, update, Luna Link, move, uninstall, rollback, and project-state persistence
AssetFiles inside and outside the selected workspace
ScenarioA workspace path component is a symbolic link, junction, or reparse point, or a destination is hard-linked to a file outside the project.
PreconditionsThe alias exists before mutation or another same-user process can alter the workspace.
LikelihoodMedium
ImpactArbitrary file overwrite or deletion with the invoking user's permissions.
SeverityHigh
ControlsRooted and traversal rejection, full-plan alias preflight, direct-path alias checks, and sibling-file replacement for hard-linked destinations.
FixImplemented for deterministic aliases. Handle-relative no-follow traversal remains future hardening.
PriorityImplemented release control; race hardening deferred
StatusFixed with residual same-user race
VerificationDeterministic reparse-point tests, real symbolic-link security tests, and hard-link replacement tests.
Residual riskPath inspection and mutation are separate operations; a same-user process can race component replacement.

TM-T02: Lock or Git Cache Poisoning

FieldAssessment
Componentlunapack-lock.yml, project Git cache, source materialization
AssetResolved source identity, commit, manifest, target ownership, and selected bytes
ScenarioAn attacker edits local lock or cache data so Luna reuses content from another source, commit, path, or manifest.
PreconditionsThe attacker can modify the project or cache as the same user.
LikelihoodMedium
ImpactUnreviewed bytes can enter planning, overwrite owned files, or influence lifecycle selection.
SeverityHigh
ControlsTyped lock validation, configured-source ownership matching, immutable Git commit resolution, cache identity and commit validation, manifest checks, and blob verification before reuse.
FixCache entries now fail validation or are repaired before project mutation. Keep lock changes under source review.
PriorityImplemented
StatusFixed for cache substitution; local lock integrity remains user-controlled
VerificationInvalid, escaping, identity-mismatched, commit-mismatched, and content-mismatched cache tests.
Residual riskA same-user attacker who can modify the workspace can also modify project configuration and lock evidence. Luna does not sign local state.

TM-T03: Ambiguous or Malformed Documents

FieldAssessment
ComponentProject configuration, lock files, pack manifests, custom YAML converters, JSON Schemas
AssetParsed source, parameter, target, variable, and ownership semantics
ScenarioDuplicate keys, unknown properties, malformed numeric values, or escaping paths are interpreted inconsistently or bypass intended validation.
PreconditionsA user opens or consumes an attacker-controlled repository or pack.
LikelihoodMedium
ImpactConfiguration confusion, denial of service, or unsafe target selection.
SeverityMedium
ControlsTyped parsing, duplicate and unknown-property rejection, handled YAML errors, runtime validation, and schema parity for managed and lock targets.
FixImplemented for source, pack-parameter, and scalar-dictionary converters and target confinement.
PriorityImplemented
StatusFixed for reviewed version-1 documents
VerificationMalformed configuration, duplicate parameter, target traversal, and runtime/schema parity tests.
Residual riskComplete parser byte, nesting, and collection ceilings are not yet defined; see TM-D01.

Repudiation

TM-R01: Lifecycle Action Denial

FieldAssessment
ComponentLifecycle trust decisions, lock evidence, CLI diagnostics
AssetEvidence of what source, script, and version was authorized
ScenarioA publisher or operator disputes which pack code ran after an incident.
PreconditionsLocal output was not retained or mutable source metadata was used.
LikelihoodLow
ImpactIncident response cannot reconstruct authorization confidently.
SeverityMedium
ControlsSource fingerprints, exact Git commits, rendered hook arguments before consent, and lock records.
FixRetain relevant redacted diagnostics and prefer immutable refs.
PriorityOperational requirement
StatusMitigated
VerificationTrust and lock-provenance tests.
Residual riskLunaPack collects no telemetry and does not maintain an independent append-only audit log.

Information Disclosure

TM-I01: Secret Disclosure to Approved Hooks

FieldAssessment
ComponentLifecycle process execution
AssetCredentials and private values in the parent environment or accessible files
ScenarioAn approved hook reads ambient cloud tokens, CI variables, credentials, or unrelated user files and sends or prints them.
PreconditionsThe user authorizes the hook or uses --scripts run.
LikelihoodMedium
ImpactCredential theft and access to resources available to the current user.
SeverityHigh
ControlsExplicit script modes, scoped trust, dominant persistent denial, pre-authorization of every hook, literal argument lists, and clear non-sandbox documentation.
FixUse --scripts skip for untrusted automation and minimize credentials. A future environment allowlist should remove ambient secrets.
PriorityShould address soon after release
StatusOpen, explicitly accepted execution boundary
VerificationTrust-policy and process argument tests; environment-minimization tests are pending.
Residual riskEven with a smaller environment, approved code retains the invoking user's filesystem, process, and network authority.

TM-I02: Source Disclosure Through Snapshot Entries

FieldAssessment
ComponentOperation pack snapshotting
AssetFiles outside the selected pack root
ScenarioA pack contains a link or special object that redirects snapshot copying to unrelated local data.
PreconditionsThe source tree contains an unsupported entry or is changed concurrently by another same-user process.
LikelihoodLow
ImpactUnrelated bytes could be staged, hashed, rendered, copied, or exposed to an approved hook.
SeverityMedium
ControlsLinked roots fail; child links, reparse points, devices, and unsupported objects emit warnings and are skipped while regular siblings continue.
FixDeterministic alias following is fixed. Handle-relative no-follow copying remains future hardening.
PriorityImplemented release control; race hardening deferred
StatusFixed with residual same-user race
VerificationDeterministic warning-and-skip test plus real file-link, directory-link, install, and update tests on symlink-capable hosts.
Residual riskA concurrent same-user attacker may replace an inspected entry before it is opened. Skipping an entry may leave a pack incomplete.

Denial of Service

TM-D01: Resource Exhaustion From Crafted Content

FieldAssessment
ComponentYAML parsing, source discovery, graph resolution, selection, snapshotting, and Scriban rendering
AssetCLI availability, memory, CPU, disk, and workspace integrity
ScenarioA very large or deeply nested pack, graph, template, or selected file set exhausts resources.
PreconditionsThe consumer evaluates or installs attacker-controlled content.
LikelihoodMedium
ImpactProcess termination, disk exhaustion, long execution, or partial external hook effects.
SeverityMedium
ControlsGraph cycle and conflict checks, template computation limits, cancellation paths, private temporary workspaces, and transactional project mutation.
FixAdd one fixed resource-limit policy covering document bytes and depth, graph nodes, files, byte totals, parameter sizes, and rendered output.
PriorityShould address soon after release
StatusOpen
VerificationExisting cycle, conflict, malformed-input, and template tests; exact-boundary resource tests are pending.
Residual riskCurrent public schemas do not define complete resource ceilings. Use disposable workspaces for unfamiliar packs.

Elevation of Privilege

TM-E01: User-Authority Execution by Lifecycle Scripts

FieldAssessment
ComponentLifecycle hook authorization and process launch
AssetCurrent user's files, credentials, processes, and network access
ScenarioA malicious pack convinces a user or automation to approve a hook that performs arbitrary actions.
PreconditionsScript execution is explicitly approved, previously trusted, or selected with --scripts run.
LikelihoodMedium
ImpactArbitrary code execution with the invoking user's full ambient authority.
SeverityHigh
ControlsPrompt, run, and skip modes; source-scoped trust; dominant denial; escaped preview; direct executable resolution; literal argv; snapshot hashing; and pre-mutation authorization.
FixTreat approval as code execution. Use denial or skip mode where hooks are not required. LunaPack does not claim sandboxing.
PriorityPermanent trust boundary
StatusAccepted by design
VerificationTrust-scope, denial, argument, digest, cancellation, and rollback tests.
Residual riskAuthorized code can create irreversible external effects that no transaction can restore.

Safer Operation

  1. Add only sources whose identity and ownership you reviewed.
  2. Pin full Git commits and exact Luna versions in reproducible automation.
  3. Inspect unfamiliar packs and run --dry-run before applying changes.
  4. Review managed targets, external sources, templates, instructions, and hook arguments.
  5. Use --scripts skip or the narrowest trust scope that satisfies the workflow.
  6. Keep lunapack-lock.yml under review and use luna audit for drift.
  7. Run untrusted evaluation in a disposable workspace with minimal credentials.
  8. Verify release archives with SHA256SUMS.txt; prefer immutable image digests when available.

Diagnostics and hook output may contain private paths, URLs, usernames, or tool output. Redact them before sharing. LunaPack does not collect telemetry.

Report suspected vulnerabilities through the Security Policy.