T09 · Insecure Skill Coding Practices
- Location
scripts/guanyuan.js:240- Finding
Stored bearer token can be transmitted to an unrelated configured host
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a coherent GuanYuan data export tool, but it stores and sends API secrets in ways that could expose account tokens or credentials.
Review before installing. Do not paste real tokens into shell commands, avoid storing account passwords in config files, restrict ~/.guanyuan permissions, verify baseUrl before every use, and avoid exporting sensitive data into shared, synced, or source-controlled folders. Expect output files to be overwritten.
scripts/guanyuan.js:240Stored bearer token can be transmitted to an unrelated configured host
scripts/guanyuan.js:185Authentication secrets are stored without explicit restrictive filesystem permissions
scripts/guanyuan.js:598Documented token argument exposes bearer tokens through command-line metadata
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.
- **Password Handling**: Passwords are automatically Base64 encoded before API call
- **URL Support**: baseUrl can include protocol prefix (http:// or https://)
- **CSV Escaping**: Special characters (commas, quotes, newlines) are properly escaped
- **File Safety**: Existing files are overwritten without warning
- **Data Limits**: Use `--limit` to control API response size
- **Sampling**: Use `--sample` to export only N rows without fetching all data
- **No Credentials Required**: Can work with just baseUrl + domain + token command
The skill documents code capabilities involving environment access but does not declare any tool scope or permission boundaries. Missing explicit scope increases the chance that an agent or user enables broader access than intended, reducing reviewability and making misuse of local secrets or runtime context easier.
The documentation explicitly allows guanyuan token <token> on the command line without warning that command arguments may be recorded in shell history or exposed via process listings. This can leak long-lived bearer tokens to other local users, monitoring tools, terminal logs, or incident artifacts.
The skill instructs users to store API credentials and tokens in ~/.guanyuan/config.json and ~/.guanyuan/user.token without warning that these are sensitive secrets. Local plaintext secret storage can lead to credential theft from backups, shared accounts, weak filesystem permissions, or accidental disclosure during support and debugging.
The skill states that existing files are overwritten without warning but provides no safeguards or guidance to prevent accidental data loss. In a data-export tool, this is especially risky because exports may destroy existing local files or overwrite prior datasets and metadata without user confirmation.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
export PATH="$PATH:~/workload/skills/guanyuan-data"
sudo ln -sf ~/workload/skills/guanyuan-data/index.js /usr/local/bin/guanyuan
## 配置
The README explicitly instructs users to place a plaintext password in ~/.guanyuan/config.json and states that a token will be auto-saved locally. Storing long-lived credentials and session tokens unencrypted on disk materially increases the risk of credential theft from local compromise, backups, shared accounts, or accidental disclosure.
The documented setup creates persistent local storage for credentials in ~/.guanyuan/config.json, including the account password, which extends the exposure window far beyond a single session. This persistence increases the likelihood that secrets are recovered by malware, local attackers, backups, or accidental disclosure.
创建配置文件 ~/.guanyuan/config.json:
mkdir -p ~/.guanyuan
cat > ~/.guanyuan/config.json << 'EOF'
{
"baseUrl": "https://your-guanyuan-domain.com",
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
## API 参考
- [用户登录 API](https://api.guandata.com/apidoc/docs-site/345092/710/api-3470502)
- [获取卡片数据 API](https://api.guandata.com/apidoc/docs-site/345092/710/api-3471043)
## 技术栈
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
## API 参考
- [用户登录 API](https://api.guandata.com/apidoc/docs-site/345092/710/api-3470502)
- [获取卡片数据 API](https://api.guandata.com/apidoc/docs-site/345092/710/api-3471043)
## 技术栈
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
## API 参考
- [用户登录 API](https://api.guandata.com/apidoc/docs-site/345092/710/api-3470502)
- [获取卡片数据 API](https://api.guandata.com/apidoc/docs-site/345092/710/api-3471043)
## 技术栈
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
## API 参考
- [用户登录 API](https://api.guandata.com/apidoc/docs-site/345092/710/api-3470502)
- [获取卡片数据 API](https://api.guandata.com/apidoc/docs-site/345092/710/api-3471043)
## 技术栈
Nearly all comments, prompts, help text, and status messages are hard-coded in Chinese, with no option for the user to select another language and no justification that the tool is intended only for a Chinese-speaking environment. This is a natural-language locale policy concern because the skill imposes a specific language by default.
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.
}, null, 2));
console.error('');
console.error('创建命令:');
console.error(' mkdir -p ~/.guanyuan');
console.error(' cat > ~/.guanyuan/config.json << \'EOF\'');
console.error(' {');
console.error(' "baseUrl": "https://your-guanyuan-domain.com",');
The script persistently stores authentication tokens in ~/.guanyuan/user.token and may also rely on credentials from ~/.guanyuan/config.json, but it does not warn users that long-lived secrets are being written to local disk. On multi-user systems, shared environments, backups, or endpoint compromise, these files can be recovered and reused to access the Guanyuan API, increasing the blast radius of a local compromise.
The CSV export path writes card data and metadata to disk without an explicit warning that the exported contents may contain sensitive business data, field names, and schema details. Users may inadvertently save regulated or confidential data into insecure locations, source-controlled folders, synced directories, or shared workspaces, causing unintended disclosure.
Natural-language policy issues apply to all file types, and this README appears to require Chinese-language comprehension throughout the skill documentation. There is no indication that the skill is region-specific or that users can opt into another language, which can violate a language-choice policy if organizational standards require neutrality or user choice.
The documentation encourages exporting card data and metadata to local CSV/JSON files but does not warn that these outputs may contain sensitive business or personal data. This can lead users to save data into insecure locations, commit it to repositories, or share it without appropriate handling controls.
No suspicious patterns detected.