Back to skill

Security audit

Pangolinfo Ai Serp

Security checks for vulnerabilities and agentic risk

Overview

This search skill mostly matches its stated purpose, but it handles Pangolin credentials in a risky persistent plaintext cache.

Install only if you are comfortable giving this skill access to a Pangolin API key or Pangolin account credentials, having search terms sent to Pangolin, and having a reusable API key stored in plaintext at ~/.pangolin_api_key. Prefer creating a restricted API key, avoid sending raw passwords through the agent chat, remove the cache file when done, and rotate the key if it may have appeared in logs.

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

Warning
Location
scripts/pangolin.py:94
Finding

Permanent API Key Is Written Before Secure Permissions Are Applied

Content
View full analysis
Remediation
View remediation
= 0: os.close(fd) ``` For stronger replacement semantics, create a mode-`0600` temporary file in a private directory, validate the destination, and use `os.replace()`. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
scripts/pangolin.py:485
Finding

Authentication Check Discloses Part of a Permanent API Key

Content
View full analysis
12 else "***" ), }, indent=2)) sys.exit(EXIT_SUCCESS) ``` ### Technical Analysis The `--auth-only` operation prints the first eight and last four characters of the API key to standard output. This contradicts the Skill instruction at `SKILL.md:351`, which states that API keys must not be echoed in output or logs. Although the complete key is not disclosed, the output reveals stable credential material. Standard output is commonly retained by CI systems, shell transcripts, agent tool logs, and monitoring platforms. The disclosed prefix and suffix can facilitate credential correlation, identification of reused tokens, or confirmation that a separately obtained candidate token belongs to the account. ### Attack Path 1. A user, automation process, or `scripts/self_test.sh` invokes `pangolin.py --auth-only`. 2. The script prints 12 characters from the permanent API key to standard output. 3. A CI system, agent transcript, terminal recorder, or logging wrapper stores the output. 4. A party with access to those logs retrieves the stable token fragment. 5. The fragment is used to correlate credential exposures or validate candidate keys obtained from another source. The disclosed fragment alone is not shown to be sufficient to authenticate, so direct account takeover from this finding alone is not established. ### Impact Assessment The issue leaks persistent credential metadata into potentially broad logging environments. It weakens secret confidentiality and can compound another partial credential disclosure. It does ...[truncated 83 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:94
Finding

Credential Setup Instructions Embed the Full API Key in a Shell Command

Content
View full analysis
" > ~/.pangolin_api_key chmod 600 ~/.pangolin_api_key 2>/dev/null python3 scripts/pangolin.py --auth-only ``` ### Technical Analysis The setup procedure instructs the AI agent to substitute the user's complete API key directly into a shell command. Even if the interactive shell does not save the command in history, the full command can still be retained in the agent conversation, tool-call records, terminal auditing, execution telemetry, or wrapper logs. The command also creates or truncates the cache file before applying mode `0600`, reproducing the insecure file-creation issue in the Python implementation. Redirection follows symbolic links and initial permissions depend on the shell's umask. The instruction's claim that this approach securely avoids shell history is incomplete because it does not address the other channels through which an agent-generated command may be recorded. ### Attack Path 1. The user gives the permanent Pangolin API key to the agent as directed by the Skill. 2. The agent substitutes the full secret into the documented `echo` command. 3. The command text is retained in the conversation, tool invocation record, audit log, terminal telemetry, or execution wrapper. 4. A party with access to one of those records obtains the complete key. 5. The party authenticates to Pangolin with the victim's key and performs requests that consume the victim's credits. Alternatively, a local attacker who can manipulate the cache path can pre-place a symbolic link before the redirection, causing the key to be written to the linked target. ### Impact Assessment This issue can expose the complete, permanent Pangolin API key to logging and observability systems that have access to agent or command records. Successful exploit ...[truncated 186 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (20)

Tainted flow: 'req' from os.environ.get (line 257, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

The code sends email and password from environment variables to a remote authentication endpoint over the network. This is expected functionality for login, so it is not inherently malicious, but it is still a real credential-exposure surface because the script transmits secrets to a third-party service and offers no trust prompt, endpoint pinning, or explicit disclosure beyond code/comments.

Content

Scanner excerpt · scripts/pangolin.py (reported line 127)May include surrounding context.

python
method="POST",
    )
    try:
        with urllib.request.urlopen(req, timeout=30) as resp:
            result = json.loads(resp.read())
    except urllib.error.URLError as e:
        # Improvement 1: macOS SSL certificate handling

Tainted flow: 'req' from os.environ.get (line 257, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/pangolin.py (reported line 263)May include surrounding context.

python
headers=headers,
                method="POST",
            )
            with urllib.request.urlopen(req, timeout=timeout) as resp:
                return json.loads(resp.read())
        except urllib.error.HTTPError as e:
            error_body = e.read().decode() if e.fp else ""

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The instructions explicitly direct the agent to collect credentials from the user and persist them for future use by caching an API key in the user's home directory. Persisting secrets in this way expands the blast radius of compromise, can outlive user intent, and may expose credentials to other local processes, backups, or later unintended agent actions.

Content

No source excerpt is available for this finding.

Direct flow: os.environ.get (credential/environment) → subprocess.run (code execution)

High
Category
Data Flow
Confidence
80% confidence
Finding

Data flows directly from a source (env vars, files, network) to a sink (network output, exec, file write) without intermediate validation.

Content

Scanner excerpt · scripts/pangolin.py (reported line 105)May include surrounding context.

python
if sys.platform == "win32":
        try:
            import subprocess
            subprocess.run(
                ["icacls", str(API_KEY_CACHE_PATH), "/inheritance:r",
                 "/grant:r", f"{os.environ.get('USERNAME', '')}:F"],
                capture_output=True, check=False,

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill clearly instructs the agent to use sensitive capabilities including environment access, file reads/writes, network calls, and shell execution, but it does not declare any explicit tool scope or permission boundaries. That increases the risk of overbroad execution and makes credential handling and filesystem persistence occur without clear platform-level guardrails or user visibility.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
86% confidence
Finding

The skill is designed around session persistence by obtaining credentials once and reusing a cached API key across future invocations. In context, this persistence is more dangerous because it is tied to secret material stored locally and is framed as automatic, reducing user awareness and increasing long-term exposure if the host or account is compromised.

Content

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

md
### Step 2: Guide registration

> 1. Go to [pangolinfo.com](https://www.pangolinfo.com) and create an account
> 2. After login, find your API Key in the dashboard
>
> 1. 访问 [pangolinfo.com](https://www.pangolinfo.com) 注册账号

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill tells the agent to collect API keys or email/password from the user and then configure them locally, including writing the API key to ~/.pangolin_api_key for future use. Even though it mentions avoiding shell history, it does not require an explicit consent prompt that informs the user their credentials will be stored on disk and reused later, which creates a meaningful secret-handling risk.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

Write it directly to the cache file — avoids shell history entirely:

bash
echo "<api_key>" > ~/.pangolin_api_key
chmod 600 ~/.pangolin_api_key 2>/dev/null
python3 scripts/pangolin.py --auth-only

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
### Important

- **The user only needs to provide credentials ONCE** — the script caches the API key permanently at `~/.pangolin_api_key`
- Do not ask the user to manually edit `.bashrc` or `.zshrc` — the script handles persistence automatically
- If the user doesn't have an account yet, explain Pangolin's credit system (2 credits per AI Mode search, 0.5 credits per SERP search) and direct them to [pangolinfo.com](https://www.pangolinfo.com)
- If auth succeeds but credits are exhausted (error code `2001`), tell the user to top up at pangolinfo.com
- API key is permanent and does not expire unless the account is deactivated

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

This markdown file describes that the script automatically re-authenticates with email/password and later instructs users to set PANGOLIN_EMAIL and PANGOLIN_PASSWORD. Because credentials and cached tokens are sensitive, the documentation should explicitly warn users about secure handling and storage implications.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Documenting token caching at ~/.pangolin_token without any warning about file permissions or local secret exposure normalizes insecure secret storage. In an agent skill context, long-lived tokens cached on disk can be read by other local users, copied from developer environments, or unintentionally included in backups, increasing risk of account compromise.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This section shows credentials being sent to a remote authentication endpoint, which is a privacy- and security-relevant behavior. The documentation should explicitly disclose that user credentials are transmitted for login and advise secure handling.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Telling users to export PANGOLIN_EMAIL and PANGOLIN_PASSWORD without any warning can lead to sensitive credentials being retained in shell history, inherited by subprocesses, exposed in debugging output, or mishandled in shared environments. In a skill intended for automated agent use, this is more dangerous because agents often run in multi-tool, logged, or containerized environments where environment variables are broadly accessible.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/pangolin.py (reported line 105)May include surrounding context.

python
if sys.platform == "win32":
        try:
            import subprocess
            subprocess.run(
                ["icacls", str(API_KEY_CACHE_PATH), "/inheritance:r",
                 "/grant:r", f"{os.environ.get('USERNAME', '')}:F"],
                capture_output=True, check=False,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The script collects account credentials from environment variables and posts them to the remote auth endpoint without a user-facing warning in the CLI flow. Although this supports expected authentication, the lack of explicit disclosure is risky in an agent-skill context because users may not realize passwords are being transmitted rather than only local API-key use.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

When an API key is provided via environment variable, the script silently writes it to a local cache file for future reuse. Persisting sensitive tokens without explicit user notice or consent is dangerous because users may assume environment-scoped secrets remain ephemeral, while the tool leaves a recoverable artifact on disk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The reference documents how to submit arbitrary Google search URLs to Pangolin's external scraping API but does not warn that user-provided queries will be transmitted to a third-party service. This can lead developers to unintentionally send sensitive prompts, identifiers, or internal research terms off-platform, creating privacy and data-handling risk even though it is not direct code execution or credential compromise.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documentation states that tokens are permanent and do not expire on their own, but then says error code 1004 means the token needs to be refreshed. Those statements are in tension because an 'invalid or expired token' condition implies expiration or invalidation beyond simple account deactivation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill persists the API key to ~/.pangolin_api_key, which expands the lifetime and local exposure of authentication material beyond the immediate session. Even with best-effort permission tightening, undisclosed secret persistence increases risk from local compromise, shared accounts, backups, or other software reading the file.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The manifest presents a search and screenshot skill, but on Windows the implementation imports subprocess and executes icacls to change file permissions on the cached API key file. Spawning an OS command is a broader host-interaction capability than the stated search behavior and is not mentioned in the manifest.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.