Back to skill

Security audit

TRON Energy Rental & Fee Optimization

Security checks for vulnerabilities and agentic risk

Overview

This skill is openly for TRON energy rental, but it can place paid orders through chat commands without built-in confirmation, authorization, or spending limits.

Review carefully before installing. Use this only where every caller authorized to trigger the skill may spend from the configured TRXDO account, and prefer adding confirmation, admin allowlisting, strict quantity limits, TRON address validation, rate limits, and safer secret storage before connecting funded credentials.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (3)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
skill.py:22
Finding

Financially Consequential Rental Orders Lack Authorization Controls

Content
View full analysis

Vulnerability Details

File Location: skill.py:22-40
Vulnerability Type: Missing authorization, transaction confirmation, and spending controls
Risk Level: High

Vulnerable Code

python
def handle_command(self, command: str, args: list):
    if "查询" in command:
        info = self.api.query_info()
        if info:
            return f"当前账户状态正常,接入官方能量池成功。详细信息请前往官网查看。"
        return "查询失败,请检查 API 配置."

    elif "租赁" in command or "购买" in command:
        if len(args) < 2:
            return "格式错误。请输入:租赁能量 [波场地址] [数量]"
        address = args[0]
        try:
            number = int(args[1])
        except ValueError:
            return "数量格式不正确."

        success, msg = self.api.submit_order(address, number)
        if success:
            return f"🎉 能量租赁订单提交成功!正在秒级派发至地址:{address}."
        return f"❌ 租赁失败,原因:{msg}"

Technical Analysis

The command handler directly converts chat-supplied arguments into a paid energy-rental API request. It performs no caller authentication, administrator-role check, address allowlisting, transaction confirmation, spending limit, rate limit, or replay prevention.

The quantity is checked only for integer syntax. Negative, zero, or excessively large values are not rejected locally. The destination is also not validated as a legitimate TRON address. Because the Skill uses the account owner's configured API credentials when submitting the order, any caller who can trigger this command may exercise the purchasing authority associated with those credentials.

This behavior exceeds least privilege for an openly accessible group-chat command. Query access and paid order-submission access should have separate authorization boundaries.

Attack Path

  1. An administrator configures the Skill with a funded TRXDO account and enables it in a group or private chat.
  2. An unauthorized user gains access to a conversation where Skill commands are acce ...[truncated 993 chars]
Remediation
View remediation

Remediation Suggestions

  • Require an authenticated caller identity and restrict purchasing to an explicit administrator allowlist.
  • Separate read-only query operations from paid order-submission permissions.
  • Require an explicit confirmation step that displays the address, quantity, and estimated cost before submission.
  • Validate the destination using TRON address-format and checksum validation.
  • Reject zero and negative quantities and enforce documented minimum and maximum values.
  • Introduce per-user, per-chat, and account-wide rate limits.
  • Enforce per-order and daily spending limits independently of caller input.
  • Record an auditable transaction log containing the authenticated caller, destination, quantity, request time, and result.
  • Use idempotency keys to prevent accidental or repeated order creation.
  • Avoid exposing provider-generated internal error details directly to untrusted chat participants.

T09 · Insecure Skill Coding Practices

Warning
Location
skill.py:7
Finding

Purchasing API Credentials Are Stored in a Plaintext Skill Configuration File

Content
View full analysis

Vulnerability Details

File Location: skill.py:7-16, config.json:8-12, README.md:37-47, SKILL.md:37-47
Vulnerability Type: Plaintext sensitive credential storage and misleading repository-protection guidance
Risk Level: Medium

Vulnerable Code

python
config_path = os.path.join(os.path.dirname(__file__), "config.json")
with open(config_path, "r", encoding="utf-8") as f:
    self.config = json.load(f)

user_config = self.config.get("default_config", {})
self.api = TrxdoApi(
    user_id=user_config.get("userId"),
    secret_key=user_config.get("secretKey")
)
json
{
  "default_config": {
    "userId": "TRXDO_USER_ID_PLACEHOLDER",
    "secretKey": "TRXDO_API_KEY_PLACEHOLDER",
    "apiUrl": "https://api.trxdo.com"
  }
}

The placeholder names above represent the corresponding non-secret placeholder values included in the audited configuration; no live credential was present in the reviewed package.

Technical Analysis

Installation documentation instructs users to replace the placeholder values in the repository-local config.json file with a live user ID and secret key. The Skill then reads the secret directly from that plaintext file.

The documentation claims that a .gitignore rule protects the modified configuration from accidental publication, but no .gitignore file exists in the audited project structure. Even if such a rule were added later, it would not protect against filesystem access, backups, support archives, container images, previously tracked files, or manual copying.

The credential authorizes an API that can create financially consequential rental orders. Storing it beside executable Skill files broadens access beyond the minimum components that need the secret.

Attack Path

  1. A user follows the installation documentation and places a live TRXDO secret key in config.json.
  2. The Skill directory is committed to source control, inclu ...[truncated 878 chars]
Remediation
View remediation

Remediation Suggestions

  • Load the secret from an environment variable, operating-system credential store, or managed secrets service.
  • Distribute only a non-sensitive config.example.json; do not instruct users to modify a tracked configuration file.
  • Add and verify an appropriate .gitignore rule, while clearly documenting that ignore rules do not protect local plaintext secrets.
  • Apply restrictive filesystem permissions if a local secret file must be supported.
  • Ensure deployment archives, container images, logs, and diagnostic bundles exclude credentials.
  • Use separate read-only and order-submission credentials where the provider supports scoped access.
  • Document immediate credential revocation and rotation procedures.
  • Fail closed when placeholder or missing credentials are detected rather than constructing a client with invalid values.
  • Add automated secret scanning to the development and release process.

T09 · Insecure Skill Coding Practices

Warning
Location
TrxdoApi.py:16
Finding

API Request Authentication Uses a Weak Custom MD5 Construction

Content
View full analysis

Vulnerability Details

File Location: TrxdoApi.py:16-17, 25-33, 49-59, 76-85
Vulnerability Type: Weak cryptographic request authentication and potential replay exposure
Risk Level: Medium

Vulnerable Code

python
def _get_md5(self, text: str) -> str:
    return hashlib.md5(text.encode('utf-8')).hexdigest()
python
token = int(time.time())

sign_str = f"{address}{number}{token}{self.secret_key}"
sign = self._get_md5(sign_str)

payload = {
    "userId": self.user_id,
    "token": token,
    "sign": sign,
    "address": address,
    "number": number
}

Equivalent MD5-based signing is also present in TrxdoApi.cs:27-30, 56-59, 87-90.

Technical Analysis

The client authenticates requests by concatenating request fields, a second-granularity timestamp, and the secret key, then hashing the result with MD5. This is a custom keyed-hash construction rather than a standard message authentication code such as HMAC-SHA-256.

MD5 is cryptographically obsolete for integrity-sensitive designs. The concatenated fields are not length-prefixed or separated using an unambiguous canonical encoding. Requests also contain no cryptographically random nonce or client-generated idempotency key.

HTTPS protects requests while they are transmitted directly to the configured endpoint. However, if a signed request is exposed through local logging, compromised TLS termination, debugging infrastructure, or another endpoint, it may be replayable during the server's timestamp-acceptance window unless the server independently tracks and rejects reused signatures. The reviewed client code provides no replay protection, while the server-side enforcement could not be verified in this static audit.

Attack Path

  1. A valid signed order request is captured from a compromised client, proxy, debugger, log, or TLS-termination component.
  2. The attacker resubmits the same payload while its timestamp rema ...[truncated 721 chars]
Remediation
View remediation

Remediation Suggestions

  • Replace the custom MD5 construction with HMAC-SHA-256 or a stronger provider-supported authenticated signing scheme.
  • Serialize signed fields using an unambiguous canonical representation with explicit field names and lengths.
  • Include a cryptographically random nonce in every request.
  • Require the server to enforce a short timestamp-validity window and reject previously used nonces.
  • Add a unique idempotency key to each order-submission request and retain the result for safe retries.
  • Use constant-time signature comparison on the server.
  • Prevent signed payloads and authentication headers from being written to application, proxy, or diagnostic logs.
  • If the API protocol is controlled by a third party and cannot be changed, document the residual risk and add client-side idempotency, strict TLS verification, short timeouts, and credential scoping.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (16)

Hidden Instructions

High
Category
Prompt Injection
Confidence
60% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · TrxdoApi.cs (reported line 1)May include surrounding context.

text
using Itfers.Utility;
using System.Text.Json;

namespace ConsoleApp1

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code submits an external order directly after parsing user input, with no confirmation step, authorization check, spending limit, or safety interlock. In an agent or chatbot context, that means a casual, spoofed, or mistaken command can trigger a real blockchain-related purchase/rental operation that may be irreversible or financially costly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README promotes 24/7 unattended, automatic energy-rental and fee optimization for live TRON transactions without prominently warning that these actions can trigger real blockchain operations and spend funds. In an agent-skill context, unclear framing around autonomous execution increases the chance of unintended live transactions, unexpected fees, or misuse by operators who assume the skill is informational or simulation-only.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The trigger examples are too vague and do not define precise activation conditions, authorized users, parameter constraints, or exclusion cases. In a chat-driven agent environment, ambiguous triggers can cause accidental invocation of fee-affecting blockchain actions from casual conversation, malformed inputs, or unauthorized users.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The README provides only two example trigger phrases, '租赁能量 65000' and '能量查询', but does not define the full set of accepted invocations or when the skill should activate versus ignore similar chat messages. Because the skill is described as callable directly in group or private chat, this ambiguity could cause unintended activation from ordinary discussion about energy or queries.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code sends userId, token, signature, and in other methods wallet/order-related data to a remote API, but there is no confirmation prompt, visible logging, or user-facing disclosure around the transmission. For code files, outbound network operations that transmit user or system data should have some form of disclosure unless clearly communicated elsewhere.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The SubmitOrder method triggers a remote order-placement API call, which is a consequential external action, but the implementation provides no confirmation prompt, warning comment, or user-facing log. Although the method name suggests its purpose, the code itself lacks any explicit disclosure that an order will be placed against a live external service.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · TrxdoApi.py (reported line 36)May include surrounding context.

python
}

        try:
            response = requests.post(url, json=payload, headers={"Content-Type": "application/json"})
            if response.status_code == 200:
                data = response.json()
                return data.get("data")

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · TrxdoApi.py (reported line 90)May include surrounding context.

python
}

        try:
            response = requests.post(url, json=payload, headers={"Content-Type": "application/json"})
            if response.status_code == 200:
                data = response.json()
                return data.get("data")

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The submit_order method triggers a real external transaction that can spend account balance or affect a third-party wallet address without any built-in confirmation, dry-run mode, or explicit user acknowledgement. In an agent/skill context, this increases the risk of accidental or prompt-induced purchases because calling the method is sufficient to place the order.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
86% confidence
Finding

This external transmission is part of the order-submission flow and causes a real side effect outside the local environment. In a skill/agent setting, sending this request without an approval workflow can lead to unauthorized or accidental purchases, making the transmission materially risky beyond merely contacting an API.

Content

Scanner excerpt · TrxdoApi.py (reported line 62)May include surrounding context.

python
}

        try:
            response = requests.post(url, json=payload, headers={"Content-Type": "application/json"})
            if response.status_code == 200:
                res_json = response.json()
                msg = res_json.get("msg", "")

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest declares network access, an external API endpoint, and API credentials, but it does not disclose to users that their requests or related data may be transmitted to TRXDO. In a financial/blockchain context, this omission is more sensitive because users may expose wallet-related intent, account identifiers, or operational metadata to a third party without informed consent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger list includes broad phrases such as '降低手续费' that could activate the skill for generic fee-reduction requests, not just TRON energy rental. Because the skill has network access and is tied to a third-party API, overbroad invocation increases the chance of unintended external calls, user confusion, or credential-backed actions in the wrong context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill reads sensitive API credentials from config.json and uses them to initialize an API client, but the code provides no user-facing disclosure about credential use. It also later performs a real order submission through the external API without any confirmation prompt or warning that the action will trigger an external transaction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The file uses bilingual documentation but gives no explicit statement that the skill accepts user language choice or how language/locale is selected during operation. Under the policy, locale or language behavior should not be forced or left unclear unless the skill clearly offers user choice or documents a justified constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

User-facing strings, comments, defaults, and docstrings are entirely in Chinese, including placeholder credentials and status messages. The file does not indicate that the skill is intentionally China-region-specific or provide any language/locale opt-in, which can violate language-choice policy.

Content

No source excerpt is available for this finding.