T09 · Insecure Skill Coding Practices
- Location
blog-mini-ljt.py:55- Finding
Administrator credentials and session tokens are transmitted over plaintext HTTP
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a disclosed blog API manager, but it can modify, upload, and permanently delete remote content through a default plaintext HTTP service with weak credential handling and limited safeguards.
Install only if you control and trust the target blog API. Prefer configuring an HTTPS base URL you own, rotate or disable any admin/admin default account, avoid passing real passwords or tokens on command lines, require manual confirmation before deletes or uploads, and do not let the agent upload arbitrary local paths.
blog-mini-ljt.py:55Administrator credentials and session tokens are transmitted over plaintext HTTP
blog-mini-ljt.py:298Unrestricted local file paths can be uploaded to a remote server
SKILL.md:37Known default administrator credentials are published and used in operational examples
requirements.txt:1Third-party dependency is not reproducibly pinned
This endpoint exposes a destructive delete action over a no-auth public API, allowing article removal by supplying only an article ID and an optional hard-delete flag. In the skill's context, an agent can be induced to delete arbitrary content with minimal friction, making parameter abuse and unauthorized destructive operations highly plausible.
**Body 字段**:`title`(str,可选), `content`(str,可选), `lid`(int,可选), `img`(str,可选), `heat`(int,可选)。至少传一个字段。
**响应**:`{"code":200,"message":"文章更新成功"}`
### 1.6 DELETE /api/articles/{id} — 删除文章
| 项 | 值 |
|---|---|
The comment deletion endpoint allows destructive state changes based solely on a comment ID and appears to be part of the unauthenticated public API. This makes it easy for an agent or attacker to remove user-generated content without ownership checks or operator awareness.
**响应**:`{"code":200,"data":[{"id":1,"uid":1,"aid":3,"content":"...","deleted":0,"createtime":"...","uname":"admin","img":"img/moren.jpg"}]}`
### 2.3 DELETE /api/comments/{id} — 删除评论(软删除)
| 项 | 值 |
|---|---|
The message deletion endpoint performs a destructive action using only a message ID and is described within the public API surface. In an agent setting, this is susceptible to prompt-driven abuse or accidental moderation actions against arbitrary messages.
**Body 字段**:`uid`(int,必填), `mid`(int,必填,被回复的留言 ID), `content`(str,必填)
**响应**:`{"code":200,"data":{"id":1}}`
### 4.4 DELETE /api/messages/{id} — 删除留言(软删除)
| 项 | 值 |
|---|---|
The mood deletion endpoint is explicitly irreversible, yet the documentation provides no strong caution or procedural safeguard. For agent-driven use, undocumented or weakly signaled irreversible actions materially raise the risk of permanent data loss from mistakes or malicious prompting.
This endpoint hard-deletes mood entries irreversibly by ID, with no indication of authentication or guardrails on the public API. The combination of irreversible deletion and low-friction invocation makes this a dangerous primitive for agent misuse or external abuse.
**Body 字段**:`content`(str,必填), `title`(str,默认""), `src`(str,默认"")
**响应**:`{"code":200,"data":{"id":1}}`
### 5.3 DELETE /api/moods/{id} — 删除说说
| 项 | 值 |
|---|---|
Deleting uploaded files by filename is a high-risk operation because files are shared assets that may be referenced by posts or pages, and the documented API appears unauthenticated. In an agent workflow, a simple filename parameter can be abused to remove important assets and disrupt site integrity.
**响应**:`{"code":200,"data":[{"filename":"xxx.png","url":"/uploads/xxx.png","type":"image","size":12345}]}`
### 6.4 DELETE /api/uploads/{filename} — 删除已上传文件
| 项 | 值 |
|---|---|
The admin bulk hard-delete endpoint enables irreversible deletion of multiple articles, yet the documentation lacks strong warning language or operational safeguards. In an agent-integrated skill, this creates a high-risk primitive that could be abused or triggered mistakenly for large-scale destructive impact.
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
# 1. 项目知识优先
creds.update(_load_from_project_knowledge())
# 2. 环境变量回退
for k, v in os.environ.items():
u = k.upper()
if u.startswith(_CRED_PREFIX) and 'BASE_URL' in u:
creds.setdefault('base_url', v)
The skill exposes capabilities that can read project files, access environment-derived configuration, and make network requests, but it does not declare any explicit tool scope such as allowed-tools or permissions. That mismatch weakens enforcement boundaries and can let an agent use broader capabilities than a reviewer or runtime policy expects, especially because the skill also instructs reading .project-info/ and contacting a default remote API.
This section presents deletion and file-upload capabilities as routine operations without requiring user confirmation, safety checks, or a warning about side effects. In an agent setting, that increases the chance of accidental destructive actions or unintended exfiltration of local files when a prompt ambiguously asks the agent to 'clean up' or 'upload' content.
The skill documents hard-delete behavior for moods, uploads, and admin bulk deletion, but does not prominently warn that these actions are irreversible or require confirmation. Because the skill is designed for full lifecycle management and includes bulk admin deletion, an agent could permanently remove substantial content with a single misunderstood instruction.
The documentation presents the skill as a no-auth public API while also exposing authenticated admin functionality, including login and token handling. This mismatch can cause an agent or operator to treat privileged operations as broadly safe and automatic, increasing the chance of unauthorized or unsafe administrative actions, especially given the documented default admin/admin credentials.
The skill documents article deletion, including optional hard delete behavior, without requiring any warning, confirmation, or safety guidance. In an agent context, this makes destructive actions easy to invoke accidentally or through prompt manipulation, leading to avoidable content loss.
Uploaded-file deletion permanently removes stored assets and may break linked content, but the docs do not warn about those consequences. In a content-management skill, file deletion can have cascading operational impact when an agent acts on incomplete context.
Natural-language descriptions, help text, error messages, and rendered Markdown are consistently hard-coded in Chinese throughout the skill. There is no indication that the user can opt into another language or locale, which can violate language/locale choice policies.
The skill presents itself as an unauthenticated public API tool while also exposing privileged admin login/logout and token-based deletion functions. This mismatch can cause an agent or operator to invoke sensitive administrative actions under a false assumption of low risk, increasing the chance of credential submission and destructive operations against a remote system.
The code advertises auth_type as 'none' even though it contains token-based admin authentication flows and administrative delete operations. Misstating the authentication model is dangerous because downstream agents may treat the tool as safe for autonomous use, leading to accidental credential handling or unauthorized destructive requests.
This POST path transmits user-supplied content to an external server, including article text, comments, messages, credentials in some flows, or file uploads depending on the command. External transmission is expected for an API client, but in this skill it is materially risky because it targets a remote default host and includes sensitive/destructive operations without strong guardrails.
if method == 'GET':
resp = requests.get(url, params=params, timeout=30, **auth_kwargs)
elif method == 'POST':
resp = requests.post(url, json=payload, files=files, timeout=30, **auth_kwargs)
elif method == 'PUT':
resp = requests.put(url, json=payload, files=files, timeout=30, **auth_kwargs)
elif method == 'PATCH':
This PUT path sends update payloads to an external server, enabling remote modification of blog content and potentially disclosing sensitive text entered locally. Although outbound API calls are normal for this type of tool, the combination of silent transmission and privileged content-management actions makes the behavior security-relevant in an autonomous-agent context.
elif method == 'POST':
resp = requests.post(url, json=payload, files=files, timeout=30, **auth_kwargs)
elif method == 'PUT':
resp = requests.put(url, json=payload, files=files, timeout=30, **auth_kwargs)
elif method == 'PATCH':
resp = requests.patch(url, json=payload, timeout=30, **auth_kwargs)
elif method == 'DELETE':
The upload commands read arbitrary local file paths and transmit file contents to a remote server without any explicit disclosure warning, confirmation step, or path restrictions. In an agent setting, this creates a clear risk of unintended exfiltration of sensitive local workspace files if prompted by untrusted content or user ambiguity.
The admin-login command sends administrator credentials to a remote server and harvests a session token from cookies without any explicit consent checkpoint or trust validation for the destination. This is especially risky because the base URL may come from environment or project files, so an agent could be tricked into posting credentials to an attacker-controlled endpoint.
This markdown file documents a UserCreate payload including pwd, phone, and email, but it does not warn users that they are supplying sensitive personal data and credentials to the skill/API. Under the markdown-specific SQP-2 criteria, descriptions that involve privacy-impacting behavior should disclose that such data will be transmitted or handled.
This JSON manifest embeds user-facing descriptions and notes entirely in Chinese, including test case descriptions and operational notes, without indicating that language selection is optional. Under the policy, forcing a specific language or locale without user opt-in is a natural-language policy violation unless clearly justified as region-specific.
The metadata explicitly states the API is public/unauthenticated while also advertising an administrative login with default credentials (admin/admin). This creates a clear insecure-defaults condition: agents or users may access privileged functions without proper secret management, and exposed default admin credentials are commonly abused for takeover of content, users, and backend settings.
The prescribed issue/PR comment format and quoted reply template are written as fixed Chinese output strings, and the document does not offer the user a language or locale choice. This can violate language/locale policy when used with users expecting another language.
Detected: suspicious.secret_argv_exposure