Back to skill

Security audit

Zerodha

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed Zerodha CLI command router, but it gives unsafe install commands and handles trading credentials in a way users should review carefully.

Before installing, review the installer source and prefer a pinned release with checksum or signature verification instead of piping GitHub content directly into a shell. Do not paste Zerodha API secrets into ordinary chat or run commands that expose secrets in shell history; use a safer credential prompt or rotate credentials if they were exposed. Treat generated order, cancel, exit, revoke, delete, and SIP/MF commands as live financial actions and confirm them manually before running.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:20
Finding
Unpinned Remote Installer Downloaded and Executed Without Verification<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:20-23` and `SKILL.md:343-344` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: Critical ### Vulnerable Code ```text - Linux/macOS (`curl`): `curl -fsSL https://raw.githubusercontent.com/jatinbansal1998/zerodha-kite-cli/main/scripts/install.sh | sh` - Linux/macOS (`wget`): `wget -qO- https://raw.githubusercontent.com/jatinbansal1998/zerodha-kite-cli/main/scripts/install.sh | sh` - Windows PowerShell: `irm https://raw.githubusercontent.com/jatinbansal1998/zerodha-kite-cli/main/scripts/install.ps1 | iex` - Windows CMD: `powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://raw.githubusercontent.com/jatinbansal1998/zerodha-kite-cli/main/scripts/install.ps1 | iex"` ``` The unsafe installation commands are repeated in the intent defaults: ```text - If user asks generic "install zerodha cli": - Linux/macOS: `curl -fsSL https://raw.githubusercontent.com/jatinbansal1998/zerodha-kite-cli/main/scripts/install.sh | sh` - Windows: `irm https://raw.githubusercontent.com/jatinbansal1998/zerodha-kite-cli/main/scripts/install.ps1 | iex` ``` ### Technical Analysis The Skill instructs the Agent to download installation scripts from a personal GitHub repository and immediately execute them through `sh` or PowerShell `Invoke-Expression`. The URLs reference the mutable `main` branch rather than an immutable commit or signed release. There is no checksum verification, digital-signature validation, content inspection, or version pinning. Consequently, the code ultimately executed is not the code reviewed in this project. It can change whenever the remote repository changes. The Windows CMD variant additionally uses `-ExecutionPolicy Bypass`, deliberately disabling a local PowerShell execution safeguard for that process. Installing the underlying CLI is related to the Skill's bootstrap function. However, executing an unverified network response directly in a shell is n ...[truncated 1543 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove all `curl | sh`, `wget | sh`, `irm | iex`, and `ExecutionPolicy Bypass` instructions. 2. Prefer a trusted operating-system package manager or an official, signed release channel. 3. Pin downloads to an immutable release version or commit rather than the mutable `main` branch. 4. Download the installer to a local file without executing it: - Inspect the file before execution. - Verify its expected origin. - Reject redirects to unexpected domains. 5. Publish and verify a SHA-256 checksum over the installer. Prefer a cryptographic signature whose verification key is distributed through a separate trusted channel. 6. Run the installer with ordinary user privileges unless a documented step strictly requires elevation. 7. Display the exact version, source URL, expected checksum, and verification procedure to the user. 8. Where possible, vendor reviewed installation logic in the audited package instead of retrieving mutable executable content at runtime. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:68
Finding
API Secrets Exposed Through Generated Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:68-71` and `SKILL.md:88-93` **Vulnerability Type**: Plaintext sensitive data in command-line arguments and Agent output **Risk Level**: High ### Vulnerable Code ```text 4. If `api_key` + `api_secret` are available and profile setup is needed, emit: `zerodha config profile add <profile_name> --api-key <key> --api-secret <secret> --set-active` 5. If user explicitly wants to update only one credential on an existing profile, emit: - `zerodha config profile set-api-key <profile_name> --api-key <key>` - `zerodha config profile set-api-secret <profile_name> --api-secret <secret>` ``` The command catalog reinforces the same behavior: ```text - `zerodha config profile add <name> --api-key <key> --api-secret <secret> [--set-active]` - Constraints: `<name>` required; `--api-key` and `--api-secret` required. - `zerodha config profile set-api-key <name> --api-key <key>` - Constraints: `<name>`, `--api-key` required. - `zerodha config profile set-api-secret <name> --api-secret <secret>` - Constraints: `<name>`, `--api-secret` required. ``` ### Technical Analysis The login procedure instructs the Agent to collect API credentials across messages, retain them during the login task, and interpolate them into an exact runnable command. This places the API secret in both the conversational response and the operating-system command line. Secrets provided this way may be retained in chat history, Agent telemetry, terminal scrollback, shell history, process-monitoring output, audit logs, clipboard history, or command-recording systems. Depending on the operating system and process configuration, command-line arguments may also be observable by other local processes or users while the command runs. Although configuring credentials is necessary for authentication, reproducing secret values in an Agent-generated command is not the minimum safe mechanism. An interactive hidden prompt, standard input, o ...[truncated 1541 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not ask users to provide API secrets in ordinary chat messages. 2. Do not interpolate secrets into generated command strings or return them in the Skill's `command` field. 3. Modify or use the CLI so secrets are collected through an interactive hidden prompt. 4. Alternatively, accept secrets through standard input, an operating-system credential manager, or a protected secret-file descriptor that does not expose them in process arguments. 5. Explicitly redact credentials from Agent output, debug logs, telemetry, errors, and command previews. 6. Avoid retaining credential values in multi-message Agent state; retain only whether each required credential has been securely configured. 7. Ensure any local credential store uses restrictive file permissions and operating-system-backed encryption where available. 8. Provide credential-rotation and revocation instructions in case a secret has already been pasted into a conversation or command line. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (9)

Credential Access

High
Category
Privilege Escalation
Content
- If no profile is selected, use:
     `zerodha config profile use <name>`
5. Auth/session:
   - API data/order commands require an access token.
   - If missing, run `zerodha auth login ...`.
   - CLI auto-refreshes access token when refresh token exists.
6. Never guess missing required fields for write actions; ask for the missing values.
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
- If no profile is selected, use:
     `zerodha config profile use <name>`
5. Auth/session:
   - API data/order commands require an access token.
   - If missing, run `zerodha auth login ...`.
   - CLI auto-refreshes access token when refresh token exists.
6. Never guess missing required fields for write actions; ask for the missing values.
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
- If no profile is selected, use:
     `zerodha config profile use <name>`
5. Auth/session:
   - API data/order commands require an access token.
   - If missing, run `zerodha auth login ...`.
   - CLI auto-refreshes access token when refresh token exists.
6. Never guess missing required fields for write actions; ask for the missing values.
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The skill explicitly instructs downstream agents to install the CLI by piping remote scripts from GitHub directly into a shell (`sh`/`iex`). This creates a supply-chain and arbitrary code execution risk because any compromise of the repository, network path, or referenced script causes immediate code execution on the user's machine without verification or warning.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The login flow directs users to pass sensitive values such as `api_key`, `api_secret`, and request tokens on the command line. Secrets supplied as CLI arguments can be exposed through shell history, process listings, terminal logging, or agent telemetry, increasing the chance of credential leakage.

Missing User Warnings

Medium
Confidence
86% confidence
Finding
The skill description includes irreversible or impactful operations such as removing profiles, logging out, revoking refresh tokens, cancelling orders, exiting orders, and deleting GTT triggers. The markdown does not warn users that these actions can disrupt access or trading state, despite affecting account and order integrity.

External Script Fetching

Low
Category
Supply Chain
Content
Install commands:

- Linux/macOS (`curl`): `curl -fsSL https://raw.githubusercontent.com/jatinbansal1998/zerodha-kite-cli/main/scripts/install.sh | sh`
- Linux/macOS (`wget`): `wget -qO- https://raw.githubusercontent.com/jatinbansal1998/zerodha-kite-cli/main/scripts/install.sh | sh`
- Windows PowerShell: `irm https://raw.githubusercontent.com/jatinbansal1998/zerodha-kite-cli/main/scripts/install.ps1 | iex`
- Windows CMD: `powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://raw.githubusercontent.com/jatinbansal1998/zerodha-kite-cli/main/scripts/install.ps1 | iex"`
Confidence
98% confidence
Finding
The command `curl ... | sh` fetches a script from an external source and immediately executes it. This is dangerous because it trusts remote content at runtime without integrity verification, allowing arbitrary code execution if the source is tampered with.

External Script Fetching

Low
Category
Supply Chain
Content
Install commands:

- Linux/macOS (`curl`): `curl -fsSL https://raw.githubusercontent.com/jatinbansal1998/zerodha-kite-cli/main/scripts/install.sh | sh`
- Linux/macOS (`wget`): `wget -qO- https://raw.githubusercontent.com/jatinbansal1998/zerodha-kite-cli/main/scripts/install.sh | sh`
- Windows PowerShell: `irm https://raw.githubusercontent.com/jatinbansal1998/zerodha-kite-cli/main/scripts/install.ps1 | iex`
- Windows CMD: `powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://raw.githubusercontent.com/jatinbansal1998/zerodha-kite-cli/main/scripts/install.ps1 | iex"`
Confidence
98% confidence
Finding
The `wget -qO- ... | sh` pattern has the same arbitrary code execution and supply-chain exposure as `curl | sh`. It silently downloads remote content and pipes it to a shell without validation, making compromise of the upstream source immediately impactful.

External Script Fetching

Low
Category
Supply Chain
Content
# Intent to Command Defaults

- If user asks generic "install zerodha cli":
  - Linux/macOS: `curl -fsSL https://raw.githubusercontent.com/jatinbansal1998/zerodha-kite-cli/main/scripts/install.sh | sh`
  - Windows: `irm https://raw.githubusercontent.com/jatinbansal1998/zerodha-kite-cli/main/scripts/install.ps1 | iex`
- If user asks generic "login" and no auth fields are provided:
  - ask for `api_key` and `api_secret` first (profile defaults to `default` unless specified)
Confidence
97% confidence
Finding
The intent defaults repeat unsafe installer behavior by routing generic install requests to remote script execution commands. Because this is a default path, the skill increases the likelihood that downstream agents will suggest unsafe one-liners broadly and automatically.

Static analysis

No suspicious patterns detected.