Summary
Lumiverse's Spindle extension build pipeline runs bun install without disabling lifecycle scripts before performing its backend safety scan.
A malicious extension that defines preinstall, postinstall, or prepare scripts in its package.json can trigger host-level command execution as soon as an admin clicks Install, before any distribution files are inspected or validated.
Affected context
This vulnerability affects environments where Lumiverse's Spindle extension system:
- Accepts third-party or semi-trusted extensions packaged with a package.json
- Executes
bun installas part of the build/install pipeline - Runs dependency installation on the host or a privileged CI/build agent
- Relies on a subsequent static backend safety scan to validate built artifacts
Under these conditions, lifecycle scripts declared in package manifests run before any security checks on the resulting backend bundle.
Exploit preconditions
- Attack surface: Extension installation path in Lumiverse's Spindle extension ecosystem.
- Required access: Ability to submit or host an extension bundle that an administrator will install (e.g., via an extension registry, marketplace, or uploaded package).
- Trigger point: An administrator presses the Install action, causing the Spindle build pipeline to invoke
bun installfor the extension. - Why exploitation is possible: The pipeline runs
bun installwithout the--ignore-scriptsflag, allowing preinstall, postinstall, or prepare scripts defined in package.json to execute arbitrary system commands before the static backend safety scan (assertSafeBackendBundle) runs.
Why this happens
The core issue is the execution of untrusted code during the dependency installation phase of the extension build pipeline.
By invoking bun install without disabling package lifecycle scripts, the system implicitly trusts any scripts declared in the extension's package.json.
This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), because user-controlled manifest data can be used to run arbitrary OS commands on the host build environment.
Conceptually, the pipeline grants code execution privileges to extension-provided scripts before performing any security validation on the resulting backend bundle.
Potential impact
- Extension authors may gain arbitrary command execution on the host running the Spindle build pipeline.
- Attackers could install backdoors, modify system configuration, or pivot laterally from the build host.
- Build artifacts and backend bundles can be tampered with or poisoned before safety scanning.
- Extension ecosystem integrity can be undermined, enabling supply-chain attacks against downstream Lumiverse deployments.
- Sensitive data, such as API keys, environment variables, or configuration files on the build host, can be exfiltrated.
General mitigation guidance
Mitigation focuses on treating the build pipeline as an untrusted-code boundary and minimizing what unverified extensions can execute:
- Disable lifecycle scripts during dependency installation for untrusted extensions (e.g., using flags that ignore or block preinstall/postinstall/prepare scripts).
- Separate the build environment for extensions from critical infrastructure by using isolated, ephemeral, and least-privileged execution environments.
- Require that any executable logic bundled with extensions be statically analyzed and validated before it is ever executed in the build pipeline.
- Restrict network and filesystem permissions for build processes to limit the blast radius if malicious scripts run.
- Adopt "secure-by-default" pipeline configurations where running extension-provided scripts requires explicit, well-audited opt-in.
How teams detect issues like this
Detection typically involves scrutinizing build pipelines and extension manifests for unsafe execution patterns:
- Use static analysis or policy-as-code tools to flag invocations of package managers (bun, npm, pnpm, yarn) that run without script-disabling flags in untrusted contexts.
- Implement CI checks that scan extension package.json files for suspicious or unexpected lifecycle scripts (preinstall, postinstall, prepare) before they are accepted.
- Monitor build logs and host telemetry for anomalous commands invoked during extension installation, especially those initiated via package scripts.
- Enforce review policies where any modification to the extension installation pipeline requires security approval and automatic regression tests for script execution behavior.

