Back to skill

Security audit

Verified Trading Bot Reputation: Building Cryptographic PnL Proof

Security checks for vulnerabilities and agentic risk

Overview

This is a non-executable guide, but its examples mishandle sensitive keys and blur sandbox versus production API use.

Review carefully before installing or following the examples. Do not print or paste private signing keys into terminals, chats, logs, notebooks, or CI output; store them in a proper secret store and rotate any key generated with this example. Use a clearly chosen sandbox or production base URL, verify whether an API key is actually required, and avoid sending real trading metrics or credentials until the environment is explicit.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:121
Finding
Private Ed25519 Signing Key Exposed Through Standard Output<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 121–137 **Vulnerability Type**: Plaintext secret exposure through Agent-visible output **Risk Level**: High ### Vulnerable Code ```python # Serialize private key (store securely -- this is your bot's identity) private_bytes = private_key.private_bytes( encoding=serialization.Encoding.Raw, format=serialization.PrivateFormat.Raw, encryption_algorithm=serialization.NoEncryption() ) # Serialize public key (this gets registered on GreenHelix) public_bytes = public_key.public_bytes( encoding=serialization.Encoding.Raw, format=serialization.PublicFormat.Raw ) private_key_b64 = base64.b64encode(private_bytes).decode() public_key_b64 = base64.b64encode(public_bytes).decode() print(f"Private key (keep secret): {private_key_b64}") ``` ### Technical Analysis The example serializes the Ed25519 private key in raw, unencrypted form, converts it to Base64, and prints it to standard output. Base64 is an encoding mechanism and provides no confidentiality: anyone with the output can recover the original 32-byte key. This is especially unsafe in an AI Agent context because standard output may be returned to the caller or retained in conversation history, execution logs, telemetry, CI output, terminal scrollback, or monitoring systems. The implementation therefore contradicts its own instruction to keep the key secret. The flagged Base64 operation is not itself covert code execution. The security issue arises because sensitive private-key material is encoded and then disclosed through an observable output channel. ### Attack Path 1. A user follows the documented key-generation example. 2. The example generates a new Ed25519 private key and serializes it without encryption. 3. The raw key is Base64-encoded and printed to standard output. 4. The output is captured by Agent conversation history, logs, telemetry, terminal recording, CI output, or another caller with access to the exec ...[truncated 901 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Remove all output of private-key material. Only the public key or a non-sensitive fingerprint should be displayed. - Generate and store the private key directly in a secret manager, hardware-backed keystore, or encrypted key file rather than converting it into a printable string. - If file storage is necessary, encrypt the private key at rest and restrict permissions to the owning account, such as mode `0600` on supported systems. - Avoid placing private keys in command-line arguments, source files, chat messages, notebooks, telemetry, or environment dumps. - Add explicit warnings that Base64 does not protect secrets. - Provide a safe example that writes the key to a protected destination without printing its value. - Document key rotation and revocation procedures. Any key previously exposed through this example should be treated as compromised and replaced. - Configure log-redaction controls as defense in depth, but do not rely on redaction as a substitute for removing the unsafe print operation. ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:107
Finding
Unpinned Third-Party Dependency Installation<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, line 107 **Vulnerability Type**: Unpinned dependency installation and mutable supply-chain trust **Risk Level**: Medium ### Vulnerable Code ```bash pip install cryptography requests ``` ### Technical Analysis The installation instruction retrieves the current versions of `cryptography` and `requests` from whatever package index and pip configuration are active at execution time. It does not specify reviewed versions, verify package hashes, use a lock file, or constrain the package source. Python package installation can execute package build or installation logic. Consequently, the effective code installed by this command can change after the Skill has been audited. A compromised package release, package index, mirror, DNS path, or local pip configuration could cause attacker-controlled code to execute under the installing user's account. The package names shown are established packages and there is no evidence in the project that they are currently malicious. The finding concerns the unsafe, non-reproducible installation practice and the unnecessary expansion of the supply-chain trust boundary. ### Attack Path 1. A user executes the documented `pip install` command. 2. pip resolves dependencies using the user's current index and configuration. 3. A compromised release, malicious mirror, altered index configuration, or dependency substitution supplies attacker-controlled package content. 4. pip downloads and installs that content without validating it against project-published hashes. 5. Malicious build or installation logic executes with the privileges of the user running pip. 6. The installed package can subsequently execute whenever the guide's Python examples import or use it. ### Impact Assessment Successful exploitation could execute arbitrary code with the privileges of the account performing the installation. Depending on that account's permissions, the attacker could read acces ...[truncated 409 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Pin dependencies to explicitly reviewed versions instead of installing unconstrained latest releases. - Publish a lock file or requirements file containing cryptographic hashes. - Install with hash verification, for example through `pip install --require-hashes -r requirements.txt`. - Document the expected trusted package index and prevent unintended fallback to untrusted extra indexes. - Use an isolated virtual environment with no production credentials available during installation. - Review transitive dependencies and update pins through a controlled dependency-review process. - Prefer prebuilt, verified artifacts where appropriate, and avoid running package installation with root or administrator privileges. - Add automated dependency scanning and integrity verification to the release process. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (20)

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
The guide states that the sandbox requires no API key, yet the examples consistently use bearer-token authorization. This mismatch can mislead users into supplying credentials unnecessarily or trusting inaccurate setup instructions, which increases the risk of credential misuse and unsafe onboarding decisions.

Intent-Code Divergence

Medium
Confidence
97% confidence
Finding
The narrative claims the examples target the sandbox, but the Python examples use the production hostname. This can cause users to send test data, identifiers, or real credentials to production unexpectedly, creating risk of unintended data exposure, account changes, and operational mistakes.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The sample code prints the newly generated Ed25519 private key directly to stdout. Secrets printed to terminals are commonly captured in shell history, logs, CI output, notebook cells, screenshots, or copied into insecure storage, which can lead to full identity compromise for the agent.

External Transmission

Medium
Category
Data Exfiltration
Content
API_KEY="your-api-key-here"
PUBLIC_KEY_B64="your-base64-public-key"

curl -s -X POST https://sandbox.greenhelix.net/v1 \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
```python
import requests

BASE_URL = "https://api.greenhelix.net/v1"
API_KEY = "your-api-key-here"

headers = {
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
```python
import requests

BASE_URL = "https://api.greenhelix.net/v1"
API_KEY = "your-api-key-here"

headers = {
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
```python
import requests

BASE_URL = "https://api.greenhelix.net/v1"
API_KEY = "your-api-key-here"

headers = {
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
```python
import requests

BASE_URL = "https://api.greenhelix.net/v1"
API_KEY = "your-api-key-here"

headers = {
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
"Content-Type": "application/json"
}

response = requests.post(f"{BASE_URL}/v1", headers=headers, json={
    "tool": "register_agent",
    "input": {
        "agent_id": "trading-bot-alpha-7x",
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
"Content-Type": "application/json"
}

response = requests.post(f"{BASE_URL}/v1", headers=headers, json={
    "tool": "register_agent",
    "input": {
        "agent_id": "trading-bot-alpha-7x",
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
"Content-Type": "application/json"
}

response = requests.post(f"{BASE_URL}/v1", headers=headers, json={
    "tool": "register_agent",
    "input": {
        "agent_id": "trading-bot-alpha-7x",
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
"Content-Type": "application/json"
}

response = requests.post(f"{BASE_URL}/v1", headers=headers, json={
    "tool": "register_agent",
    "input": {
        "agent_id": "trading-bot-alpha-7x",
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
"Content-Type": "application/json"
}

response = requests.post(f"{BASE_URL}/v1", headers=headers, json={
    "tool": "register_agent",
    "input": {
        "agent_id": "trading-bot-alpha-7x",
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
"Content-Type": "application/json"
}

response = requests.post(f"{BASE_URL}/v1", headers=headers, json={
    "tool": "register_agent",
    "input": {
        "agent_id": "trading-bot-alpha-7x",
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
"Content-Type": "application/json"
}

response = requests.post(f"{BASE_URL}/v1", headers=headers, json={
    "tool": "register_agent",
    "input": {
        "agent_id": "trading-bot-alpha-7x",
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
"Content-Type": "application/json"
}

response = requests.post(f"{BASE_URL}/v1", headers=headers, json={
    "tool": "register_agent",
    "input": {
        "agent_id": "trading-bot-alpha-7x",
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
With curl:

```bash
curl -s -X POST https://sandbox.greenhelix.net/v1 \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
def _execute(self, tool, input_data):
        """Execute a tool on the GreenHelix gateway."""
        response = requests.post(
            f"{self.base_url}/v1",
            headers=self.headers,
            json={"tool": tool, "input": input_data}
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
With curl:

```bash
curl -s -X POST https://sandbox.greenhelix.net/v1 \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
def fetch_raw_submissions(base_url, headers, agent_id, start, end):
    """Fetch raw metric submissions for a time range."""
    response = requests.post(f"{base_url}/v1", headers=headers, json={
        "tool": "query_metrics",
        "input": {
            "agent_id": agent_id,
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Static analysis

No suspicious patterns detected.