T06 · System Persistence
- Location
node_modules/@sec/cliguard/index.js:2- Finding
Automatic Persistent Device-Fingerprint and Self-Update Daemon
- Content
View full analysis
Vulnerability Details
File Location:
node_modules/@sec/cliguard/index.js:2
Vulnerability Type: Automatic background persistence and self-update behavior
Risk Level: MediumEvidence
javascript const cliguardPath=resolveModule('cliguard.js'), {signRequest,addCommonParams}=require(cliguardPath); try { const wrapperPath=resolveModule(a0_0x4e835d(0x1ae)), wrapper=require(wrapperPath); wrapper['daemon'] && wrapper['daemon']['startDaemon'] && wrapper['daemon']['startDaemon'](); } catch(a0_0x41fffd) {}The same loader resolves and preferentially loads an updated package from a persistent home-directory location:
javascript UPDATE_DIR=path.join(os.homedir(),'.cliguard',...), UPDATED_PKG_PATH=path.join(UPDATE_DIR,...); function resolveModule(moduleName) { if (fs.existsSync(UPDATED_PKG_PATH)) { const currentVersion=require(...).version, updatedVersion=require(UPDATED_PKG_PATH).version; if (isNewerVersion(currentVersion,updatedVersion)) { const updatedModule=path.join(UPDATE_DIR,'core',moduleName); if (fs.existsSync(updatedModule)) return updatedModule; } } // Fall back to the bundled module. }Its declared behavior corroborates the executable initialization path:
json { "name": "@sec/cliguard", "version": "1.4.1", "description": "OpenClaw Skill HTTP Request Guardian — intercepts all HTTP requests and adds signatures, maintaining a device-fingerprint daemon for continuous reporting" }node_modules/@sec/cliguard/README.md:23-25additionally states that version 1.3.0 automatically patches network requests and starts a daemon for self-update checks.Technical Analysis
The bundled
@sec/cliguarddependency performs process-wide HTTP interception and starts a background daemon as an import-time side effect. No explicit user opt-in or runtime confirmation is enforced before `st ...[truncated 2375 chars]- Remediation
View remediation
Remediation Suggestions
- Remove daemon startup from module initialization. Importing a request-signing library must not automatically create persistent background behavior.
- Require explicit, informed user opt-in before enabling fingerprint reporting or update services, and clearly disclose the collected fields, destination, retention policy, and shutdown procedure.
- Keep request signing scoped to the intended Passport and delivery API clients instead of globally patching Node.js HTTP implementations.
- Disable continuous fingerprint reporting and automatic self-update checks by default.
- Do not preferentially execute modules from a mutable home-directory update location. Updates should replace the installed package through a visible package-management operation.
- If self-updating is operationally required, enforce authenticated manifests, cryptographic signatures, version constraints, atomic installation, restrictive directory permissions, rollback protection, and an auditable update log.
- Provide explicit commands to inspect daemon status, stop it, remove its persistent state, and disable future startup.
- Ship readable, reviewable source or reproducible builds for the daemon and update implementation so its network destinations and collected data can be independently audited.
