Back to skill

Security audit

Memegen

Security checks for vulnerabilities and agentic risk

Overview

This meme-generation skill is mostly on-purpose, but optional scripts and examples introduce unsafe command/code injection paths and raw Reddit credential handling that need review before installation.

Install only if you are comfortable with a meme skill that contacts several third-party services and may write image files locally. Avoid the Reddit OAuth script unless rewritten to avoid raw passwords, and harden or skip the JavaScript and Giphy examples before using them with untrusted input.

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

T09 · Insecure Skill Coding Practices

Error
Location
integrations/generic.md:82
Finding

Shell Command Injection in the JavaScript Meme Generation Example

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/giphy-search.sh:20
Finding

Python Code Injection Through the Giphy Search Query

Content
View full analysis
&2 echo "Get a free beta key at https://developers.giphy.com" >&2 exit 1 fi # URL-encode the query ENCODED_QUERY=$(python3 -c "from urllib.parse import quote; print(quote('${QUERY}'))") ``` ### Technical Analysis The script inserts the command-line `QUERY` value directly into Python source code enclosed by a single-quoted Python string literal. Shell quoting does not make the resulting Python program safe because the expanded query becomes part of the source passed to `python3 -c`. A query containing a single quote and valid Python syntax can terminate the intended string literal, execute additional Python statements, and comment out or otherwise balance the remaining source. The injected Python can import modules such as `os` or `subprocess`, enabling local command execution. The query is expected to be untrusted because it is the script’s primary user-supplied argument. URL encoding must occur after input is passed as data, not by constructing executable source code around that input. ### Attack Path 1. An attacker causes the Skill or an agent to invoke `giphy-search.sh` with a specially crafted search query. 2. The shell expands `${QUERY}` into the argument supplied to `python3 -c`. 3. The crafted query closes the Python string literal and inserts additional Python statements. 4. Python parses the attacker-controlled text as source code. 5. The injected statements execute before the Giphy request. 6. Any spawned commands inherit the script’s operating-system privileges and environment. ### Impact Assessment Successful exploitation allows arbitrary Python and operating-system command execution as the user ...[truncated 520 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
integrations/langchain.md:41
Finding

Unsafe Temporary-File Creation in LangChain Integration Examples

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (497)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill advertises meme generation via memegen.link, but it also instructs use of Imgflip for trending templates and local file creation/workflow support not reflected in the top-level declaration. This kind of description-behavior drift can mislead users and reviewers about what data leaves the environment and what side effects occur.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill advertises meme generation via memegen.link, but it also instructs use of Imgflip for trending templates and local file creation/workflow support not reflected in the top-level declaration. This kind of description-behavior drift can mislead users and reviewers about what data leaves the environment and what side effects occur.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill advertises meme generation via memegen.link, but it also instructs use of Imgflip for trending templates and local file creation/workflow support not reflected in the top-level declaration. This kind of description-behavior drift can mislead users and reviewers about what data leaves the environment and what side effects occur.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill advertises meme generation via memegen.link, but it also instructs use of Imgflip for trending templates and local file creation/workflow support not reflected in the top-level declaration. This kind of description-behavior drift can mislead users and reviewers about what data leaves the environment and what side effects occur.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill advertises meme generation via memegen.link, but it also instructs use of Imgflip for trending templates and local file creation/workflow support not reflected in the top-level declaration. This kind of description-behavior drift can mislead users and reviewers about what data leaves the environment and what side effects occur.

Content

No source excerpt is available for this finding.

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

The skill pipes data fetched with curl directly into python3 -c, which is a risky shell pattern that reduces inspection boundaries and encourages command-line parsing of untrusted remote input. Although this example parses JSON rather than executing returned code, the pattern is unsafe and easy to misuse or extend insecurely.

Content

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

When you want the freshest templates (not just built-in IDs):

bash
curl -s "https://api.imgflip.com/get_memes" | python3 -c "
import sys, json
memes = json.load(sys.stdin)['data']['memes'][:20]
for m in memes:

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The 'Level 5: Nuclear' section explicitly describes maximum-edge content, line-crossing as a punchline, and acknowledges likely platform moderation issues. For a meme-generation skill, this is dangerous because it operationalizes production of borderline abusive or policy-violating content and may steer the agent toward generating harmful material under the guise of humor.

Content

No source excerpt is available for this finding.

Unvalidated Output Injection

High
Category
Output Handling
Confidence
85% confidence
Finding

Model output is used without validation or sanitization. Unvalidated output injected into downstream contexts (SQL, shell, HTML) enables injection attacks and arbitrary code execution.

Content

Scanner excerpt · integrations/generic.md (reported line 69)May include surrounding context.

md
url = f"https://api.memegen.link/images/{template}/{top_enc}/{bottom_enc}.png?width={width}"
    output = "/tmp/meme.png"
    
    subprocess.run(["curl", "-s", "-o", output, url], check=True)
    return output

# Usage

Unvalidated Output Injection

High
Category
Output Handling
Confidence
85% confidence
Finding

The code feeds untrusted, user-influenced URL content to curl and writes the response directly to a local file without validating scheme, destination, response type, or size. Although subprocess.run is used without a shell, this still enables an agent user to trigger arbitrary remote fetches through the memegen service flow and persist attacker-controlled bytes locally, which is more dangerous in a skill advertised as URL-only meme generation.

Content

Scanner excerpt · integrations/langchain.md (reported line 42)May include surrounding context.

md
# Download to temp file
    output = tempfile.mktemp(suffix=".png")
    result = subprocess.run(
        ["curl", "-s", "-o", output, url],
        capture_output=True, text=True
    )

Unvalidated Output Injection

High
Category
Output Handling
Confidence
85% confidence
Finding

The structured variant has the same issue: it fetches user-influenced remote content and stores it locally with no validation of what is returned. In agent environments, persisting untrusted files can enable follow-on abuse, such as disk exhaustion, confusing downstream workflows, or handing attacker-controlled files to other tools.

Content

Scanner excerpt · integrations/langchain.md (reported line 135)May include surrounding context.

md
url += f"&background={bg}"
    
    output = tempfile.mktemp(suffix=".png")
    subprocess.run(["curl", "-s", "-o", output, url], capture_output=True)
    return f"Meme saved to: {output}"

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
80% confidence
Finding

Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.

Content

Scanner excerpt · references/all-templates.json (reported line 4110)May include surrounding context.

json
"blank": "https://api.memegen.link/images/wddth.jpg",
    "example": {
      "text": [
        "when someone calls your phone without warning",
        "We don't do that here."
      ],
      "url": "https://api.memegen.link/images/wddth/when_someone_calls_your_phone_without_warning/We_don't_do_that_here..jpg"

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
70% 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 · references/templates-complete.md (reported line 214)May include surrounding context.

md
- **Pattern**: Escalation
- **Tone**: Frustrated teaching, stubborn misunderstanding
- **Best for**: Teaching someone who keeps getting the wrong answer, coaching frustrations, language learning
- **Example**: "Say git" / "git" / "rebase" / "rebase" / "git rebase" / "git rebase" / "Now do it." / "git push --force"

---

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 · README.md (reported line 113)May include surrounding context.

The Imgflip API returns ~100 popular templates. Not truly "trending" (ranked by all-time popularity), but a good general catalog.

bash
curl -s "https://api.imgflip.com/get_memes" | python3 -c "
import sys, json
memes = json.load(sys.stdin)['data']['memes'][:20]
for m in memes:

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 · references/templates-trending.md (reported line 10)May include surrounding context.

The Imgflip API returns ~100 popular templates. Not truly "trending" (ranked by all-time popularity), but a good general catalog.

bash
curl -s "https://api.imgflip.com/get_memes" | python3 -c "
import sys, json
memes = json.load(sys.stdin)['data']['memes'][:20]
for m in memes:

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest says this skill generates meme images using the memegen.link API and emphasizes URL-based meme production without local image generation. This script instead performs local image manipulation on arbitrary input files using Pillow, adding effects like saturation, JPEG artifacts, emoji overlays, and lens flare, with no memegen.link API usage at all.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The script’s stated behavior—searching Giphy and downloading GIFs—materially diverges from the skill’s declared purpose of generating meme image URLs via memegen.link. This kind of capability drift is dangerous because it introduces undeclared external service usage, extra data flow, and functionality users and reviewers would not reasonably expect from the skill.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The header explicitly advertises GIF search and local download behavior that conflicts with the documented memegen.link meme-generation purpose. Such inconsistencies increase security risk because they conceal real capabilities from operators and make review, consent, and policy enforcement less reliable.

Content

No source excerpt is available for this finding.

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 · scripts/giphy-search.sh (reported line 24)May include surrounding context.

sh
ENCODED_QUERY=$(python3 -c "from urllib.parse import quote; print(quote('${QUERY}'))")

# Fetch top 5 results
RESPONSE=$(curl -s "https://api.giphy.com/v1/gifs/search?api_key=${GIPHY_API_KEY}&q=${ENCODED_QUERY}&limit=5&rating=pg-13")

# Extract and display URLs
echo "$RESPONSE" | python3 -c "

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

Requiring a Reddit username and password for a meme-generation skill is unjustified and materially increases risk by introducing unnecessary credential collection and authenticated third-party access. In this skill context, the capability is more dangerous because the declared purpose does not require any account-level access, making the credential use unexpected and hard to justify.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
87% confidence
Finding

The script is explicitly designed to obtain an OAuth access token using supplied Reddit credentials, which constitutes credential handling and account access capability. In this skill’s context, that capability is unnecessary for simple meme generation and therefore represents an unjustified elevation of sensitivity and abuse potential.

Content

Scanner excerpt · scripts/reddit-trending.sh (reported line 25)May include surrounding context.

sh
fi
done

# Step 1: Get OAuth access token
TOKEN_RESPONSE=$(curl -s -X POST \
  -d "grant_type=password&username=${REDDIT_USERNAME}&password=${REDDIT_PASSWORD}" \
  --user "${REDDIT_CLIENT_ID}:${REDDIT_CLIENT_SECRET}" \

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 · scripts/reddit-trending.sh (reported line 26)May include surrounding context.

sh
done

# Step 1: Get OAuth access token
TOKEN_RESPONSE=$(curl -s -X POST \
  -d "grant_type=password&username=${REDDIT_USERNAME}&password=${REDDIT_PASSWORD}" \
  --user "${REDDIT_CLIENT_ID}:${REDDIT_CLIENT_SECRET}" \
  -H "User-Agent: MemeBot/1.0" \

Credential Access

High
Category
Privilege Escalation
Confidence
83% confidence
Finding

The code parses and stores the returned access token for subsequent authenticated requests, extending the credential-handling chain beyond initial submission. This increases the blast radius of any logging, error handling, or environment leakage issue because a valid bearer token can be replayed to access Reddit resources.

Content

Scanner excerpt · scripts/reddit-trending.sh (reported line 35)May include surrounding context.

sh
ACCESS_TOKEN=$(echo "$TOKEN_RESPONSE" | python3 -c "import sys,json; print(json.load(sys.stdin)['access_token'])" 2>/dev/null)

if [ -z "$ACCESS_TOKEN" ] || [ "$ACCESS_TOKEN" = "null" ]; then
  echo "Error: Failed to get access token. Response: $TOKEN_RESPONSE" >&2
  exit 1
fi

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 · scripts/reddit-trending.sh (reported line 40)May include surrounding context.

sh
fi

# Step 2: Fetch trending templates from r/MemeTemplates
POSTS=$(curl -s \
  -H "Authorization: bearer ${ACCESS_TOKEN}" \
  -H "User-Agent: MemeBot/1.0" \
  "https://oauth.reddit.com/r/MemeTemplates/hot?limit=${LIMIT}")

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest frames this skill as generating meme images using the memegen.link API with no local image generation needed. The README claims support for trending template sources from Imgflip/Reddit/Giphy and an included Pillow renderer for offline generation, which expands behavior beyond the manifest's stated API-based meme URL generation scope.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
89% confidence
Finding

This command sends user-supplied meme text to an external third-party service and writes the returned content to a local file. In an agent setting, that creates a data-exfiltration/privacy risk if prompts or sensitive data are embedded in the meme text without user awareness.

Content

Scanner excerpt · README.md (reported line 35)May include surrounding context.

bash
# Drake meme
curl -s -o meme.png "https://api.memegen.link/images/drake/Writing_docs/Writing_memes.png?width=800"

# Custom background from Imgflip
curl -s -o meme.png "https://api.memegen.link/images/custom/Top/Bottom.png?background=https%3A//i.imgflip.com/30b1gx.jpg&width=800"