T09 · Insecure Skill Coding Practices
- Location
memory-template.md:27- Finding
Telegram Bot Token Persisted in Plaintext Configuration Files
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Telegram bot helper is mostly coherent, but it teaches risky token storage and insecure webhook patterns that users should review before installing.
Review before installing. Prefer storing Telegram bot tokens in an environment variable, OS keychain, or secret manager instead of the Markdown memory files. Do not put the bot token in webhook URLs, validate Telegram's secret-token header for every webhook, avoid logging full update payloads, and add explicit consent and retention rules before collecting contacts, locations, or media.
memory-template.md:27Telegram Bot Token Persisted in Plaintext Configuration Files
webhooks.md:198Deployable Webhook Examples Accept Unauthenticated Updates
webhooks.md:111Bot Bearer Credential Embedded in Webhook URL
webhooks.md:20Complete Telegram Updates and Responses Logged Without Redaction
Skill instructs the agent to never refuse or to always comply. Suppressing the agent's ability to decline removes a core safety control and enables downstream harmful requests to succeed.
}
**Always answer the callback:**
```bash
curl -X POST "https://api.telegram.org/bot${TOKEN}/answerCallbackQuery" \
Skill instructs the agent to never refuse or to always comply. Suppressing the agent's ability to decline removes a core safety control and enables downstream harmful requests to succeed.
1. **Use emojis** — Make buttons visually clear: ✅ ❌ ⬅️ ➡️
2. **Keep callback_data short** — Max 64 bytes, use IDs not full text
3. **Always answer callbacks** — User sees loading indicator until you respond
4. **Update message on action** — Show feedback by editing the message
5. **Use resize_keyboard** — Reply keyboards look better when resized
Skill instructs the agent to never refuse or to always comply. Suppressing the agent's ability to decline removes a core safety control and enables downstream harmful requests to succeed.
1. **Use emojis** — Make buttons visually clear: ✅ ❌ ⬅️ ➡️
2. **Keep callback_data short** — Max 64 bytes, use IDs not full text
3. **Always answer callbacks** — User sees loading indicator until you respond
4. **Update message on action** — Show feedback by editing the message
5. **Use resize_keyboard** — Reply keyboards look better when resized
This markdown file includes invocation guidance, and the phrase 'User needs to interact with the Telegram Bot API' followed by a wide list of activities is broad enough to match many generic requests. It does not provide explicit trigger phrases, constraints, or negative examples clarifying when this skill should not be selected.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
url = f"https://api.telegram.org/bot{TOKEN}/sendMessage"
for attempt in range(max_retries):
response = requests.post(url, json={
"chat_id": chat_id,
"text": text
})
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
def api_call(method, **params):
response = requests.post(
f"https://api.telegram.org/bot{TOKEN}/{method}",
json=params
)
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl -X POST "https://api.telegram.org/bot${TOKEN}/sendMessage" \
-H "Content-Type: application/json" \
-d '{
"chat_id": 123456789,
The examples include buttons that request sensitive data such as phone number and location, but they provide no warning, consent guidance, data-minimization note, or privacy handling advice. In a bot-development skill, this can normalize collecting personal data without clearly communicating user notice and secure handling expectations.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl -X POST "https://api.telegram.org/bot${TOKEN}/sendMessage" \
-H "Content-Type: application/json" \
-d '{
"chat_id": 123456789,
The skill provides concrete examples for uploading and downloading media to Telegram but omits any warning that files and metadata are transmitted to a third-party service. In a bot-development context, this can lead users to send personal, regulated, or sensitive media without considering retention, access controls, consent, or compliance obligations.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl -X POST "https://api.telegram.org/bot${TOKEN}/sendPhoto" \
-F "chat_id=123456789" \
-F "photo=@/path/to/image.jpg" \
-F "caption=Photo caption"
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl -X POST "https://api.telegram.org/bot${TOKEN}/sendAudio" \
-F "chat_id=123456789" \
-F "audio=@song.mp3" \
-F "title=Song Title" \
The template explicitly instructs users to store a Telegram bot token in a local markdown file, which is a poor practice for handling secrets. Markdown files are commonly indexed, synced, committed to version control, or exposed through backups and editor tooling, increasing the chance of accidental credential disclosure and bot takeover.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
Long polling to receive updates.
curl "https://api.telegram.org/bot${TOKEN}/getUpdates?offset=${OFFSET}&timeout=30"
| Parameter | Required | Description |
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
Long polling to receive updates.
curl "https://api.telegram.org/bot${TOKEN}/getUpdates?offset=${OFFSET}&timeout=30"
| Parameter | Required | Description |
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
Long polling to receive updates.
curl "https://api.telegram.org/bot${TOKEN}/getUpdates?offset=${OFFSET}&timeout=30"
| Parameter | Required | Description |
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
Long polling to receive updates.
curl "https://api.telegram.org/bot${TOKEN}/getUpdates?offset=${OFFSET}&timeout=30"
| Parameter | Required | Description |
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
Long polling to receive updates.
curl "https://api.telegram.org/bot${TOKEN}/getUpdates?offset=${OFFSET}&timeout=30"
| Parameter | Required | Description |
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
Long polling to receive updates.
curl "https://api.telegram.org/bot${TOKEN}/getUpdates?offset=${OFFSET}&timeout=30"
| Parameter | Required | Description |
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
Long polling to receive updates.
curl "https://api.telegram.org/bot${TOKEN}/getUpdates?offset=${OFFSET}&timeout=30"
| Parameter | Required | Description |
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
Long polling to receive updates.
curl "https://api.telegram.org/bot${TOKEN}/getUpdates?offset=${OFFSET}&timeout=30"
| Parameter | Required | Description |
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
Long polling to receive updates.
curl "https://api.telegram.org/bot${TOKEN}/getUpdates?offset=${OFFSET}&timeout=30"
| Parameter | Required | Description |
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
Long polling to receive updates.
curl "https://api.telegram.org/bot${TOKEN}/getUpdates?offset=${OFFSET}&timeout=30"
| Parameter | Required | Description |
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
Long polling to receive updates.
curl "https://api.telegram.org/bot${TOKEN}/getUpdates?offset=${OFFSET}&timeout=30"
| Parameter | Required | Description |
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
Long polling to receive updates.
curl "https://api.telegram.org/bot${TOKEN}/getUpdates?offset=${OFFSET}&timeout=30"
| Parameter | Required | Description |
No suspicious patterns detected.