Back to skill

Security audit

research-logger

Security checks for vulnerabilities and agentic risk

Overview

The skill appears purpose-aligned for research note logging, but it under-discloses third-party API use and credential handling enough that users should review it before installing.

Install only if you are comfortable sending research topics to Brave and, when enabled, Giphy. Use non-sensitive topics, provide narrowly scoped API keys with quotas, and consider fixing the metadata, credential handling, and temporary-file creation before routine use.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
research_logger.sh:78
Finding

Predictable Shared Temporary File Enables Symlink and Race Attacks

Content
View full analysis
/tmp/research_logger_results.txt 2>/dev/null || true if [[ -s /tmp/research_logger_results.txt ]]; then FINDING1="$(sed -n '1p' /tmp/research_logger_results.txt | head -c 200 || echo 'No result')" FINDING2="$(sed -n '2p' /tmp/research_logger_results.txt | head -c 200 || echo 'No result')" FINDING3="$(sed -n '3p' /tmp/research_logger_results.txt | head -c 200 || echo 'No result')" LINKS="$(sed -n '/^---LINKS---$/,$ p' /tmp/research_logger_results.txt | tail -n +2 || echo '- (none)')" SUMMARY="Research on '$TOPIC' — ${FINDING1:0:100}" fi rm -f /tmp/research_logger_results.txt ``` ### Technical Analysis The script stores API response data in the fixed path `/tmp/research_logger_results.txt`. The file is created through ordinary shell redirection without exclusive creation, randomized naming, ownership validation, restrictive permissions, or locking. Because `/tmp` is normally shared by all local users, another process can predict and manipulate this path before or during execution. This creates several risks: - A symbolic link can redirect the output operation to another file writable by the user running the Skill. - Concurrent executions can overwrite or read each other's search results. - An attacker can replace the file between the write and read operations, causing attacker-controlled content to be inserted into the generated research note. - The process's current `umask` determines file permissions, so search-result data may be exposed to other local users on permissively configured systems. Modern operating-system symlink protections may restrict some cross-user attacks, but they do not eliminate concurrent-run corruption or all same-user attacks. ### Attack Path 1. A local attacker predicts that the Skill will use `/tmp/res ...[truncated 1170 chars]
Remediation
View remediation
"$RESULTS_FILE" if [[ -s "$RESULTS_FILE" ]]; then FINDING1="$(sed -n '1p' "$RESULTS_FILE" | head -c 200 || echo 'No result')" fi ``` Additional hardening measures: 1. Do not reuse a temporary filename across executions. 2. Retain `umask 077` while handling temporary research data. 3. Quote the temporary path on every access. 4. Use the `EXIT` trap so cleanup also occurs after errors or signals. 5. Where practical, avoid a temporary file entirely by parsing the response in one process and returning structured output safely. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
research_logger.sh:61
Finding

API Credentials Are Exposed Through Process Command-Line Arguments

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (6)

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · research_logger.sh (reported line 65)May include surrounding context.

sh
ENCODED_Q="$(TOPIC="$TOPIC" python3 -c 'import os,urllib.parse;print(urllib.parse.quote(os.environ["TOPIC"]))')"

  # Fetch search results and extract findings in one pipeline
  curl -sf \
    -H "Accept: application/json" \
    -H "Accept-Encoding: gzip" \
    -H "X-Subscription-Token: $BRAVE_KEY" \

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · research_logger.sh (reported line 93)May include surrounding context.

sh
LINKS="$(sed -n '/^---LINKS---$/,$ p' /tmp/research_logger_results.txt | tail -n +2 || echo '- (none)')"
    SUMMARY="Research on '$TOPIC' — ${FINDING1:0:100}"
  fi
  rm -f /tmp/research_logger_results.txt
fi

# ── Step 2: GIF Match ──

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · research_logger.sh (reported line 104)May include surrounding context.

sh
GIPHY_KEY="${GIPHY_API_KEY:-}"
if [[ -n "$GIPHY_KEY" ]]; then
  MEDIA_URL="$(curl -sf \
    "https://api.giphy.com/v1/gifs/search?api_key=${GIPHY_KEY}&q=$(TOPIC="$TOPIC" python3 -c "import os,urllib.parse;print(urllib.parse.quote(os.environ['TOPIC']))")&limit=1&rating=g" \
    | python3 -c "
import json, sys

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill advertises capabilities that involve web access, content fetching, GIF discovery, and shell/CLI note creation, but it does not declare an explicit tool scope such as permissions or allowed-tools. This creates an authorization ambiguity where an agent may invoke broader network, shell, or environment-backed tools than a reviewer expects, increasing the chance of unintended external access or side effects like writing notes with untrusted content.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
94% confidence
Finding

The script transmits the user-provided research topic to Brave's external search API along with an API credential. This is an intentional feature, but it is still a real privacy/data-exfiltration risk because potentially sensitive topics are sent off-host to a third party and then incorporated into local notes.

Content

Scanner excerpt · research_logger.sh (reported line 69)May include surrounding context.

sh
-H "Accept: application/json" \
    -H "Accept-Encoding: gzip" \
    -H "X-Subscription-Token: $BRAVE_KEY" \
    "https://api.search.brave.com/res/v1/web/search?q=${ENCODED_Q}&count=5" \
    2>/dev/null | python3 -c "
import json, sys
try:

External Transmission

Medium
Category
Data Exfiltration
Confidence
92% confidence
Finding

The script sends the user topic to Giphy over the network and includes the API key in the request URL. Even though this is expected behavior for GIF lookup, it exposes potentially sensitive research terms to a third party and places the API key in a URL, which can be logged by proxies, browser history equivalents, or monitoring systems.

Content

Scanner excerpt · research_logger.sh (reported line 105)May include surrounding context.

sh
GIPHY_KEY="${GIPHY_API_KEY:-}"
if [[ -n "$GIPHY_KEY" ]]; then
  MEDIA_URL="$(curl -sf \
    "https://api.giphy.com/v1/gifs/search?api_key=${GIPHY_KEY}&q=$(TOPIC="$TOPIC" python3 -c "import os,urllib.parse;print(urllib.parse.quote(os.environ['TOPIC']))")&limit=1&rating=g" \
    | python3 -c "
import json, sys
data = json.load(sys.stdin)