T08 · Insecure Dependencies
- Location
SKILL.md:14- Finding
Unpinned Runtime npm Dependency Installed and Loaded from Shared Temporary Storage
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 14-16; dependency loading also occurs at lines 22-23 and 57-59
Vulnerability Type: Unpinned third-party dependency and unsafe shared temporary installation path
Risk Level: MediumVulnerable Code
bash cd /tmp && npm install chinese-lunar-calendarjavascript const { getLunar } = require('/tmp/node_modules/chinese-lunar-calendar/src/lunar_calendar.js');Technical Analysis
The skill directs the agent to install
chinese-lunar-calendarwithout an exact version, lockfile, or integrity constraint. Consequently, the package content resolved at execution time may differ from the content that was originally reviewed.npm package installation can execute package lifecycle scripts, while importing a Node.js module executes its initialization code. A compromised package release or registry response could therefore cause arbitrary JavaScript to run under the account invoking the skill.
The package is installed into
/tmp/node_modules, a shared and predictable temporary location. Another local process with sufficient filesystem access could pre-create, replace, or modify package files before they are loaded. The skill also imports an internal source path rather than a documented package entry point, increasing coupling to unreviewed implementation details.Attack Path
- An attacker compromises a future release of
chinese-lunar-calendar, influences package resolution, or gains sufficient local access to modify/tmp/node_modules/chinese-lunar-calendar. - The agent runs the documented unpinned
npm installcommand or uses an existing package tree under/tmp. - Malicious code executes through an npm lifecycle script during installation or through module initialization when
require()loads the altered file. - The code operates with the filesystem, network, environment-variable, and process privileges of the user runni ...[truncated 630 chars]
- An attacker compromises a future release of
- Remediation
View remediation
Remediation Suggestions
- Pin the dependency to a reviewed exact version rather than resolving the latest available release.
- Commit and verify a lockfile with npm integrity hashes, then install using
npm ci. - Install dependencies inside a dedicated, permission-restricted project directory instead of the shared
/tmp/node_modulespath. - Review package lifecycle scripts and, where compatible with the package, use
npm ci --ignore-scriptsto prevent installation-time code execution. - Import the package through its documented public entry point rather than directly loading a file under
src/. - Run the conversion process under a least-privileged account with restricted filesystem, credential, and network access.
- Consider replacing the runtime installation with a vendored and reviewed implementation or a prebuilt, integrity-verified dependency artifact.
