T09 · Insecure Skill Coding Practices
- Location
config.json:2- Finding
Hardcoded API Credential Distributed in Project Configuration
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill does what it says, but it ships a real-looking API key and gives broad, weakly warned control over where prompts, media, and credentials are sent.
Review before installing. Do not rely on the bundled config.json key, revoke or replace any exposed key, and only enter your own API keys when the base URL is an HTTPS endpoint you trust. Avoid sending sensitive prompts, images, or videos, especially on shared Streamlit hosts, because the skill forwards them to configured providers and may save or temporarily retain generated or uploaded media locally.
config.json:2Hardcoded API Credential Distributed in Project Configuration
skill_main.py:146Unrestricted API Endpoints Can Receive Credentials and Private Media
skill_main.py:386Predictable Shared Temporary Files Permit Collisions and Symlink-Based Overwrites
The skill explicitly markets itself as bypassing content filtering restrictions and operating with no safety middleware, which is a strong red flag under adversarial review. In the context of an AI media generation portal, this materially increases the likelihood of abuse for prohibited, harmful, or policy-evading content generation and indicates deliberate removal of safeguards rather than an incidental omission.
Advertising 'no content filtering, pure pass-through' is a safety-bypass posture that encourages use of the tool without moderation or policy enforcement, increasing the likelihood it will be used to generate abusive, unsafe, or policy-violating content. In an AI media generation skill, that context makes the statement more dangerous because the tool directly brokers user prompts to generation APIs and even supports prompt enhancement.
The README explicitly advertises 'no content filtering - pure pass-through to your API' and 'Local Save' behavior, but it does not clearly warn users that prompts, images, and generated outputs may be transmitted to third-party endpoints and written to local disk. In a skill context, this can lead to unsafe handling of sensitive data, policy-violating content generation, or unexpected filesystem side effects because users are encouraged to use a tool with reduced safeguards.
The documentation instructs users to send prompts and API keys to a remote third-party endpoint without any explicit privacy or security warning about off-device transmission. Because prompts may contain sensitive data and API keys are high-value secrets, omission of this warning can mislead users about confidentiality and increase the chance of accidental disclosure.
The skill instructs users to place API credentials in config.json and describes sending prompts and optional image URLs to external text and video APIs, but it does not clearly warn about the privacy and credential-handling implications. Users may unknowingly expose sensitive prompts, media inputs, or secrets through local plaintext storage and third-party transmission.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"age_enter": "I am 18+ - Enter", "age_exit": "Exit", "age_redirecting": "Redirecting...",
"main_title": "OpenLens", "main_subtitle": "Multi-Modal AI | T2I T2V I2V V2V",
"config_title": "Configuration", "global_settings": "Global Settings",
"global_api_url": "API Base URL", "global_api_url_placeholder": "https://api.openai.com/v1",
"text_model": "Text Model (Prompt)", "text_api_key": "Text API Key", "text_api_key_placeholder": "sk-...",
"text_model_name": "Model Name", "text_model_placeholder": "gpt-4o",
"t2i_model": "Image (T2I)", "t2i_api_key": "T2I API Key", "t2i_api_key_placeholder": "sk-...",
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"age_enter": "I am 18+ - Enter", "age_exit": "Exit", "age_redirecting": "Redirecting...",
"main_title": "OpenLens", "main_subtitle": "Multi-Modal AI | T2I T2V I2V V2V",
"config_title": "Configuration", "global_settings": "Global Settings",
"global_api_url": "API Base URL", "global_api_url_placeholder": "https://api.openai.com/v1",
"text_model": "Text Model (Prompt)", "text_api_key": "Text API Key", "text_api_key_placeholder": "sk-...",
"text_model_name": "Model Name", "text_model_placeholder": "gpt-4o",
"t2i_model": "Image (T2I)", "t2i_api_key": "T2I API Key", "t2i_api_key_placeholder": "sk-...",
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"age_enter": "I am 18+ - Enter", "age_exit": "Exit", "age_redirecting": "Redirecting...",
"main_title": "OpenLens", "main_subtitle": "Multi-Modal AI | T2I T2V I2V V2V",
"config_title": "Configuration", "global_settings": "Global Settings",
"global_api_url": "API Base URL", "global_api_url_placeholder": "https://api.openai.com/v1",
"text_model": "Text Model (Prompt)", "text_api_key": "Text API Key", "text_api_key_placeholder": "sk-...",
"text_model_name": "Model Name", "text_model_placeholder": "gpt-4o",
"t2i_model": "Image (T2I)", "t2i_api_key": "T2I API Key", "t2i_api_key_placeholder": "sk-...",
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"age_enter": "I am 18+ - Enter", "age_exit": "Exit", "age_redirecting": "Redirecting...",
"main_title": "OpenLens", "main_subtitle": "Multi-Modal AI | T2I T2V I2V V2V",
"config_title": "Configuration", "global_settings": "Global Settings",
"global_api_url": "API Base URL", "global_api_url_placeholder": "https://api.openai.com/v1",
"text_model": "Text Model (Prompt)", "text_api_key": "Text API Key", "text_api_key_placeholder": "sk-...",
"text_model_name": "Model Name", "text_model_placeholder": "gpt-4o",
"t2i_model": "Image (T2I)", "t2i_api_key": "T2I API Key", "t2i_api_key_placeholder": "sk-...",
The UI claims 'No API Keys stored', but the app places API keys into Streamlit session state for the lifetime of the session. Even if this is not long-term persistent storage, the statement is inaccurate and can mislead users into entering sensitive credentials under a false privacy assumption.
The localized Chinese footer repeats the same misleading claim that API keys are not stored, while they are retained in session state during app use. Misrepresenting secret handling is a security issue because it undermines informed consent and safe credential use.
The Japanese footer also states that API keys are not stored, but the application keeps them in Streamlit session state while the app runs. This discrepancy can cause users to trust the app with secrets they might not otherwise provide.
This call transmits user prompt content and the bearer API key to an external service. External transmission is expected for an AI client, but in this skill it is made riskier by the fully configurable api_url, which allows secrets and content to be sent to arbitrary destinations.
headers = make_headers(api_key)
payload = {"model": model, "messages":[{"role":"system","content":"Enhance prompt with cinematic details."},{"role":"user","content":prompt}], "temperature":0.7}
try:
r = requests.post(f"{api_url}/chat/completions", headers=headers, json=payload, timeout=60)
if r.status_code != 200: return handle_error(r)
return r.json()["choices"][0]["message"]["content"]
except Exception as e:
The application sends user prompts, uploaded media, media URLs, and API keys to a user-configurable external endpoint without an explicit disclosure or trust boundary warning. Because the base URL is configurable, the app can be pointed at arbitrary third-party servers, increasing the risk of sensitive data exfiltration or accidental disclosure.
This request sends the user's generation prompt and authorization token to an external image-generation endpoint. In context, the transmission is part of normal functionality, but it still presents a real disclosure risk because the destination is configurable and the user is not clearly warned about data sharing.
headers = make_headers(api_key)
payload = {"model": model, "prompt": prompt, "n":1, "size":"1024x1024"}
try:
r = requests.post(f"{api_url}/images/generations", headers=headers, json=payload, timeout=120)
if r.status_code != 200: return handle_error(r)
return {"url": r.json()["data"][0]["url"], "type": "image", "prompt": prompt}
except Exception as e:
This generic task submission sends arbitrary payloads, which in this app can include prompts plus image/video content or base64-encoded uploaded files, to an external endpoint along with bearer credentials. Because media may be sensitive and the endpoint is configurable, this creates a substantial exfiltration and privacy risk if misconfigured or abused.
"""提交异步任务"""
headers = make_headers(api_key)
try:
r = requests.post(f"{api_url}{endpoint}", headers=headers, json=payload, timeout=60)
if r.status_code != 200: return handle_error(r), None
data = r.json()
return data.get("task_id") or data.get("id"), data
The top-level documentation states the CLI is a 'pure pass-through' to the API, implying user input is forwarded unchanged. However, when --refine is enabled, the code sends the prompt through a separate text model with an instruction to transform and enhance it, then submits the modified prompt for video generation.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
for endpoint in [f"{api_url}/chat/completions", f"{api_url}/responses"]:
try:
resp = requests.post(endpoint, headers=headers, json=payload, timeout=60)
if resp.status_code == 200:
data = resp.json()
if "choices" in data:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
payload["input"]["img_url"] = image_url
log_msg(f"Submitting to {api_url}/video/generations...")
resp = requests.post(f"{api_url}/video/generations", headers=headers, json=payload, timeout=30)
if resp.status_code == 200:
data = resp.json()
The skill description advertises image/video generation via external APIs, and the config schema includes API URLs and API keys. The manifest does not warn that prompts and possibly media inputs may be transmitted to third-party endpoints, which is relevant to user privacy and data handling.
The manifest explicitly highlights absence of content filtering, which increases the likelihood of unsafe, offensive, or policy-sensitive outputs. There is no adjacent warning or disclaimer to inform users about this behavior or recommend appropriate use.
The app blindly dereferences an image URL returned by an external API and fetches it server-side. If the configured or compromised upstream API returns an internal, link-local, or cloud-metadata URL, this creates a server-side request forgery path and can expose internal services or sensitive data through the Streamlit host.
resp = requests.post(url, headers=_headers(api_key), json=payload, timeout=60)
resp.raise_for_status()
image_url = resp.json()["data"][0]["url"]
return requests.get(image_url, timeout=60).content
def submit_video_task(base_url: str, api_key: str, model: str,
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.
elif video_bytes:
files = {"video": ("source.mp4", video_bytes, "video/mp4")}
data = {**payload, "model": model}
resp = requests.post(url, headers=headers, data=data, files=files, timeout=60)
else:
resp = requests.post(url, headers=_headers(api_key), json=payload, timeout=60)
The app polls a remote task endpoint, extracts a video_url from the JSON response, and then fetches that URL without validation. A malicious or untrusted API endpoint can supply attacker-controlled URLs, enabling SSRF from the application server to internal network resources or sensitive metadata endpoints.
or (data.get("videos") or [{}])[0].get("video_url")
or data.get("output", {}).get("url")
)
return requests.get(video_url, timeout=120).content
if status in ("FAILED", "ERROR", "CANCELLED"):
raise RuntimeError(f"Task failed with status: {status}")
time.sleep(5)
The UI sends prompts and uploaded media to user-specified external endpoints but does not clearly disclose that this content will leave the local app/session. In a tool handling arbitrary images, videos, and unrestricted generation prompts, this can cause unintended disclosure of sensitive or proprietary user content.