Back to skill

Security audit

whoami

Security checks for vulnerabilities and agentic risk

Overview

This identity-profile skill has a coherent purpose, but it needs Review because it broadly persists and reuses personal data and has unsafe endpoint, credential, and file-handling behavior.

Install only if you are comfortable with a remote service storing a concise personal profile and making it available to AI tools. Before use, verify the configured endpoint, avoid putting secrets or sensitive personal data in the profile, do not paste long-lived API keys into chat or command-line arguments, and avoid using update --file with any path except a disposable temp file you intended to delete.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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 (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/whoami_profile.py:45
Finding

Unvalidated endpoint override exposes API credentials and personal profile data

Content
View full analysis
str: # 优先使用环境变量(开发测试用),其次配置文件,最后硬编码默认值 env_endpoint = os.environ.get("WHOAMI_ENDPOINT") if env_endpoint: return env_endpoint.rstrip("/") config = _load_config() return config.get("WHOAMI_ENDPOINT", DEFAULT_ENDPOINT) ``` ```python endpoint = _get_endpoint() url = f"{endpoint}/api{path}" headers = { "Authorization": f"Bearer {api_key}", "Content-Type": "application/json", } data = None if body is not None: data = json.dumps(body).encode("utf-8") req = Request(url, data=data, headers=headers, method=method) ``` ### Technical Analysis The destination for authenticated API requests can be overridden using either the `WHOAMI_ENDPOINT` environment variable or the `WHOAMI_ENDPOINT` entry in `~/.whoamiagent`. The value is used without validating its scheme, hostname, port, or relationship to the legitimate service. Every API request includes the user's bearer credential in the `Authorization` header. Profile updates also include the complete personal profile in the request body. Consequently, control over the process environment or configuration file is sufficient to redirect both credentials and sensitive profile data to an attacker-controlled server. The network transfer itself is part of the declared remote-profile functionality. The vulnerability is that sensitive requests are not restricted to the service for which the credentials were issued. ### Attack Path 1. An attacker or compromised local process sets `WHOAMI_ENDPOINT` to an attacker-controlled URL, or inserts that value into `~/.whoamiagent`. 2. The user or AI agent invokes `get`, `info`, or `update`. 3. `_get_endpoint()` returns the attacker-controlled dest ...[truncated 989 chars]
Remediation
View remediation

T01 · Skill Instruction Hijacking

Error
Location
scripts/whoami_profile.py:139
Finding

Untrusted remote profile is injected verbatim into agent context

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/whoami_profile.py:212
Finding

Arbitrary file upload and deletion through the update --file option

Content
View full analysis
= 2 and args[0] == "--file": file_path = Path(args[1]) if not file_path.exists(): print(f"[whoami] Error: File not found: {file_path}") sys.exit(1) content = file_path.read_text(encoding="utf-8").strip() # Auto-remove the temp file after reading try: file_path.unlink() print(f"[whoami] Temp file removed: {file_path}") except OSError: pass if not content: ``` ### Technical Analysis Although the option is documented as a mechanism for reading a temporary profile file, the implementation accepts any supplied filesystem path. It does not verify that the path is located in a designated temporary directory, that the file was created for this operation, that it is a regular file, or that it is not a symbolic link. The script reads the selected file and then calls `unlink()` before validating whether the content is nonempty and before confirming that the network update succeeds. The returned content is subsequently sent to the remote profile API. This creates two linked capabilities: 1. Any text file readable by the invoking user can be uploaded to the remote service. 2. Any selected file removable by that user can be deleted. Deleting the input is not required for the core remote-profile functionality and exceeds the minimum privilege needed to read profile content. ### Attack Path 1. An attacker manipulates instructions or arguments supplied to the agent so that it invokes: `python3 scripts/whoami_profile.py update --file `. 2. The script resolves the attacker-selected path without restricting its location or file type. 3. `read_text()` reads the file using ...[truncated 1079 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/whoami_profile.py:90
Finding

API key is exposed through command-line arguments

Content
View full analysis
/scripts/whoami_profile.py setup ") print(f"[whoami] Config file path: {CONFIG_PATH}") sys.exit(0) ``` ```python if len(sys.argv) > 2: api_key = sys.argv[2] else: ``` ### Technical Analysis The setup workflow instructs the AI agent to receive the user's API key and pass it as a positional command-line argument. Command-line arguments are not an appropriate secret-transport mechanism because they can be recorded in shell history, process-execution logs, AI tool traces, audit telemetry, terminal transcripts, and crash reports. Depending on the operating system and process isolation, arguments may also be visible to other local processes while the command is running. This implementation also conflicts with the documentation in `SKILL.md`, which states that the agent should use a one-time configuration URL and “never handles API Key directly.” The script instead tells the user to paste the raw key into the conversation and directs the agent to place it in `sys.argv`. ### Attack Path 1. The user invokes a command without an existing API-key configuration. 2. The script dire ...[truncated 1009 chars]
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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
Findings (19)

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger description says to invoke the skill whenever user background, preferences, or personal context might help execute a task, which is extremely broad. This encourages routine invocation on ordinary conversations and can cause unnecessary collection, transmission, and reuse of personal data.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill advertises cross-AI identity sharing and remote profile storage, but does not present a clear warning that personal data will be transmitted to and reused across external tools. Users may unknowingly expose sensitive personal context beyond the current conversation.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill declares broad operational behavior involving shell, network, file read/write, and environment access, but does not define any explicit tool scope or permission boundaries. This increases the chance an agent will execute sensitive actions implicitly, including fetching remote credentials, writing config files, and reusing profile data without clear containment.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill instructs agents to inject a remotely stored identity profile directly into conversation context and use it across AI tools. This is a natural-language data exposure pattern because broad personal context can be propagated into later prompts, logs, outputs, or downstream tools without granular controls.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill explicitly instructs the agent to load remote personal profile data and then continue performing the user's downstream task using that data as context. This creates a privacy and scope-expansion risk because sensitive identity information can influence unrelated tasks without fresh consent or minimization.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
89% confidence
Finding

The skill is explicitly designed for persistent remote storage and later reuse of identity/profile data across sessions and AI tools. This persistence increases exposure if the profile contains sensitive information, is over-broadly retrieved, or is accessed without clear consent boundaries.

Content

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

md
│   └─ NO  → Script auto-opens browser login page → Agent tells user to log in and get one-time URL → **Agent STOPS and WAITS for user to provide one-time URL** → Agent downloads and saves to ~/.whoamiagent
    │
    ├─ User requests to update info?
    │   └─ YES → Organize into Markdown → Write to temp file → Run `update --file` to write to remote → Confirm success
    │
    └─ User asks "do you know me?"
        └─ Run `get` → Display profile summary

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 44)May include surrounding context.

bash
curl -s "https://whoamiagent.com/api/storeapi?token=<token>" > ~/.whoamiagent
chmod 600 ~/.whoamiagent

Config file is saved at ~/.whoamiagent with the necessary credentials securely configured.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The instruction to use the loaded profile as context for continuing the user's task encourages broad secondary use of personal data. In practice, this can leak unnecessary preferences, identity details, or history into unrelated responses and downstream processing.

Content

No source excerpt is available for this finding.

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 75)May include surrounding context.

python3 /scripts/whoami_profile.py update --file /tmp/whoami_profile_tmp.md

text

The script reads the file content, uploads it, and **automatically deletes the temp file** after reading.

Alternative (for short content only):

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The example normalizes automatic profile loading at conversation start, even for a generic coding task. In context, this makes unnecessary access to remotely stored identity data more likely and increases silent personalization and privacy leakage risks.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The example encourages persisting user-provided personal background information to a remote profile for later reuse. Without strong consent, classification, and retention controls, this creates durable privacy risk and potential over-collection of sensitive personal data.

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 128)May include surrounding context.

md
2. If API Key is not configured, the script auto-opens the browser login page. Agent **MUST**:
   - Tell the user: "I've opened the login page in your browser. Please log in and generate a one-time configuration URL on the Dashboard."
   - **STOP here and wait for the user to reply with the one-time configuration URL.**
   - Download the URL and save to `~/.whoamiagent`: `curl -s "<provided-url>" > ~/.whoamiagent && chmod 600 ~/.whoamiagent`
   - Then run `whoami_profile.py get` again to fetch the profile
3. If already configured, display profile summary

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% 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.

Content

Scanner excerpt · references/profile_format.md (reported line 39)May include surrounding context.

md
- Not all fields are required; users can fill in only the parts they consider important
- Content should be concise, max 5000 characters (~2000 Chinese characters or ~2000 English words)
- AI should auto-organize content into a reasonable Markdown structure when saving
- The update command is an overwrite operation; always pass complete content
- Remote automatically retains the last 3 historical versions; mistakes can be rolled back via API

## API Authentication

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script allows WHOAMI_ENDPOINT and WHOAMI_FRONTEND_URL to fully override the remote API and login destinations. In an agent context, this can redirect profile contents and bearer tokens to attacker-controlled infrastructure, turning a profile sync tool into a credential and data exfiltration path.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest describes a skill for loading and saving a user's identity profile so an agent can use that context in later tasks. Opening a browser to an external login page is an additional interactive capability outside simple profile retrieval/update, and the manifest does not disclose this behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

When invoked with --file, the script deletes the supplied file after reading it, even though the skill is described as loading/saving a remote profile rather than modifying local files. In an agent setting, this can destroy user data unexpectedly if a non-temporary path is provided, causing integrity and availability loss.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file deletion occurs silently after read, without explicit user consent at the time of action or a clear upfront warning in the interface. For an agent-operated tool, users may not realize a local file will be removed, making accidental destructive behavior more likely and increasing the risk of data loss.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The first-time setup flow goes beyond simple profile sync by initiating browser-based login and credential bootstrap steps. That expands the trust boundary and can lead agents to facilitate secret acquisition and persistent configuration changes on the user's system.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The file contains user-facing descriptions primarily in Chinese, while later operational prompts are in English, and there is no indication that the user can choose their preferred language. This can violate a language/locale policy when a skill imposes language assumptions without opt-in.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.exposed_secret_literal

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/profile_format.md:46