T09 · Insecure Skill Coding Practices
- Location
assets/run-discord.sh:3- Finding
Hardcoded Discord, Telegram, and Master API Credentials
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill’s media-generation purpose is recognizable, but it ships privileged service credentials and unsafe API-key distribution code that users should review before installing.
Do not install this skill in a sensitive environment unless the publisher removes and rotates the exposed bot/master credentials, separates key provisioning from the generation client, fixes secret delivery/storage, restores TLS verification, and makes TinyURL shortening opt-in with clear disclosure.
assets/run-discord.sh:3Hardcoded Discord, Telegram, and Master API Credentials
assets/discord-bot.py:32Issued API Keys Stored in a Plaintext JSON File
assets/telegram-bot.py:143API Keys Disclosed to Public Chats When Direct Messaging Fails
scripts/digen_ai_client.py:330TLS Certificate Verification Disabled for Credential-Bearing API Requests
scripts/digen_ai_client.py:103Generated Video URLs Automatically Disclosed to TinyURL
scripts/batch_generate.py:14Legacy API Credentials Passed Through Process Command-Line Arguments
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
def create_api_key() -> str:
"""Create a new API key using master key"""
try:
r = requests.post(
f"{API_BASE}/b/v1/api-key/create",
headers={"Authorization": f"Bearer {MASTER_API_KEY}"},
timeout=30
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
def create_api_key() -> str:
"""Create a new API key using master key"""
try:
r = requests.post(
f"{API_BASE}/b/v1/api-key/create",
headers={"Authorization": f"Bearer {MASTER_API_KEY}"},
timeout=30
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
GET /b/v1/api-key
"""
try:
resp = requests.get(
f"{NEW_API_BASE}/b/v1/api-key",
headers={"Authorization": f"Bearer {api_key}"},
timeout=10
Creating and distributing API keys, storing user-to-key mappings, and using a master API key are materially different from performing media generation. Bundling those provisioning functions into a user-facing skill increases the blast radius of compromise and could expose sensitive issuance workflows or user records to an environment that only needed generation access.
Creating and distributing API keys, storing user-to-key mappings, and using a master API key are materially different from performing media generation. Bundling those provisioning functions into a user-facing skill increases the blast radius of compromise and could expose sensitive issuance workflows or user records to an environment that only needed generation access.
Creating and distributing API keys, storing user-to-key mappings, and using a master API key are materially different from performing media generation. Bundling those provisioning functions into a user-facing skill increases the blast radius of compromise and could expose sensitive issuance workflows or user records to an environment that only needed generation access.
Creating and distributing API keys, storing user-to-key mappings, and using a master API key are materially different from performing media generation. Bundling those provisioning functions into a user-facing skill increases the blast radius of compromise and could expose sensitive issuance workflows or user records to an environment that only needed generation access.
Creating and distributing API keys, storing user-to-key mappings, and using a master API key are materially different from performing media generation. Bundling those provisioning functions into a user-facing skill increases the blast radius of compromise and could expose sensitive issuance workflows or user records to an environment that only needed generation access.
The file's stated purpose is API-key distribution via Discord, which materially differs from the skill metadata claiming image/video generation functionality. That mismatch is dangerous because it introduces credential brokerage behavior not justified by the declared skill purpose, increasing the chance of unauthorized key issuance, abuse of paid backend resources, and deceptive installation expectations.
If DM delivery fails in mykey, the exception handler sends the embed containing the full API key back to the invoking channel, which may be public. That can immediately expose a user's credential to other channel members, enabling misuse of their quota or impersonation against the upstream API.
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
</style>
</head>
<body>
<!-- Nav -->
<nav class="nav">
<a href="#" class="nav-brand">
<div class="nav-logo">⚡</div>
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
</div>
</section>
<!-- Commands -->
<section class="commands" id="commands">
<div class="section-header">
<h2 data-i18n="commands.title">Supported Commands</h2>
The script hardcodes and exports a Discord bot token and a master API key directly in plaintext. Anyone with access to the repository, skill package, logs, or copied script can extract these credentials and use them to impersonate the bot, access associated services, or consume privileged APIs without authorization. In this skill context, the danger is heightened because the keys appear to grant access to external messaging and generation infrastructure, which could enable account takeover, abuse of paid services, spam, or further compromise.
The script hardcodes and exports a Telegram bot token and a master API key, then launches a Telegram bot from within the skill bundle. This creates immediate credential exposure and introduces remote bot-control functionality unrelated to the declared image/video generation purpose, which materially increases the likelihood of unauthorized access, account abuse, and covert command-and-control behavior.
Exporting sensitive credentials directly in a shipped shell script exposes them to anyone with file access and to child processes, with no warning to the user. In this skill's context, the undisclosed presence of operational secrets is especially dangerous because users would not expect credentialed external-service access to be embedded in a local helper script.
The script directly exports a Telegram bot token and a master API key in plaintext, exposing highly sensitive credentials to anyone with file access and to downstream processes. Hard-coded secrets are easily leaked through source control, logs, process inspection, or redistribution of the skill package, enabling account takeover and abuse of external services.
The file implements a Telegram bot for API-key distribution, while the skill metadata describes an image/video generation capability. This mismatch is dangerous because it introduces credential-issuance behavior into a skill context where users may not expect account provisioning or secret handling, increasing the risk of abuse and undisclosed data flows.
A hardcoded fallback master API key is embedded directly in source code. Anyone with access to the repository, package, logs, or deployed artifact could extract it and mint arbitrary user keys, resulting in full compromise of the associated API account and potentially unbounded abuse.
File contents flow to a network sink. This may indicate data exfiltration of sensitive files.
timeout=60
)
elif method.upper() == "GET":
resp = requests.get(url, headers=self._new_headers(),
params=data or {}, timeout=30)
else:
resp = requests.request(method, url,
File contents flow to a network sink. This may indicate data exfiltration of sensitive files.
url = f"{OLD_API_BASE}{endpoint}"
try:
if method.upper() == "GET":
resp = requests.get(url, headers=self._old_headers(),
params=data or {}, timeout=30, verify=False)
else:
resp = requests.post(url, headers=self._old_headers(),
File contents flow to a network sink. This may indicate data exfiltration of sensitive files.
resp = requests.get(url, headers=self._old_headers(),
params=data or {}, timeout=30, verify=False)
else:
resp = requests.post(url, headers=self._old_headers(),
json=data or {}, timeout=60, verify=False)
return resp.json()
except requests.exceptions.RequestException as e:
The skill advertises code-capable components and external scripts that appear to require environment access, file operations, network access, and possibly shell execution, yet it declares no explicit tool scope or permissions. In an agent environment, this can result in over-privileged execution and make it harder to review or constrain what the skill is allowed to do.
Broad trigger phrases like 'generate image', 'generate video', or 'Digen AI' can cause accidental or overly frequent invocation, especially in conversational systems where similar phrases arise naturally. Unintended activation can lead to surprise network calls, external data transmission, and unexpected credit consumption.
The skill documents image upload and remote generation against third-party APIs but does not prominently warn that prompts, images, and possibly metadata will be transmitted to external services. This is dangerous from a privacy and data-governance perspective because users may unknowingly send sensitive content off-platform.
This code implements account interaction, persistent user tracking, and API-key provisioning rather than the advertised generation capability. In skill context, unrelated credential-issuance logic is riskier because users and reviewers may not expect storage of Discord identifiers and distribution of reusable API secrets.