Back to skill

Security audit

Keyapi Reddit User Analysis

Security checks for vulnerabilities and agentic risk

Overview

This Reddit-analysis skill is mostly coherent, but its runner has broader platform/network authority and weaker token handling than the Reddit-only description makes clear.

Review this before installing. Use KEYAPI_TOKEN from a controlled environment variable, avoid entering it into the interactive prompt, check that KEYAPI_SERVER_URL is unset or points only to the intended KeyAPI host, and expect Reddit results to be cached locally until you delete them.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/run.js:49
Finding

Bearer Token Disclosure Through Unrestricted MCP Server Override

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/run.js:251
Finding

API Token Collected Visibly and Persisted in a Plaintext Environment File

Content
View full analysis
.env" ); } const { createInterface } = await import("readline"); const rl = createInterface({ input: process.stdin, output: process.stderr }); return new Promise((resolve, reject) => { process.stderr.write("\nKEYAPI_TOKEN is required. Get yours at https://keyapi.ai/\n\n"); rl.question("Enter your token: ", (answer) => { rl.close(); const token = answer.trim(); if (!token) { 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; resolve(token); }); }); } ``` ### Technical Analysis The token is collected with `readline.question()`, which normally echoes terminal input, exposing the credential to shoulder surfing, terminal recording, or captured interactive logs. The runner then writes the token directly to a plaintext `.env` file. The write does not specify restrictive permissions such as `0o600`, does not verify that the destination is a regular file rather than a symbolic link, and does not ask the user whether persistent storage is desired. Actual file permissions are affected by the process umask and environment. Consequently, the file may be readable by unintended local principals or ...[truncated 1221 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
package.json:5
Finding

Unpinned Dependency Resolution Without a Lockfile

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (31)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documentation presents a Reddit-specific analysis skill, but the detected behavior indicates generic MCP tool invocation, multi-platform capability, and unrelated TikTok/image-processing paths. This mismatch is dangerous because users and policy systems may authorize the skill under a narrow Reddit-only trust model while the underlying implementation can reach broader remote functionality with the provided bearer token.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 62)May include surrounding context.

md
node scripts/run.js --platform reddit --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 123)May include surrounding context.

md
node scripts/run.js --platform reddit --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 126)May include surrounding context.

md
node scripts/run.js --platform reddit --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 127)May include surrounding context.

md
node scripts/run.js --platform reddit --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 138)May include surrounding context.

md
node scripts/run.js --platform reddit --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 142)May include surrounding context.

md
node scripts/run.js --platform reddit --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 149)May include surrounding context.

md
node scripts/run.js --platform reddit --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 156)May include surrounding context.

md
node scripts/run.js --platform reddit --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 163)May include surrounding context.

md
node scripts/run.js --platform reddit --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 170)May include surrounding context.

md
node scripts/run.js --platform reddit --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 177)May include surrounding context.

md
node scripts/run.js --platform reddit --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 184)May include surrounding context.

md
node scripts/run.js --platform reddit --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 191)May include surrounding context.

md
node scripts/run.js --platform reddit --list-tools

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/run.js (reported line 45)May include surrounding context.

js
const __dirname = dirname(fileURLToPath(import.meta.url));
const ROOT = resolve(__dirname, "..");

// ── .env loader ───────────────────────────────────────────────────────────────

(function loadDotenv() {
  const envPath = join(ROOT, ".env");

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/run.js (reported line 106)May include surrounding context.

js
const __dirname = dirname(fileURLToPath(import.meta.url));
const ROOT = resolve(__dirname, "..");

// ── .env loader ───────────────────────────────────────────────────────────────

(function loadDotenv() {
  const envPath = join(ROOT, ".env");

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/run.js (reported line 247)May include surrounding context.

js
const __dirname = dirname(fileURLToPath(import.meta.url));
const ROOT = resolve(__dirname, "..");

// ── .env loader ───────────────────────────────────────────────────────────────

(function loadDotenv() {
  const envPath = join(ROOT, ".env");

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/run.js (reported line 48)May include surrounding context.

js
// ── .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*(.*)$/);

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/run.js (reported line 248)May include surrounding context.

js
// ── .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*(.*)$/);

Credential Access

High
Category
Privilege Escalation
Confidence
86% confidence
Finding

The function is designed to interactively solicit a secret from the user and persist it to a plaintext .env file in the skill directory. In a skill whose stated purpose is Reddit analysis, prompting for and storing credentials locally increases secret-handling risk, especially if the directory is shared, backed up, or accidentally committed.

Content

Scanner excerpt · scripts/run.js (reported line 240)May include surrounding context.

js
// ── MCP client ────────────────────────────────────────────────────────────────

/** Prompt for KEYAPI_TOKEN interactively and persist it to .env */
async function promptToken() {
  if (!process.stdin.isTTY) {
    throw new Error(

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

This line writes the provided KEYAPI_TOKEN directly to a plaintext .env file, creating persistent local exposure of the credential. If the working directory is readable by other users, synchronized to cloud storage, or mistakenly committed, the token can be stolen and abused to access the external API.

Content

Scanner excerpt · scripts/run.js (reported line 262)May include surrounding context.

js
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;

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
85% confidence
Finding

The skill requires a sensitive environment variable (KEYAPI_TOKEN) and clearly instructs users to execute Node-based tooling, but it does not declare an explicit tool scope such as allowed-tools or permissions. That weakens policy boundaries and makes it harder to constrain what the skill may invoke or access, especially given the surrounding references to generic runner scripts and remote MCP access.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill explicitly recommends collecting, profiling, and locally caching Reddit user and community data under a dated cache directory, but it provides no warning, retention guidance, access controls, or privacy considerations. Even though the data is nominally public, aggregating and storing profiles, activity patterns, and community affiliations locally increases privacy risk, persistence, and the chance of secondary misuse or accidental disclosure.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script is a generic MCP runner that can invoke arbitrary KeyAPI tools across multiple platforms, while the skill is described narrowly as Reddit user/subreddit analysis. This expands the effective capability surface beyond the declared purpose, increasing the risk of misuse, unexpected data access, and hidden functionality that a user or reviewer would not reasonably expect from this skill.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill's purpose is to analyze Reddit users and subreddits, but this script includes its own .env parser and interactive token prompt that writes KEYAPI_TOKEN to disk for future reuse. Persisting credentials locally is an operational capability beyond the user-facing analysis purpose and is not declared in the manifest description.

Content

No source excerpt is available for this finding.