Back to skill

Security audit

Telegram Analyzer

Security checks for vulnerabilities and agentic risk

Overview

This skill is for SaaS contact/message management, but it embeds a backend token, uses plaintext localhost HTTP, and describes contact-changing actions without clear safeguards.

Review this skill before installing. It appears intended for a local SaaS/Telegram contact backend, but it should not ship with a reusable token in source, should use a safer authenticated transport, and should require clear user confirmation before changing contact records.

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
index.js:1
Finding
Hard-Coded Agent Token and Plaintext Transmission of Sensitive Data## Vulnerability Details **File Location**: `index.js`, lines 1–15 **Vulnerability Type**: Hard-coded credential and plaintext transmission of authentication and contact data **Risk Level**: Medium ### Vulnerable Code ```js const BACKEND_URL = "http://localhost:8001/api/v1/agent"; const AGENT_TOKEN = "sk_agent_openclaw_dev_12345"; export default { name: "telegram_analyzer", tools: { search_contacts: { description: "Search for contacts in SaaS", parameters: { type: "object", properties: { query: { type: "string" } }, required: ["query"] }, execute: async ({ query }) => { const res = await fetch(${BACKEND_URL}/search-contacts, { method: "POST", headers: { "Content-Type": "application/json", "X-Agent-Token": AGENT_TOKEN }, body: JSON.stringify({ query }) }); ``` ### Technical Analysis The skill embeds an agent authentication token directly in distributable source code. Anyone able to read the package can recover the token without needing to compromise a protected credential store. The intended request also uses unencrypted HTTP and places the token in the `X-Agent-Token` header. The request body may contain sensitive contact identifiers, names, phone numbers, or usernames supplied as search terms. Although the configured destination is `localhost`, plaintext transport still permits a malicious or compromised local service listening on port `8001` to collect both the credential and search data. The risk increases if the local service is forwarded, proxied, containerized with a shared network boundary, or accidentally exposed beyond the host. Authentication is reasonably necessary for the declared contact-search function, and transmitting a search term to the relevant backend is inherent to that operation. However, embedding a reusable credential in source code and transmitting it over plaintext HTTP exceed the minimum safe privileges and pro ...[truncated 2074 chars]
Remediation
## Remediation Suggestions 1. Revoke and rotate the embedded agent token, including any identical token used in development or deployed environments. 2. Remove credentials from source code. Inject the token at runtime through a protected secret manager or narrowly scoped environment variable. 3. Assign a unique, short-lived token to each deployment and restrict it to the exact API route and operation required for contact search. 4. Replace plaintext HTTP with HTTPS using certificate validation. If the backend is strictly local, prefer authenticated operating-system IPC such as a Unix domain socket with restrictive filesystem permissions. 5. Ensure the backend binds only to the required interface and is not exposed through container port publishing, reverse proxies, or development tunnels. 6. Authenticate the backend endpoint rather than trusting `localhost`. Where appropriate, use mutual TLS, signed requests, or peer-credential validation. 7. Minimize submitted contact information, validate the `query` input, and avoid logging tokens or raw contact-search terms. 8. Correct the invalid `fetch` URL syntax only after the credential and transport controls are remediated, for example by constructing the URL through a validated URL API. 9. Add automated secret scanning and tests that reject hard-coded credentials and non-TLS endpoints before release.
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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Hidden Instructions

High
Category
Prompt Injection
Content
# Telegram Analyzer Skill

Access and manage your SaaS contacts and messages.
Confidence
60% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill exposes a state-changing tool that can update contact stages, tags, or notes, but the description does not warn the user that contact records may be modified. This increases the risk of unintended or socially engineered data changes because a user may invoke the skill expecting read-only analysis while the agent can perform writes.

Context-Inappropriate Capability

Medium
Confidence
99% confidence
Finding
The skill hardcodes an agent backend token directly in source code, which exposes a reusable secret to anyone who can view, copy, or package the skill. Even though the backend points to localhost, the token represents backend access capability and can be reused by other local processes, leaked through logs or repositories, or accidentally promoted into non-development environments.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The skill transmits the user-supplied query and an authentication token to a backend service without any visible disclosure, consent, or indication that user input leaves the local skill boundary. This creates data exposure risk for potentially sensitive contact-search terms and also couples user-driven input with authenticated backend actions, making accidental data leakage or misuse more likely.

Static analysis

No suspicious patterns detected.