Back to skill

Security audit

TechSnif — Tech News Intelligence CLI

Security checks for vulnerabilities and agentic risk

Overview

This skill appears to be a read-only tech-news tool, but it needs review because its bundled CLI can be redirected to arbitrary web endpoints instead of only TechSnif.

Install only if you are comfortable with the skill making live network requests for tech-news queries. Avoid using --api-url or TECHSNIF_API_URL unless you intentionally trust the alternate endpoint, because that endpoint can receive your query terms and supply content the agent may summarize.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/techsnif-cli.cjs:3556
Finding
Arbitrary and Insecure API Endpoint Override<![CDATA[ ## Vulnerability Details **File Location**: `scripts/techsnif-cli.cjs`, lines 3556–3584 and 3657–3659 **Vulnerability Type**: Arbitrary outbound requests, plaintext HTTP support, and untrusted content injection **Risk Level**: Medium ### Vulnerable Code ```js var DEFAULT_API_URL = (process.env.TECHSNIF_API_URL || "https://api.techsnif.com").replace(/\/+$/, ""); function getApiUrl(options) { const rawUrl = (options?.apiUrl || DEFAULT_API_URL).trim().replace(/\/+$/, ""); const parsed = new URL(rawUrl); if (parsed.protocol !== "http:" && parsed.protocol !== "https:") { throw new Error(`Unsupported API URL protocol "${parsed.protocol}". Use http:// or https://.`); } return parsed.toString().replace(/\/+$/, ""); } async function fetchJson(path, params, options) { const url = new URL(`${getApiUrl(options)}${path}`); for (const [key, value] of Object.entries(params)) { if (value) url.searchParams.set(key, value); } const response = await fetch(url.toString(), { headers: { Accept: "application/json" } }); ``` The endpoint is also exposed as a command-line option: ```js function addCommonReadOptions(command) { command.option("--json", "Output machine-readable JSON").option("--api-url <url>", "Override the TechSnif API base URL", getDefaultApiUrl()); return command; } ``` ### Technical Analysis The CLI permits the API base URL to be replaced through either the `TECHSNIF_API_URL` environment variable or the `--api-url` command-line option. Validation only checks whether the scheme is HTTP or HTTPS; it does not restrict the destination host, reject private or loopback addresses, or require encrypted transport. Consequently, an attacker who can influence the execution environment or generated CLI arguments can redirect requests to: - An attacker-controlled server that returns forged article data. - A plaintext HTTP endpoint vulnerable to interception and response modification. - Internal, loopback, or link-local ...[truncated 2328 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Pin the production endpoint** Remove the runtime endpoint override and always use the expected HTTPS origin: ```js const DEFAULT_API_URL = "https://api.techsnif.com"; ``` 2. **Require HTTPS** If endpoint overrides are necessary for controlled development or testing, reject plaintext HTTP: ```js if (parsed.protocol !== "https:") { throw new Error("Only HTTPS API endpoints are permitted."); } ``` 3. **Apply an explicit host allowlist** Permit only approved API hostnames and reject alternate ports unless they are specifically required: ```js const ALLOWED_HOSTS = new Set(["api.techsnif.com"]); if (!ALLOWED_HOSTS.has(parsed.hostname) || parsed.port) { throw new Error("Unapproved API endpoint."); } ``` 4. **Block internal destinations** If arbitrary destinations must remain supported, resolve the hostname before connecting and reject loopback, private, link-local, multicast, and reserved IPv4 and IPv6 ranges. Revalidate every redirect destination and defend against DNS rebinding. 5. **Disable automatic cross-origin redirects** Use a restrictive redirect policy or manually validate every redirect before following it. 6. **Separate development configuration** Gate custom API endpoints behind an explicit development mode that is disabled by default and cannot be activated through ordinary Skill-generated arguments. 7. **Treat remote content as untrusted** Ensure downstream Agent prompts clearly delimit article data and state that instructions contained in titles, excerpts, or article bodies must not be followed. 8. **Document network behavior** Update `SKILL.md` to disclose any retained endpoint override, its intended development-only purpose, and the security restrictions applied to it. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (15)

Ae1

High
Category
analysis-evasion
Content
node scripts/techsnif-cli.cjs trending --json
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
node scripts/techsnif-cli.cjs trending --json
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
node scripts/techsnif-cli.cjs trending --json
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
node scripts/techsnif-cli.cjs trending --json
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
node scripts/techsnif-cli.cjs trending --json
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
node scripts/techsnif-cli.cjs trending --json
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
node scripts/techsnif-cli.cjs trending --json
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
node scripts/techsnif-cli.cjs trending --json
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
node scripts/techsnif-cli.cjs trending --json
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
node scripts/techsnif-cli.cjs trending --json
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Memory Manipulation

High
Category
Memory Poisoning
Content
* Parse options from `argv` removing known options,
       * and return argv split into operands and unknown arguments.
       *
       * Side effects: modifies command by storing options. Does not reset state if called again.
       *
       * Examples:
       *
Confidence
80% confidence
Finding
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Lp3

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding
The skill explicitly instructs the agent to run a bundled CLI that reaches a remote API, yet it declares no tool scope or permission boundary for network and environment access. This creates an authorization gap where the agent may invoke code with broader capabilities than the skill metadata communicates, reducing reviewability and increasing the chance of unintended data access or outbound requests.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger description contains very broad, common phrases such as 'AI news', 'tech news', and 'any news about [company/topic]', which can cause the skill to activate in many loosely related conversations. Because the skill then directs the agent to execute a networked CLI, accidental invocation can lead to unnecessary external requests and unintended handling of user-provided query text.

Session Persistence

Medium
Category
Rogue Agent
Content
*/
      subcommandTerm(cmd) {
        const args = cmd.registeredArguments.map((arg) => humanReadableArgName(arg)).join(" ");
        return cmd._name + (cmd._aliases[0] ? "|" + cmd._aliases[0] : "") + (cmd.options.length ? " [options]" : "") + // simplistic check for non-help option
        (args ? " " + args : "");
      }
      /**
Confidence
75% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Missing User Warnings

Low
Confidence
90% confidence
Finding
The CLI sends HTTP requests in fetchJson() and several commands invoke it, but the code provides no confirmation prompt or user-facing notice at the point of transmission. Because this is a code file and the operation transmits user-supplied query parameters and environment-selected endpoint data, it should include some visible disclosure unless covered elsewhere.

Static analysis

Detected: suspicious.dangerous_exec, suspicious.env_credential_access

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/techsnif-cli.cjs:1819

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/techsnif-cli.cjs:3556