T09 · Insecure Skill Coding Practices
- Location
scripts/iflow_common.py:20- Finding
Bearer Credentials Can Be Redirected to an Arbitrary API Endpoint
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a real iflow knowledge-base integration, but it grants broad remote storage, sharing, deletion, and credentialed API authority with several under-scoped safety controls.
Review this skill before installing. Use it only for content you are comfortable sending to iflow, avoid secrets or regulated data, pin installer versions, store the API key with restrictive permissions, keep IFLOW_BASE_URL unset unless you fully trust the endpoint, and require explicit confirmation before all-file generation, sharing links, imports, and any delete or batch-delete action.
scripts/iflow_common.py:20Bearer Credentials Can Be Redirected to an Arbitrary API Endpoint
scripts/pipeline_web_search.py:52Unvalidated Search Report URL Enables Server-Side Request Forgery and Data Relay
README.md:37Recommended API-Key Storage Does Not Enforce Restrictive File Permissions
README.md:20Installation Instructions Execute an Unpinned Third-Party Package
The declared purpose emphasizes broad knowledge-base assistance, but the documented behavior includes destructive file deletion and renaming flows that are not clearly surfaced in the high-level description. That mismatch can mislead users and orchestration layers about the real risk profile, causing destructive operations to be triggered under a benign-seeming skill label.
The trigger conditions are extremely broad and match ordinary phrases like '记一下', '帮我记个笔记', or '存一下这个信息', causing the skill to activate for common conversation that may not imply consent to external storage or content generation. In this context, over-triggering is dangerous because the skill can upload user text, files, or URLs to a remote service and even create/share knowledge-base artifacts.
The skill documents that if no files are specified, generation should use the entire knowledge base by default. That creates a clear data-minimization and unintended disclosure risk, because a vague request can cause all stored documents to be processed and potentially surfaced in generated outputs without the user realizing the scope.
The instruction to not ask the user and to directly use all files materially increases the chance of silent over-collection. In a knowledge-base skill, users may store mixed personal, internal, or confidential content, so automatic inclusion of all files can expose unrelated sensitive material in reports, PPTs, podcasts, or other generated artifacts.
File contents flow to a network sink. This may indicate data exfiltration of sensitive files.
if file_path:
data = {"collectionId": collection_id, "type": file_type}
files = {"file": (os.path.basename(file_path), open(file_path, "rb"))}
r = requests.post(f"{BASE_URL}/api/v1/knowledge/upload", data=data, files=files,
headers=headers, timeout=(10, 120))
resp = r.json()
files["file"][1].close()
File contents flow to a network sink. This may indicate data exfiltration of sensitive files.
("content", (None, url)),
("file", ("", b"")), # 空文件,兼容 type=HTML 时需要 file 字段
]
r = requests.post(f"{BASE_URL}/api/v1/knowledge/upload", files=files,
headers=headers, timeout=(10, 120))
resp = r.json()
else:
The README advertises delete and batch-management capabilities for notebooks and files but does not warn about irreversible or hard-to-reverse data loss. In an agentic setting, destructive actions may be triggered from natural-language requests, so omission of deletion safeguards increases the risk of accidental loss of user knowledge-base contents.
The README describes file upload, URL import, web search, and content generation through an external service without warning that user files, URLs, search queries, and generated content may be transmitted to third-party APIs. In this skill’s context, that is materially risky because users may provide confidential documents or sensitive research notes, and broad trigger behavior makes unintended transmission more likely.
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
### 1. Get an API Key
Visit [platform.iflow.cn](https://platform.iflow.cn/profile?tab=apiKey) to create your API key.
### 2. Configure Credentials
The example and surrounding trigger guidance are overly broad and include ordinary note-taking language such as recording daily expenses, which can cause the agent to invoke this skill for routine user inputs that do not clearly imply external storage or content generation. In this skill’s context, that increases the chance of silently transmitting personal notes or incidental sensitive information to the iflow service without sufficiently explicit user intent.
The skill documents use of environment variables, local config files, shell commands, file operations, and outbound network access, but it declares no explicit tool scope or allowed-tools boundary. This creates excessive implicit authority: an agent may grant the skill broader capabilities than necessary, increasing the blast radius if the instructions are misused or if prompt injection occurs through user content or imported web pages.
The setup recommends persisting the API key in a plaintext file under ~/.config/iflow-nb/api_key. Plaintext secret storage increases exposure to local compromise, accidental backup/sync leakage, or unintended reads by other tools and skills with file access.
# 方式 A — 配置文件(推荐)
mkdir -p ~/.config/iflow-nb && echo "your_api_key" > ~/.config/iflow-nb/api_key
# 方式 B — 环境变量
export IFLOW_API_KEY="your_api_key"
The sharing feature creates a link exposing a read-only snapshot of the entire knowledge base and generated outputs, but the flow lacks a strong user-facing privacy warning at the point of action. Because knowledge bases may contain sensitive notes, uploaded files, and generated reports, accidental sharing could disclose substantial private or proprietary information.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
iflow_api() {
local method="$1" path="$2" body="$3"
if [ "$method" = "GET" ]; then
curl -s -X GET "${IFLOW_URL}${path}" \
-H "Authorization: Bearer $IFLOW_KEY" \
-H "Content-Type: application/json"
else
The entire skill example, including user input, workflow instructions, and user-facing output, is written exclusively in Chinese with no indication that language selection is optional or configurable. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is clearly documented and justified.
The file presents all user-facing instructions, examples, and confirmation text exclusively in Chinese. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly documented and justified, which it is not here.
Suspicious Unicode normalization or mixed-script content
The example instructs the agent to immediately create and return a share link for an entire knowledge base, while only mentioning the exposure scope afterward. This can cause unintended disclosure because a user may not realize the link grants read access to all files and generated content in the shared knowledge base before the action is performed.
The example instructs the agent to write user-pasted content to a local temporary file and then upload it to a remote knowledge base, but it does not require any user notice, consent, or data-sensitivity check before local persistence and network transmission. In a knowledge-management skill, pasted content may contain meeting notes, personal data, credentials, or confidential business information, so silent staging on disk and upload increases privacy and data-handling risk.
The example instructs the agent to automatically import externally gathered research results and generate derivative artifacts without any explicit user confirmation, retention notice, or warning about persistence. This can cause unintended storage of third-party or sensitive content, trigger side effects the user did not clearly authorize, and increase privacy, compliance, and provenance risks because searched content is persisted into a knowledge base and reused for report generation.
The example establishes a default workflow where web search results are automatically imported into a knowledge base and then used to generate a report unless the user explicitly asks for a search-only mode. This can cause unintended persistence of third-party content, sensitive queries, or inappropriate material, and may trigger downstream actions with cost, privacy, or compliance consequences without clear user confirmation.
The skill explicitly documents a bulk-delete endpoint for files but does not attach the same clear user-confirmation warning that it applies to other destructive actions such as deleting a knowledge base or a single file. In an agent setting, that omission increases the chance the agent performs irreversible mass deletion from a loosely phrased user request or from ambiguous context without a second confirmation step.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
}"
> **⚠️ 超时设置**:由于接口可能较慢,使用 curl 直接调用时需加 `--max-time 120`:
> ```bash
> curl -s --max-time 120 -X POST "${IFLOW_URL}/api/v1/knowledge/searchChunk" \
> -H "Authorization: Bearer $IFLOW_KEY" \
The API documents a destructive knowledge-base deletion operation as idempotent and straightforward, but provides no guidance that callers should obtain explicit user confirmation or warn about irreversible data loss. In an agent skill that can act on natural-language requests, this increases the risk that ambiguous prompts, prompt injection, or misclassification could trigger permanent deletion without the user's informed consent.
No suspicious patterns detected.