Signal K Server file access via resource ID path traversal
signalk-server · @signalk resources-provider
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| signalk-server npm |
|
|
| @signalk/resources-provider npm |
|
|
signalk-server · @signalk resources-provider
| Product | Affected | Fixed in |
|---|---|---|
| signalk-server npm |
|
|
| @signalk/resources-provider npm |
|
|
Signal K Server is a server application that runs on a central hub in a boat. From 2.0.0 until 2.34.0 for Signal K Server and from 1.0.0 until 1.5.3 for @signalk/resources-provider, the v2 REST route GET /signalk/v2/api/resources/:resourceType/:resourceId accepts an unsafe resourceId that can escape the intended resource directory. The route passes the attacker-controlled resourceId through src/api/resources/index.ts to FileStore.getResource() in packages/resources-provider-plugin/src/filestorage.ts without adequate path containment, allowing arbitrary JSON files reachable by the server to be read. Related PUT and DELETE resource operations can write or delete files outside the storage root. Deployments with allow_readonly enabled permit anonymous reads, while other deployments require a readonly user token. Reading security.json exposes the HS256 JWT signing secret and password hashes, allowing an attacker to forge an administrator token. Administrative access to POST /skServer/providers can then create an Execute provider that runs commands with the server process privileges and persists its configuration across restarts. This issue is fixed in Signal K Server 2.34.0 and @signalk/resources-provider 1.5.3.
From the CVE record · GitHub_M
The v2 resources REST route accepts a resource ID that can escape its storage directory, allowing remote attackers to read reachable JSON files; related operations can write or delete files outside the storage root. Reads are anonymous when allow_readonly is enabled; otherwise, a readonly user token is required. Reading security.json can expose secrets that allow an attacker to forge an administrator token and configure a command-executing provider, without user interaction.
Operators running signalk-server versions >=2.0.0 <2.34.0 or @signalk/resources-provider versions >=1.0.0 <1.5.3 should check their deployments.