Back to skill

Security audit

hipc秘钥设置

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it claims, but it asks for and saves an API secret in a plain local file, so users should review it before use.

Install only if you are comfortable storing your HIPC API secret in plaintext at ~/hipc_config.json. Use a low-privilege or revocable HIPC credential if possible, avoid sharing logs or command history that may contain the secret, and consider rotating the credential after setup in exposed environments.

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
scripts/main.py:9
Finding

HIPC API Secret Exposed Through Command-Line Arguments and Plaintext Storage

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:73; scripts/main.py:9-10, 21-23, 66, 84-96
Vulnerability Type: Plaintext sensitive-data storage and insecure credential input
Risk Level: Medium

The skill accepts an HIPC API secret as a command-line argument and stores it unencrypted in ~/hipc_config.json. The implementation does not explicitly enforce owner-only permissions on that file.

Relevant code from SKILL.md:73:

bash
python scripts/main.py --action={{action}}{{#if secret}} --secret={{secret}}{{/if}}{{#if env}} --env={{env}}{{/if}}

Relevant code from scripts/main.py:9-10:

python
BASE_DIR = os.path.expanduser("~")
CONFIG_FILE = os.path.join(BASE_DIR, "hipc_config.json")

Relevant code from scripts/main.py:21-23:

python
def write_config(data):
    with open(CONFIG_FILE, 'w', encoding='utf-8') as f:
        json.dump(data, f, indent=4, ensure_ascii=False)

Relevant code from scripts/main.py:66:

python
config['hipc_secret'] = secret

Relevant code from scripts/main.py:84-96:

python
parser = argparse.ArgumentParser()
parser.add_argument('--action', type=str, required=True, choices=['check', 'set'])
parser.add_argument('--secret', type=str, required=False)
parser.add_argument('--env', type=str, required=False,default='prod', choices=['dev', 'prod'])

args = parser.parse_args()

if args.action == 'check':
    check_action()
elif args.action == 'set':
    if not args.secret:
        print(json.dumps({"status": "error", "message": "缺少 secret 参数"}))
        sys.exit(1)
    set_action(args.secret,args.env)

Technical Analysis

Secrets supplied through command-line arguments can become visible through process inspection facilities, command histories, orchestration metadata, diagnostic tooling, and process-execution logs. Although operating-system controls may restrict access to process arguments, ...[truncated 1999 chars]

Remediation
View remediation

Remediation Suggestions

  1. Do not accept secrets through command-line arguments. Read the secret from protected standard input using getpass.getpass(), a restricted file descriptor, or an operating-system credential API.
  2. Prefer an OS-managed keychain or secret manager rather than storing the credential in a JSON file.
  3. If file storage is unavoidable, create the file with owner-only permissions such as 0600, and verify its owner and mode before every read and write.
  4. Write configuration atomically by creating a protected temporary file in the same directory, flushing and synchronizing it, setting the correct permissions, and atomically replacing the destination.
  5. Reject symbolic links and unexpected file types when reading or replacing the configuration file.
  6. Separate non-sensitive settings such as the API hostname from the secret so ordinary configuration backups do not automatically contain credentials.
  7. Ensure logs and error reports never include the supplied secret, and advise users to rotate any credential previously passed through exposed command histories or logging systems.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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 (4)

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill normalizes requesting a user-provided API secret through chat and then persisting it locally for later use. This creates a credential-handling anti-pattern: secrets may be exposed in conversation history, tool traces, shell arguments, local files, or downstream logs, increasing the chance of compromise beyond the immediate session.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly directs the agent to persist an API secret in a local file (hipc_config.json) as part of normal operation, but provides no safeguards around encryption, file permissions, redaction, or multi-user workspace exposure. Storing credentials in plaintext local storage can lead to credential theft through logs, backups, shared volumes, other skills, or filesystem access by unintended parties.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script writes a secret value directly to a JSON file in the user's home directory, which persists sensitive credentials on disk without any protection or user warning. If the file is readable by other local users, included in backups, or accidentally committed/shared, the secret can be exposed and used to access the associated HIPC service.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The natural-language instructions and all user-facing examples are exclusively in Chinese, and the document does not indicate that users may interact in other languages or that the locale restriction is intentional and justified. Under SQP-3, forcing a specific language without user opt-in can violate language or locale policy.

Content

No source excerpt is available for this finding.