T08 · Insecure Dependencies
Warning
- Location
- README.md:17
- Finding
- Unpinned Third-Party Installer Executed Through npx<![CDATA[ ## Vulnerability Details **File Location**: `README.md`, lines 17–22 **Vulnerability Type**: Unpinned third-party dependency execution **Risk Level**: Medium ```bash # From homecheck repo (GitCode) npx skills add https://gitcode.com/openharmony-sig/homecheck --skill ohos-react-native-performance # Or if shorthand is supported for your git host # npx skills add openharmony-sig/homecheck --skill ohos-react-native-performance ``` ### Technical Analysis The documented command invokes the `skills` npm package through `npx` without specifying an audited version or integrity constraint. If the package is not already available locally, `npx` can retrieve its current version from the configured npm registry and execute it with the privileges of the installing user. Consequently, the executable installer may differ from the version originally reviewed. Compromise of the registry account, package ownership transfer, malicious future publication, or resolution through an untrusted registry could turn this installation command into an arbitrary code-execution channel. The external Git repository is also referenced without an immutable commit identifier, allowing its retrieved contents to change over time. The project itself contains no embedded executable scripts or observed malicious payload. This finding concerns the unsafe, mutable dependency-installation workflow documented by the project. ### Attack Path 1. An attacker compromises the npm package, its maintainer account, or the registry used to resolve the unpinned `skills` package. 2. The attacker publishes a malicious version containing lifecycle or installer code. 3. A user follows the documented `npx skills add ...` command. 4. `npx` resolves and downloads the attacker-controlled package version. 5. The package executes under the user's account during installation. 6. The malicious installer can access or modify resources available to that user before installing the expected skill to conceal the co ...[truncated 721 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin the installer to a specifically reviewed version, for example: ```bash npx --yes skills@<audited-version> add <immutable-source> --skill ohos-react-native-performance ``` 2. Replace `<immutable-source>` with a repository reference pinned to an audited commit rather than a mutable default branch or shorthand. 3. Publish and verify expected package provenance, maintainer identity, checksums, and signatures where supported. 4. Use a lockfile and npm integrity metadata in automated environments instead of resolving the latest package dynamically. 5. Configure CI and developer systems to use a trusted registry and disable unexpected registry overrides. 6. Prefer manual installation of reviewed files when package execution is unnecessary. 7. Run installation in a least-privileged, isolated environment without production credentials or unrelated sensitive files. 8. Apply the same controls to the separately documented `npx ai-agent-skills install` alternative. ]]>
