T09 · Insecure Skill Coding Practices
- Location
SKILL.md:103- Finding
Reusable Exchange Credentials Are Logged and Transmitted to a Third-Party Service
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 103-123
Vulnerability Type: Sensitive credential disclosure and unnecessary remote credential custody
Risk Level: HighVulnerable Code
python key=private_key, chain_id=137, ) creds = polymarket.create_or_derive_api_creds() wallet = polymarket.get_address() print(f"Wallet: {wallet}") print(f"CLOB API Key: {creds.api_key}") # 2. Register with AION Market check = client.check_wallet_credentials(wallet) if not check["hasCredentials"]: client.register_wallet_credentials( wallet_address=wallet, api_key=creds.api_key, api_secret=creds.api_secret, api_passphrase=creds.api_passphrase, ) print(f"Wallet credentials registered for {wallet}") else: print(f"Wallet {wallet} already configured.")Technical Analysis
The documented workflow derives reusable Polymarket CLOB credentials from a wallet private key and then handles them in two unsafe ways:
- It prints the CLOB API key to standard output, where it may be retained in terminal history, CI logs, managed-agent logs, monitoring systems, or support diagnostics.
- It sends the API key, API secret, and API passphrase to AION through
register_wallet_credentials().
Although remote credential registration may facilitate delegated trading, retaining reusable exchange credentials is broader than the minimum privilege required to evaluate a divergence signal or submit an individually signed order. A least-privilege design would keep the private key and derived credentials local and transmit only a narrowly scoped, locally signed order.
The documentation states that registered credentials are stored encrypted, but the project does not provide implementation evidence for encryption at rest, key management, retention, deletion, endpoint identity, certificate pinning, or credential-access controls. The project also does not ...[truncated 1654 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove all output statements that print API keys, secrets, passphrases, private keys, signed transactions, or authorization headers.
- Keep wallet private keys and derived exchange credentials local to the wallet boundary.
- Prefer locally signing each narrowly scoped order and transmitting only the signed order required for that transaction.
- If remote credential custody is operationally unavoidable:
- Obtain explicit, informed operator consent before registration.
- Clearly identify the receiving service and explain the credential permissions.
- Use revocable, least-privilege, short-lived credentials where supported.
- Verify TLS and service identity and prevent credentials from entering request logs.
- Encrypt credentials at rest with a dedicated key-management service.
- Restrict decryption to the smallest possible execution component.
- Define retention, deletion, rotation, incident-response, and audit procedures.
- Redact secrets from exceptions and structured SDK responses before printing them.
- Document a credential revocation procedure and rotate any credentials previously disclosed through logs.
