T09 · Insecure Skill Coding Practices
- Location
scripts/setup.sh:125- Finding
JavaScript Code Injection Through Unsafely Interpolated Setup Arguments
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is for Tencent Cloud Lighthouse administration, but it stores cloud API keys in plaintext and runs unpinned npm packages with those credentials, so users should review it carefully before installing.
Install only if you are comfortable giving this skill a Tencent Cloud API key and allowing npm-sourced code to run with that key. Use a dedicated least-privilege CAM identity, restrict or rotate credentials, check permissions on ~/.mcporter/mcporter.json, and prefer a pinned or locally reviewed MCP server package before using remote command or firewall operations.
scripts/setup.sh:125JavaScript Code Injection Through Unsafely Interpolated Setup Arguments
scripts/setup.sh:97Unpinned npm Packages Are Downloaded and Executed During Setup and Runtime
scripts/setup.sh:111Tencent Cloud Credentials Are Stored in Plaintext Without Enforced Restrictive Permissions
The skill’s declared purpose emphasizes Lighthouse management, but its first-use flow collects Tencent Cloud SecretId/SecretKey and persists them into a local mcporter configuration file. That credential-handling behavior is materially more sensitive than simple cloud-instance management guidance and is not clearly disclosed in the description, creating a trust and secret-exposure risk if users provide long-lived API keys to the agent workflow.
The script installs mcporter globally via npm, which introduces execution of general-purpose package manager tooling and lifecycle scripts outside narrowly scoped Lighthouse management. While this may be operationally convenient, it expands the trust boundary to the npm ecosystem and allows package-install-time code execution on the host.
The script persists TENCENTCLOUD_SECRET_ID and TENCENTCLOUD_SECRET_KEY directly into a JSON config file on disk, with no permission hardening, encryption, or warning to the user. If the file is readable by other local users, backed up insecurely, or later exposed through logs or tooling, long-lived cloud credentials can be stolen and used to access or manipulate Lighthouse resources.
The script writes configuration that causes future execution of npx -y lighthouse-mcp-server, which delegates runtime code retrieval and execution to the npm ecosystem. In this skill context, that is more dangerous because the executed package receives cloud credentials through environment variables and is intended to manage Tencent Cloud resources, increasing the blast radius of any package compromise.
The script configures the MCP server to run via npx lighthouse-mcp-server without pinning a specific version or integrity source. That means future executions may fetch and run whatever package version is current at the time, creating a supply-chain risk where a compromised, typo-squatted, or maliciously updated package could execute arbitrary code with the user's privileges and access to Tencent Cloud credentials.