Back to skill

Security audit

carkey

Security checks for vulnerabilities and agentic risk

Overview

The skill appears purpose-built for vehicle status queries, but it handles highly sensitive vehicle credentials and location data with risky credential-entry and local caching guidance.

Install only if you trust the Tika/OpenAPI service and understand that the skill can retrieve sensitive vehicle location and physical-status data. Prefer setting TIKA_API_KEY yourself outside the agent conversation, avoid --apikey on the command line, and clear ~/.skill_carkey_cache.json when no longer needed.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
query_vehicle.py:667
Finding

API Key Exposure Through Command-Line Arguments and Agent Conversation Logs

Content
View full analysis

Vulnerability Details

File Location: query_vehicle.py:667-670, 715-719; README.md:88, 98, 128, 185; SKILL.md:57, 60, 112
Vulnerability Type: Credential exposure through insecure secret input mechanisms
Risk Level: Medium

The project explicitly supports and documents passing a complete API key as a command-line argument:

bash
python3 query_vehicle.py --apikey 'your_full_api_key'
python3 query_vehicle.py --apikey 'your_full_api_key' --save-token-only

The corresponding implementation is:

python
parser.add_argument(
    "--apikey",
    help="Provide the full API key and save it to cache / 提供完整 API Key 并写入缓存",
)
python
def resolve_credentials(apikey: Optional[str], lang: str):
    if apikey:
        vehicle_token, access_token = parse_combined_token(apikey, lang)
        save_cache(vehicle_token, access_token, lang)
        return access_token, vehicle_token

The README also provides an installation prompt that encourages users to disclose the API key directly to an AI agent for configuration.

Technical Analysis

Secrets supplied in command-line arguments can be exposed through shell history, process listings, command telemetry, audit records, terminal logs, and automation logs. Any local account or monitoring process with permission to inspect process arguments may capture the complete API key while the command is running.

Supplying the key in an AI-agent conversation creates an additional disclosure channel. The credential may be retained in conversation history, execution traces, observability systems, or external model-provider logs. This behavior conflicts with the README's own warning that API keys should not be shared in chats.

The API key is split into a vehicle token and an access token. The access token is then sent as a bearer credential, while the vehicle token is sent in the request body. Exposure of the combined key therefore discloses the authent ...[truncated 1897 chars]

Remediation
View remediation

Remediation Suggestions

  1. Deprecate and remove --apikey as a secret-bearing command-line option.
  2. Continue supporting TIKA_API_KEY as the preferred non-interactive input, while warning users not to place it in committed shell profiles, public configuration files, or logged automation output.
  3. Add an interactive credential-entry mode using getpass.getpass() so the key is not echoed or stored in ordinary shell history.
  4. For durable storage, use an operating-system credential store or keyring rather than a plaintext JSON file where feasible.
  5. If plaintext caching remains supported, retain mode 0600, reject symlinks, verify file ownership, and use atomic file creation and replacement to reduce local file-manipulation risks.
  6. Remove all documentation examples that instruct users to disclose credentials in AI-agent conversations.
  7. Replace secret-bearing examples with instructions for users to configure the environment variable themselves outside the conversation.
  8. Warn users that command-line arguments, chat messages, logs, screenshots, and shell history are unsafe places for API keys.
  9. Document credential rotation and revocation procedures for keys that may already have been exposed.
  10. Ensure authentication-status output remains masked and never prints either component of the key in full.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (8)

Tainted flow: 'request' from os.environ.get (line 375, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · query_vehicle.py (reported line 378)May include surrounding context.

python
request = urllib.request.Request(API_URL, data=payload, headers=headers, method="POST")

    try:
        with urllib.request.urlopen(request, timeout=30) as response:
            return json.loads(response.read().decode("utf-8"))
    except urllib.error.HTTPError as exc:
        fail(build_http_error_message(exc, lang))

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
96% confidence
Finding

The skill describes capabilities that require environment access, local file read/write, network access, and shell execution, but it does not declare any tool scope or allowed-tools policy. This creates an overbroad execution surface where an agent may invoke sensitive capabilities without clear user-visible constraints, increasing the risk of credential exposure, filesystem modification, or unintended remote requests.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs users that API credentials may be stored in a local cache file, but it does not clearly warn about the security implications of persisting secrets on disk. Cached credentials can be recovered by other local users, malware, backups, or logs, enabling unauthorized access to vehicle data if the host is compromised or shared.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill handles highly sensitive vehicle telemetry, including precise location, address, VIN, and lock or door status, and sends it to a remote API, but it does not prominently warn users about that privacy exposure. Without an explicit warning and consent cue, users may disclose or retrieve sensitive physical-security data without understanding the risks of transmission, retention, or misuse.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

This code performs an HTTP POST to a remote API using vehicle credentials and sends the vehicle token, which results in retrieval/transmission of sensitive vehicle telemetry such as location and condition. There is no confirmation prompt or explicit user-facing disclosure at the point of network access explaining that remote vehicle data will be requested from an external service.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The OpenClaw install prompt examples are provided only in Chinese, which can amount to a natural-language locale preference without explicit user opt-in in that section. Although the document is broadly bilingual elsewhere, these operational prompt examples do not present an equivalent English option alongside the Chinese text.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The manifest describes a skill for querying vehicle location and condition information, but the code also implements persistent credential storage, credential-status inspection, and cache deletion via a local file. These are operational auth-management capabilities rather than direct vehicle-query behavior, and they are not stated in the skill purpose.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The argument parser sets --lang to default to zh, which forces a specific language choice unless the user overrides it. Under the stated policy, locale or language should not be imposed without user opt-in unless clearly justified.

Content

No source excerpt is available for this finding.