Back to skill

Security audit

Avito.ru publish and chat

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its Avito API purpose, but its examples and scripts put account secrets and tokens on the command line where they can be exposed.

Install only if you are comfortable granting API access to your Avito account data. Do not paste real client secrets or bearer tokens into command examples, chat transcripts, or shell history; use a secure credential flow or modify the scripts to read from protected environment variables or a secret manager before use. Rotate any Avito secrets or tokens that were previously used with these command-line examples.

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
scripts/auth.py:20
Finding
Sensitive credentials exposed through command-line arguments<![CDATA[ ## Vulnerability Details **File Locations**: - `SKILL.md:23` - `SKILL.md:31` - `SKILL.md:39` - `SKILL.md:47` - `SKILL.md:55` - `scripts/auth.py:20-24` - `scripts/get_self.py:18-22` - `scripts/get_balance.py:18-22` - `scripts/list_items.py:18-22` - `scripts/list_chats.py:18-22` **Vulnerability Type**: Sensitive information exposure through process arguments **Risk Level**: Medium ### Vulnerable Code `scripts/auth.py:20-24`: ```python if __name__ == "__main__": if len(sys.argv) < 3: print("Usage: auth.py <client_id> <client_secret>") sys.exit(1) token_data = get_token(sys.argv[1], sys.argv[2]) ``` `scripts/get_self.py:18-22`: ```python if __name__ == "__main__": if len(sys.argv) < 2: print("Usage: get_self.py <token>") sys.exit(1) user = get_self(sys.argv[1]) ``` `scripts/get_balance.py:18-22`: ```python if __name__ == "__main__": if len(sys.argv) < 3: print("Usage: get_balance.py <token> <user_id>") sys.exit(1) balance = get_balance(sys.argv[1], sys.argv[2]) ``` `scripts/list_items.py:18-22`: ```python if __name__ == "__main__": if len(sys.argv) < 2: print("Usage: list_items.py <token>") sys.exit(1) items = list_items(sys.argv[1]) ``` `scripts/list_chats.py:18-22`: ```python if __name__ == "__main__": if len(sys.argv) < 3: print("Usage: list_chats.py <token> <user_id>") sys.exit(1) chats = list_chats(sys.argv[1], sys.argv[2]) ``` The corresponding usage documented in `SKILL.md` instructs users to place secrets directly on the command line: ```bash python3 scripts/auth.py <client_id> <client_secret> python3 scripts/get_self.py <token> python3 scripts/get_balance.py <token> <user_id> python3 scripts/list_items.py <token> python3 scripts/list_chats.py <token> <user_id> ``` ### Technical Analysis The scripts retrieve the Avito client secret and bearer access tokens from `sys.argv`. Command-line arguments are not an app ...[truncated 2457 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Remove secrets from command-line arguments.** Read the client ID, client secret, and bearer token from protected environment variables or a dedicated credential store. 2. **Provide a non-echoing interactive fallback.** Use `getpass.getpass()` when a secret is not available from a secure source: ```python import getpass import os client_id = os.environ.get("AVITO_CLIENT_ID") client_secret = os.environ.get("AVITO_CLIENT_SECRET") if not client_id: client_id = input("Avito Client ID: ") if not client_secret: client_secret = getpass.getpass("Avito Client Secret: ") ``` Apply equivalent handling to bearer tokens, such as reading them from `AVITO_ACCESS_TOKEN`. 3. **Update `SKILL.md`.** Replace examples that contain positional secret arguments with environment-variable or secure-prompt examples. Do not suggest commands that place secrets directly in shell history. 4. **Use a protected credential store for automation.** In CI/CD or unattended environments, obtain secrets from the platform's secret manager and prevent secret values from appearing in job definitions, logs, or traces. 5. **Minimize token disclosure.** Avoid printing complete authentication responses by default. If token output is needed for interoperability, provide an explicit output option and warn users to redirect it only to a permission-restricted destination. 6. **Apply restrictive access controls.** Any file used to supply or store credentials should be readable only by the intended account, such as mode `0600` on Unix-like systems. 7. **Rotate exposed credentials.** Users who previously invoked these commands should remove affected entries from shell history and rotate the relevant client secrets or revoke bearer tokens where exposure is possible. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (10)

Credential Access

High
Category
Privilege Escalation
Content
### Authentication

Get an access token using your client credentials.

```bash
python3 scripts/auth.py <client_id> <client_secret>
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Lp3

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding
The skill explicitly describes interacting with the Avito API and includes scripts that perform authentication and account operations, which implies outbound network access. Omitting a declared tool scope or permissions boundary makes the skill less auditable and can allow broader-than-expected network behavior, especially in an environment where skills should clearly declare capabilities.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The setup and feature descriptions instruct users to provide client credentials and tokens, but they do not warn that these are sensitive secrets tied to account access and private account/chat data. This increases the chance that users expose credentials in prompts, logs, shell history, or insecure storage, leading to unauthorized access to the Avito account and associated data.

Missing User Warnings

Medium
Confidence
83% confidence
Finding
The script sends `client_id` and `client_secret` to a remote token endpoint via `requests.post`, but there is no confirmation prompt, explanatory log message, or docstring/comment disclosing that sensitive credentials are transmitted over the network. For a code file, this is a safety-relevant operation involving credentials and external communication without any user warning in the file.

External Transmission

Medium
Category
Data Exfiltration
Content
import json

def list_items(token):
    url = "https://api.avito.ru/core/v1/items"
    headers = {
        "Authorization": f"Bearer {token}"
    }
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
import json

def list_items(token):
    url = "https://api.avito.ru/core/v1/items"
    headers = {
        "Authorization": f"Bearer {token}"
    }
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
import json

def list_items(token):
    url = "https://api.avito.ru/core/v1/items"
    headers = {
        "Authorization": f"Bearer {token}"
    }
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
import json

def list_items(token):
    url = "https://api.avito.ru/core/v1/items"
    headers = {
        "Authorization": f"Bearer {token}"
    }
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
import json

def list_items(token):
    url = "https://api.avito.ru/core/v1/items"
    headers = {
        "Authorization": f"Bearer {token}"
    }
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The script accepts a bearer token directly from the command line, which can expose the credential through shell history, process listings, audit logs, or job runners. Because this skill manages an Avito account and can access account data and chats, disclosure of the token could allow unauthorized API access to sensitive account information and actions.

Static analysis

No suspicious patterns detected.