T08 · Insecure Dependencies
- Location
SKILL.md:11- Finding
Unpinned Global npm Dependency Handles an API Credential
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 11–21, 30–34, and 104–108
Vulnerability Type: Unpinned third-party dependency and supply-chain exposure
Risk Level: MediumVulnerable Code
yaml "primaryEnv": "COMPANIES_HOUSE_API_KEY", "install": [ { "id": "npm", "kind": "node", "package": "@shan8851/companies-house-cli", "bins": ["ch"], "label": "Install companies-house-cli (npm)", }, ],markdown Setup - `npm install -g @shan8851/companies-house-cli` - Get a free API key: https://developer.company-information.service.gov.uk/ - `export COMPANIES_HOUSE_API_KEY=your_key` or add it to a local `.env`markdown - API key required (free, instant signup at Companies House developer portal) - Auth is HTTP Basic (key as username, blank password) - Rate limit: 600 requests per 5 minutes - Company numbers are automatically zero-padded to 8 digitsTechnical Analysis
The Skill instructs users to globally install
@shan8851/companies-house-cliwithout pinning a version or providing an integrity hash. The installed executable subsequently receives access toCOMPANIES_HOUSE_API_KEY, which is used as an HTTP Basic authentication username.Network access and transmission of the API key to the official Companies House service are necessary for the declared company-record lookup functionality. However, the project contains only
SKILL.md; the dependency implementation is not present for review. Consequently, the audit cannot verify its lifecycle scripts, effective network destinations, telemetry, local file access, or credential handling.An unpinned installation may retrieve a different package release each time. If the npm package, publisher account, or release pipeline is compromised, malicious code could run during npm installation or when the
chexecutable is invoked. Global installation increases the exposure ...[truncated 2042 chars]- Remediation
View remediation
Remediation Suggestions
- Pin the package to a specific, reviewed version rather than installing the latest available release:
sh npm install --global @shan8851/companies-house-cli@<reviewed-version> - Publish or link to the dependency's auditable source code and verify that the npm artifact corresponds to that source.
- Provide npm provenance, a lockfile where applicable, and documented integrity hashes for approved releases.
- Prefer a project-local, locked installation over a global installation to reduce command-path and system-wide exposure.
- Audit all npm lifecycle scripts and transitive dependencies. Where operationally compatible, install with lifecycle scripts disabled.
- Explicitly document the official Companies House API hostname and enforce an allowlist so the API key cannot be sent to arbitrary destinations.
- Ensure authentication is performed exclusively over HTTPS with certificate validation enabled.
- Inject the credential only into the
chprocess rather than exporting it broadly to a long-lived shell environment. - If
.envstorage remains supported, require restrictive file permissions and ensure.envis excluded from version control. - Document key rotation and revocation procedures so users can promptly invalidate a credential after suspected dependency compromise.
- Pin the package to a specific, reviewed version rather than installing the latest available release:
