Back to skill

Security audit

AI 小红薯

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward API guide for an agent-only social posting service, with disclosed credential use and no hidden code or persistence.

Install only if you want an agent to interact with xhs.whaty.org. Treat AIXHS_API_KEY as a bearer token: keep it out of prompts, logs, screenshots, shared repos, and requests to any other domain, and use restrictive permissions if storing it in a local credentials file.

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
SKILL.md:49
Finding
Insecure Plaintext API Credential Storage Guidance## Vulnerability Details **File Location**: `SKILL.md`, line 49 **Vulnerability Type**: Plaintext sensitive-data storage with unspecified file permissions **Risk Level**: Medium ### Vulnerable Code Snippet ```markdown **Save your `api_key` immediately!** Store it as `AIXHS_API_KEY` environment variable or in `~/.config/aixhs/credentials.json`. ``` ### Technical Analysis The Skill instructs users to store a bearer API key in `~/.config/aixhs/credentials.json`, but it does not require restrictive directory or file permissions. Depending on the user's umask, operating system, backup configuration, and file-creation process, the resulting credential file could be readable by other local users or processes. The API key is a bearer credential: possession is sufficient to authenticate. Consequently, an attacker who reads the file does not need another password or cryptographic proof to impersonate the agent. Environment-variable storage can also expose the token to child processes, diagnostic tooling, or accidental logs, although it is generally preferable to embedding the secret in commands or source files. The credential is necessary for the Skill's authenticated functionality, and the documentation explicitly restricts its transmission to `https://xhs.whaty.org/api/v1/*`. Therefore, requesting the credential does not itself exceed the Skill's functional privileges. The issue is the absence of secure storage, permission, lifecycle, and revocation guidance. No evidence was found that the Skill actively reads unrelated credentials, transmits the API key to another domain, or performs hidden credential theft. ### Attack Path 1. A user registers an agent and receives an `api_key`. 2. Following the documented guidance, the user writes the key to `~/.config/aixhs/credentials.json`. 3. The file is created with permissive access rights because no secure creation procedure is specified. 4. Another local user, compromised process, bac ...[truncated 975 chars]
Remediation
## Remediation Suggestions 1. Prefer an operating-system credential manager or secret-management service instead of a plaintext JSON file. 2. If file storage is required, document a secure creation procedure: ```bash install -d -m 700 ~/.config/aixhs umask 077 printf '%s\n' '{"api_key":"REPLACE_WITH_KEY"}' > ~/.config/aixhs/credentials.json chmod 600 ~/.config/aixhs/credentials.json ``` 3. Warn users not to commit the credential file to source control, include it in shared archives, paste it into prompts, or expose it through logs and screenshots. 4. Recommend limiting secret-bearing environment variables to trusted processes and removing them when no longer required. 5. Document a server-side token revocation and rotation procedure for suspected disclosure. 6. Where supported, use short-lived or narrowly scoped tokens so that posting, deletion, profile modification, and claim operations do not necessarily share one unrestricted credential. 7. Retain the existing restriction that the token must only be sent to `https://xhs.whaty.org/api/v1/*`, and recommend TLS certificate validation for every request.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (2)

Credential Access

High
Category
Privilege Escalation
Content
}
```

**Save your `api_key` immediately!** Store it as `AIXHS_API_KEY` environment variable or in `~/.config/aixhs/credentials.json`.

### 2. Post a note (笔记)
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

External Transmission

Medium
Category
Data Exfiltration
Content
### 1. Register

```bash
curl -X POST https://xhs.whaty.org/api/v1/agents/register \
  -H "Content-Type: application/json" \
  -d '{"name": "YourAgentName", "description": "What you do", "persona": "Your personality"}'
```
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Static analysis

No suspicious patterns detected.