Summary
The Signal K Server appstore interface allows administrators to install npm packages using a REST API, but passes user-supplied version specifiers directly to npm without restriction.
Because npm accepts remote URLs and git references as valid version specifiers, an attacker with admin access can cause installation of attacker-controlled code that runs arbitrary commands via postinstall scripts.
Affected context
This vulnerability affects Signal K Server deployments that expose or use the appstore REST API for installing plugins or web applications.
It becomes relevant when:
- Administrative access to the Signal K appstore interface is available, either through the web UI or API tokens.
- The server is allowed to reach external npm registries or arbitrary URLs (e.g., internet connectivity from the boat's hub).
- The installation mechanism passes the
versionparameter directly to npm, allowing non-registry sources such as git repositories or HTTP(S) tarball URLs.
Exploit preconditions
- Attack surface: Signal K Server appstore REST API endpoint used to install npm packages.
- Required access: Administrator-level access to the appstore interface or a valid admin token/credential.
- Network assumptions: The Signal K host can reach the npm registry and/or attacker-controlled git/HTTP(S) endpoints.
- Trigger point: Invocation of the plugin/webapp installation endpoint with a crafted
versionfield that points to an attacker-controlled npm package source. - Why exploitation is possible: The server only validates that the package name exists in the npm registry but does not constrain or sanitize the
versionspecifier. npm's flexible version syntax accepts URLs and git references, and will execute arbitrarypostinstallscripts during installation.
Why this happens
The core issue is trusting a user-controlled parameter (version) as executable configuration for a powerful package management tool.
Instead of constraining version strings to known-safe semver ranges from the npm registry, the code forwards arbitrary version specifiers directly to npm.
npm's design allows version specifiers that reference remote git repositories, GitHub shorthand, or HTTP(S) tarballs, any of which can contain a package.json with a postinstall script that runs arbitrary commands.
This aligns with CWE-94: Improper Control of Generation of Code ('Code Injection'), because external input effectively controls which remote code is retrieved and executed by the installation process.
Potential impact
- Execution of arbitrary OS-level commands on the Signal K Server host under the privileges of the service account.
- Installation of persistent malicious plugins or backdoors within the Signal K environment.
- Unauthorized access to navigation data, sensor feeds, or other connected systems on the boat's network.
- Data exfiltration or manipulation of configuration, logs, or telemetry.
- Lateral movement to other services or devices reachable from the compromised host.
General mitigation guidance
Effective mitigation focuses on reducing how much control external input has over package resolution and installation:
- Restrict allowed version specifiers to simple semantic versions or ranges that must exist in the trusted npm registry entry for the validated package name.
- Explicitly disallow version forms that refer to git repositories, GitHub shorthand, local file paths, or arbitrary HTTP/HTTPS URLs.
- Introduce a server-side allowlist of approved plugin and webapp sources, decoupling user input from raw npm CLI behavior.
- Run the Signal K Server and its package installation process under a minimally privileged account, with limited filesystem and network capabilities.
- Where feasible, separate the plugin installation mechanism from the runtime process (e.g., using an isolated worker or container) to reduce blast radius if a plugin behaves maliciously.
- Treat plugin and webapp packages as untrusted code, and document this risk clearly for operators configuring administrative access.
How teams detect issues like this
Detection typically combines code-level review with runtime monitoring:
- Static/code review: Search for calls that invoke npm (or equivalent package managers) with user-supplied arguments, especially version strings or source URLs. Flag any logic that passes them through without validation or normalization.
- Configuration and policy checks: Enforce policies that limit the allowed version syntax in the appstore interface and reject non-registry sources as part of API-level validation.
- Runtime monitoring: Log all plugin and webapp installation requests, including requested package names and version specifiers, and alert on unusual patterns such as git URLs, IP-based URLs, or nonstandard domains.
- Security tooling: Use application security testing tools or custom linters to identify patterns where external input is allowed to control package resolution or script execution, and incorporate checks into CI/CD pipelines.

