T09 · Insecure Skill Coding Practices
- Location
scripts/run.js:58- Finding
Bearer token can be redirected to an arbitrary server
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill appears to be a legitimate KeyAPI influencer research tool, but it handles API tokens and local data in ways users should review before installing.
Install only if you are comfortable giving this skill a KeyAPI token, sending influencer research queries to KeyAPI, and storing API responses locally. Do not set KEYAPI_SERVER_URL unless you fully trust the destination, prefer setting KEYAPI_TOKEN in your environment instead of entering it interactively, keep any .env file out of source control, and review or clear .keyapi-cache if the researched creators or audiences are sensitive.
scripts/run.js:58Bearer token can be redirected to an arbitrary server
scripts/run.js:251Interactively entered API token is persisted in plaintext
package.json:5Dependency installation is not reproducible because no lockfile is provided
Referenced artifact was not completely inspected
node scripts/run.js --list-tools
Referenced artifact was not completely inspected
node scripts/run.js --list-tools
Referenced artifact was not completely inspected
node scripts/run.js --list-tools
Referenced artifact was not completely inspected
node scripts/run.js --list-tools
Referenced artifact was not completely inspected
node scripts/run.js --list-tools
Referenced artifact was not completely inspected
node scripts/run.js --list-tools
Referenced artifact was not completely inspected
node scripts/run.js --list-tools
Referenced artifact was not completely inspected
node scripts/run.js --list-tools
Referenced artifact was not completely inspected
node scripts/run.js --list-tools
Referenced artifact was not completely inspected
node scripts/run.js --list-tools
Referenced artifact was not completely inspected
node scripts/run.js --list-tools
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
const __dirname = dirname(fileURLToPath(import.meta.url));
const ROOT = resolve(__dirname, "..");
// ── .env loader ───────────────────────────────────────────────────────────────
(function loadDotenv() {
const envPath = join(ROOT, ".env");
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
const __dirname = dirname(fileURLToPath(import.meta.url));
const ROOT = resolve(__dirname, "..");
// ── .env loader ───────────────────────────────────────────────────────────────
(function loadDotenv() {
const envPath = join(ROOT, ".env");
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
const __dirname = dirname(fileURLToPath(import.meta.url));
const ROOT = resolve(__dirname, "..");
// ── .env loader ───────────────────────────────────────────────────────────────
(function loadDotenv() {
const envPath = join(ROOT, ".env");
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
const __dirname = dirname(fileURLToPath(import.meta.url));
const ROOT = resolve(__dirname, "..");
// ── .env loader ───────────────────────────────────────────────────────────────
(function loadDotenv() {
const envPath = join(ROOT, ".env");
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
// ── .env loader ───────────────────────────────────────────────────────────────
(function loadDotenv() {
const envPath = join(ROOT, ".env");
if (!existsSync(envPath)) return;
for (const line of readFileSync(envPath, "utf8").split("\n")) {
const m = line.match(/^\s*([A-Z_][A-Z0-9_]*)\s*=\s*(.*)$/);
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
// ── .env loader ───────────────────────────────────────────────────────────────
(function loadDotenv() {
const envPath = join(ROOT, ".env");
if (!existsSync(envPath)) return;
for (const line of readFileSync(envPath, "utf8").split("\n")) {
const m = line.match(/^\s*([A-Z_][A-Z0-9_]*)\s*=\s*(.*)$/);
The script writes the API token directly to .env in plaintext without prompting about storage risks or setting restrictive permissions. In shared directories, synced folders, or misconfigured repositories, this can expose reusable credentials to other local users or leak them through backups and source control.
reject(new Error("No token entered. Set KEYAPI_TOKEN and try again."));
return;
}
const envPath = join(ROOT, ".env");
writeFileSync(envPath, `KEYAPI_TOKEN=${token}\n`, "utf8");
log(`[token] Saved to ${envPath} — future runs will load it automatically`);
process.env.KEYAPI_TOKEN = token;
The skill requires access to an environment secret (KEYAPI_TOKEN) and instructs execution of local Node scripts, but it does not declare an explicit tool scope such as allowed-tools or permissions. That weakens least-privilege boundaries and makes it harder for a user or host system to understand in advance what capabilities the skill expects, increasing the chance of unintended secret exposure or overbroad execution.
The skill explicitly routes requests to a remote MCP server and sends influencer search terms, handles, numeric user IDs, and related query parameters off-host, but it does not warn the user that their inputs and looked-up entities will be transmitted to a third party. This creates a transparency and privacy risk, especially where searches, audience sampling, or competitor research may be sensitive business data.
The skill directs the agent to persist API responses, influencer identifiers, followers/following data, region data, and analytics into a local cache hierarchy without any retention limits, access controls, or privacy notice. Even if the data is business-oriented, it can still contain personal or profiling information, and long-lived local storage increases the risk of unauthorized reuse, leakage, or cross-session exposure.
The script is a generic MCP runner that can list schemas and invoke any server-exposed tool based solely on user input. In a narrowly scoped influencer-discovery skill, that creates a capability escalation path: if the backing MCP server exposes sensitive or unrelated tools, the agent can enumerate and call them despite the skill’s declared purpose.
The runner explicitly supports arbitrary platforms via --platform and constructs the server URL dynamically, even though the skill is described as TikTok-specific influencer discovery. This expands the operational scope beyond the declared purpose and can let an agent use the skill against unrelated data domains or APIs, undermining least-privilege and increasing the chance of policy bypass or unintended data access.
API responses are written to a local cache by default, potentially persisting influencer data, analytics, or other returned content without clear upfront notice or opt-in. In agent or multi-user environments, this can create unintended data retention and local disclosure risks if cached files are later accessed by other processes or users.
The dependency is specified with a caret range (^1.10.2), which permits automatic installation of newer compatible releases rather than a single audited version. This weakens supply-chain reproducibility and can unexpectedly introduce vulnerable or malicious code through future dependency updates.
"type": "module",
"engines": { "node": ">=18.0.0" },
"dependencies": {
"@modelcontextprotocol/sdk": "^1.10.2"
}
}