Back to skill

Security audit

IBKR + OpenClaw

Security checks for vulnerabilities and agentic risk

Overview

The skill appears intended for IBKR portfolio access, but it asks users to trust mutable installers and store brokerage credentials in plaintext while overstating its read-only safety.

Install only after reviewing and pinning the Docker/Gateway dependencies, using paper trading or a least-privilege IBKR setup, and replacing plaintext .env credential storage with a safer secret mechanism or at least strict file permissions. Treat the skill as high-trust financial infrastructure, not just a read-only helper.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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:28
Finding

Remote Docker Installation Script Executed Without Integrity Verification

Content
View full analysis
Remediation
View remediation
' echo ' install-docker.sh' | sha256sum --check - less install-docker.sh sh install-docker.sh ``` The URL and checksum must correspond to a trusted, immutable release; this example should not be used with an unpinned mutable URL. ]]>

T08 · Insecure Dependencies

Warning
Location
install.sh:11
Finding

Unpinned Python Packages and Mutable Third-Party Gateway Repository

Content
View full analysis
/dev/null || pip install ib_async pandas -q # Clone IB Gateway Docker if not present if [ ! -d "$WORKSPACE/ib-gateway-docker" ]; then echo "Cloning IB Gateway Docker..." git clone https://github.com/gnzsnz/ib-gateway-docker.git "$WORKSPACE/ib-gateway-docker" else ``` Equivalent unpinned manual instructions also appear at `SKILL.md:38-43` and `SKILL.md:96-101`: ```bash git clone https://github.com/gnzsnz/ib-gateway-docker.git ``` ```bash pip install ib_async pandas ``` ### Technical Analysis The installer retrieves the latest available versions of `ib_async` and `pandas` without exact version constraints or package hashes. It also clones the default branch of `gnzsnz/ib-gateway-docker` without pinning a reviewed tag or commit. As a result, installation is not reproducible, and the effective dependency code can change after the Skill has been audited. A compromised upstream account, repository, package release, or dependency chain could introduce code that executes during package installation, Python import, or container startup. The `--break-system-packages` option deliberately bypasses protections intended to prevent `pip` from modifying an externally managed system Python environment. This is broader than necessary for a small client application and can overwrite or conflict with dependencies used by unrelated system applications. Redirecting standard error to `/dev/null` also conceals the reason the first installation attempt failed and may hide relevant warnings. The cloned gateway project has particularly sensitive responsibilities: users are instructed to place IBKR credentials and a VNC passwor ...[truncated 1992 chars]
Remediation
View remediation
/dev/null`. Preserve diagnostics and fail clearly. 5. Pin `ib-gateway-docker` to a reviewed immutable commit or signed release: ```bash git clone https://github.com/gnzsnz/ib-gateway-docker.git "$WORKSPACE/ib-gateway-docker" git -C "$WORKSPACE/ib-gateway-docker" checkout --detach '' ``` 6. Verify the selected commit or release signature before use. 7. Review and pin all container images by immutable digest rather than mutable tags. 8. Run containers without unnecessary capabilities, privileged mode, host networking, or writable host mounts. 9. Restrict the gateway `.env` file to its owner: ```bash chmod 600 "$WORKSPACE/ib-gateway-docker/.env" ``` 10. Prefer Docker secrets or another protected credential mechanism instead of long-lived plaintext credentials in `.env`. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (19)

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The declared description emphasizes a functional read-only IBKR integration offering portfolio data, quotes, historical data, technical analysis, and Telegram alerts. The supplied code chunk does not implement those user-facing capabilities; it only performs environment setup. It also introduces undeclared behaviors such as installing packages and cloning an external repository. While these may support the stated goal, the actual code chunk's primary behavior is installer/bootstrap logic, which is materially different from the declared operational description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The code is clearly read-only and does connect to IBKR Gateway, matching part of the description. It can retrieve portfolio/account information and market quotes, which aligns with portfolio monitoring and basic stock lookup. However, several prominently declared capabilities are not present in the supplied code: there is no historical data retrieval, no technical analysis, no Telegram integration, and no alerting functionality. Additionally, the quote command explicitly requests market data type 3 (delayed frozen data), which does not fully support the claim of real-time quotes. This is a material description-to-behavior mismatch because the declared purpose significantly overstates the implemented capabilities.

Content

No source excerpt is available for this finding.

Chaining Abuse

High
Category
Tool Misuse
Confidence
97% confidence
Finding

The explicit command chain curl -fsSL ... | sh is a classic remote code execution anti-pattern because it combines network retrieval with immediate shell execution. In the context of a finance integration on a server that may later hold brokerage credentials and expose APIs, compromise of the host could cascade into theft of secrets, market data, and potentially account access.

Content

Scanner excerpt · SKILL.md (reported line 31)May include surrounding context.

Step 1: Install Docker

bash
curl -fsSL https://get.docker.com | sh
docker --version
docker compose version

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · install.sh (reported line 23)May include surrounding context.

sh
echo "IB Gateway Docker already exists."
fi

# Copy .env template if .env doesn't exist
if [ ! -f "$WORKSPACE/ib-gateway-docker/.env" ]; then
    echo "Copying .env template..."
    cp "$SKILL_DIR/.env.template" "$WORKSPACE/ib-gateway-docker/.env"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · install.sh (reported line 28)May include surrounding context.

sh
echo "IB Gateway Docker already exists."
fi

# Copy .env template if .env doesn't exist
if [ ! -f "$WORKSPACE/ib-gateway-docker/.env" ]; then
    echo "Copying .env template..."
    cp "$SKILL_DIR/.env.template" "$WORKSPACE/ib-gateway-docker/.env"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · install.sh (reported line 31)May include surrounding context.

sh
echo "IB Gateway Docker already exists."
fi

# Copy .env template if .env doesn't exist
if [ ! -f "$WORKSPACE/ib-gateway-docker/.env" ]; then
    echo "Copying .env template..."
    cp "$SKILL_DIR/.env.template" "$WORKSPACE/ib-gateway-docker/.env"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · install.sh (reported line 24)May include surrounding context.

sh
fi

# Copy .env template if .env doesn't exist
if [ ! -f "$WORKSPACE/ib-gateway-docker/.env" ]; then
    echo "Copying .env template..."
    cp "$SKILL_DIR/.env.template" "$WORKSPACE/ib-gateway-docker/.env"
    echo ""

Credential Access

High
Category
Privilege Escalation
Confidence
86% confidence
Finding

Copying a template into a live .env path for a brokerage gateway establishes a standard plaintext secret storage location that the rest of the toolchain expects to be populated with real credentials. In the context of a financial integration, encouraging credential placement into a local env file increases the risk of accidental exposure through backups, weak permissions, shell history-assisted handling, or later misuse by the cloned third-party container stack.

Content

Scanner excerpt · install.sh (reported line 25)May include surrounding context.

sh
# Copy .env template if .env doesn't exist
if [ ! -f "$WORKSPACE/ib-gateway-docker/.env" ]; then
    echo "Copying .env template..."
    cp "$SKILL_DIR/.env.template" "$WORKSPACE/ib-gateway-docker/.env"
    echo ""
    echo "⚠️  Edit $WORKSPACE/ib-gateway-docker/.env with your IBKR credentials"

Credential Access

High
Category
Privilege Escalation
Confidence
92% confidence
Finding

The script explicitly instructs the user to edit the .env file with IBKR credentials, which is a direct prompt to place sensitive brokerage authentication material into a local plaintext file. In this skill context, that is particularly dangerous because the credentials unlock financial account access via a gateway container and may be mishandled or later consumed by unreviewed components.

Content

Scanner excerpt · install.sh (reported line 26)May include surrounding context.

sh
# Copy .env template if .env doesn't exist
if [ ! -f "$WORKSPACE/ib-gateway-docker/.env" ]; then
    echo "Copying .env template..."
    cp "$SKILL_DIR/.env.template" "$WORKSPACE/ib-gateway-docker/.env"
    echo ""
    echo "⚠️  Edit $WORKSPACE/ib-gateway-docker/.env with your IBKR credentials"
    echo ""

Credential Access

High
Category
Privilege Escalation
Confidence
91% confidence
Finding

The next-steps guidance explicitly instructs the user to place IBKR credentials into ib-gateway-docker/.env, reinforcing a workflow that stores high-value financial secrets in a predictable plaintext location. Because this skill also directs users to start an authenticated brokerage gateway and complete 2FA, the resulting exposure is more serious than a generic app secret: it can enable access to live brokerage data and potentially account capabilities depending on configuration.

Content

Scanner excerpt · install.sh (reported line 36)May include surrounding context.

sh
echo ""
echo "=== Next Steps ==="
echo "1. Edit ib-gateway-docker/.env with your IBKR credentials"
echo "2. Start the container: cd ib-gateway-docker && docker compose up -d"
echo "3. Approve 2FA on your IBKR Mobile app"
echo "4. Test: python3 $SKILL_DIR/scripts/ibkr_client.py summary --port 4001"

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill markets itself as all read-only safe, but later states that some features may auto-request write access. That contradiction can cause operators to overtrust the integration and connect it to sensitive brokerage accounts under false assumptions about its access model.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The description says to use the skill when users ask about "portfolio monitoring, stock analysis, or automated trading alerts," which are broad categories rather than narrowly scoped trigger phrases. Without clearer constraints or exclusion conditions, the skill could be invoked for generic market-analysis requests unrelated to Interactive Brokers integration.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
93% confidence
Finding

The guide instructs users to store IBKR credentials in a plaintext .env file, creating a persistent local secret that may be exposed through backups, shell history, file permissions, repository mistakes, or host compromise. Because these are brokerage credentials, disclosure could lead to unauthorized account access and sensitive financial data exposure.

Content

Scanner excerpt · SKILL.md (reported line 48)May include surrounding context.

Step 3: Configure Environment

Create a .env file in the ib-gateway-docker directory:

env
# IBKR Account

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documentation labels the integration as read-only safe while also documenting exposure of the live trading API endpoint on port 4002. Even if READ_ONLY_API is intended, connecting to a live brokerage API materially increases risk because a configuration mistake, image change, or client misuse could enable interaction with a real account.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script provisions a live Interactive Brokers gateway by cloning a third-party Docker project, creating a local credential file, and instructing the user to enter brokerage credentials and approve 2FA. Even if intended for read-only monitoring, this materially expands the trust boundary and enables authenticated access to a financial account, which contradicts the 'read-only safe' framing and increases the chance of credential exposure or unintended account actions through the gateway or downstream tooling.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The setup flow tells the user to create and populate an .env file with IBKR credentials and then launch an authenticated gateway container, directly undermining the claim that the skill is 'all read-only safe.' In a financial-integration context, misleading safety claims are dangerous because they can cause users to disclose sensitive credentials and authorize brokerage connectivity without understanding the real risk surface.

Content

No source excerpt is available for this finding.

External Script Fetching

Low
Category
Supply Chain
Confidence
95% confidence
Finding

Piping a remote script from get.docker.com directly into sh executes unreviewed code fetched over the network at install time. If the remote source, TLS trust chain, DNS, or delivery path is compromised, the user can suffer immediate arbitrary code execution on the host.

Content

Scanner excerpt · SKILL.md (reported line 31)May include surrounding context.

Step 1: Install Docker

bash
curl -fsSL https://get.docker.com | sh
docker --version
docker compose version

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The setup instructions fix both TIME_ZONE and TZ to Asia/Singapore, which imposes a locale setting by default. The file does not explain that this is only an example or tell users to choose a timezone appropriate to their region, so it can violate locale-choice policy.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

This code hard-codes a locale/market preference via default arguments and CLI defaults (SEHK, HKD). Under the policy, forcing a specific locale without user opt-in can be a natural-language policy issue unless the regional constraint is clearly documented and justified, which is not present here.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.