T09 · Insecure Skill Coding Practices
- Location
auth.mjs:53- Finding
Configurable API endpoint can expose bearer tokens to an untrusted server
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill mostly matches its stated EchoSync trading purpose, but it exposes account tokens and can perform real trading changes with weak safeguards and some under-disclosed behavior.
Review this carefully before installing. Use it only if you are comfortable with an agent that can access EchoSync account data and submit or change Hyperliquid trading actions. Avoid enabling endpoint overrides, do not ask it to print raw tokens unless absolutely necessary, and independently confirm order, leverage, cancellation, and copy-trade settings before allowing commands that affect real funds.
auth.mjs:53Configurable API endpoint can expose bearer tokens to an untrusted server
auth.mjs:269OAuth callback accepts unsolicited bearer tokens without state or session binding
callback.html:131OAuth relay moves bearer tokens from the URL fragment into the query string
auth.mjs:615Copy-trade creation silently submits an excessive maximum order size
auth.mjs:514The me command prints the complete raw user profile beyond its documented scope
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
## Credentials
Tokens are stored under `~/.echosync/credentials.json`. Full behavior and command
reference: `SKILL.md`.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
## Credentials
Tokens are stored under `~/.echosync/credentials.json`. Full behavior and command
reference: `SKILL.md`.
The skill manages a credential file and exposes a subcommand that prints the raw access token to stdout. Even though the document says not to show the full token unless explicitly requested, any skill that can retrieve and emit bearer tokens increases the risk of credential disclosure through logs, transcripts, or misuse by downstream tooling.
| Subcommand | Purpose |
| -------------------------------------------- | -------------------------------------------- |
| `login` | OAuth; writes `~/.echosync/credentials.json` |
| `logout` | Deletes saved credentials |
| `status` | Auth state and token expiry |
| `token` | Raw `access_token` on stdout (scripting) |
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
**Link = the URL from `ECHOSYNC_LOGIN_URL`.** The script does **not** open a browser. This skill must adapt without changing user OpenClaw config.
Telegram output rules:
1. Prefer a single Markdown link line: `[Sign in to EchoSync](url)`.
2. Do **not** add the same URL again as plain text in the same message.
The skill describes a command that can place live market and limit orders but does not require a prominent warning that these actions may execute real trades with real funds. In a trading context, lack of explicit risk disclosure and confirmation materially increases the chance of costly user mistakes.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
const CALLBACK_OK_HTML_PATH = join(SCRIPT_DIR, 'callback-ok.html');
const CALLBACK_ERR_HTML_PATH = join(SCRIPT_DIR, 'callback-error.html');
// ── .env loading (best-effort, no dependencies) ──────────────────────────────
function loadDotenv() {
const envPath = join(SCRIPT_DIR, '.env');
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
// ── .env loading (best-effort, no dependencies) ──────────────────────────────
function loadDotenv() {
const envPath = join(SCRIPT_DIR, '.env');
if (!existsSync(envPath)) return {};
const vars = {};
for (const line of readFileSync(envPath, 'utf8').split('\n')) {
The token command prints the raw OAuth access token directly to stdout with no warning, confirmation, or masking. In a CLI/integration context, stdout is commonly captured by shells, logs, process monitors, or other tools, so this can immediately expose a bearer token that grants account access.
The hl-order command submits live buy/sell orders, which are potentially irreversible financial actions, yet it executes immediately with no confirmation prompt or explicit warning. The help text states that it places an order, but it does not warn about live trading impact or require any extra acknowledgment from the user.
The hl-leverage command changes leverage settings for a wallet and coin, which can materially affect liquidation risk and account behavior. The operation is sent immediately over the network with no confirmation and no explicit risk disclosure beyond a brief usage string.
The skill invokes a local Node.js helper that performs OAuth, reads/writes local credentials, and makes authenticated network requests, but the manifest does not declare an explicit tool scope such as permissions or allowed-tools. That weakens sandboxing and user visibility, making it easier for the skill to access code execution and network capabilities without clear policy boundaries.
Broad trigger phrases like generic login/authentication language can cause the skill to activate during ordinary conversation or when the user meant a different service. In this skill, unintended invocation is more dangerous because activation can start OAuth flows and later enable account-affecting trading operations.
The logout behavior deletes locally saved credentials, but the user-facing description does not clearly warn about that consequence. This is mainly a safety and usability issue: unexpected credential deletion can disrupt access or confuse users, though it is not typically a direct security compromise.
Trading triggers such as 'buy', 'sell', 'long', and 'short' are extremely generic and can collide with normal finance discussion. Because this skill can place real Hyperliquid orders, an accidental routing or invocation could result in unintended live trades and financial loss.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
const PORT_POLL_MS = 50;
const PORT_POLL_ATTEMPTS = 100; // 5s max wait for child to listen
const ETH_ADDR_REGEX = /^0x[a-fA-F0-9]{40}$/;
const HL_INFO_URL = 'https://api.hyperliquid.xyz/info';
const { cmd, args, verbose: VERBOSE } = parseCliArgs(process.argv.slice(2));
// ── Helpers ───────────────────────────────────────────────────────────────────
Verbose mode logs full request URLs plus parsed query/body data for authenticated API calls. While the Authorization header is not printed, request bodies and query parameters can include wallet addresses, trade details, ids, and other sensitive operational data that may be captured in terminal logs, CI output, or shell history.
The hl-cancel command sends a DELETE request to cancel orders immediately, which is a destructive operation affecting the user's trading activity. While the command name implies cancellation, the file lacks any confirmation prompt or stronger warning that it will modify live orders on the connected account.
The module header identifies this script as an "echosync.io OAuth CLI helper", but cmdStatus/cmdToken tell users to run "openclaw login" when authentication is missing or expired. This is an active contradiction in inline/user-facing documentation that can mislead operators about what tool they are using.
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.
"format:check": "prettier --check ."
},
"devDependencies": {
"prettier": "^3.4.2"
}
}