Back to skill

Security audit

Ima Skill

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its IMA note and knowledge-base purpose, but its broad private-data access, unbounded URL retrieval, and credential-handling patterns warrant Review before installation.

Install only if you intend to let the agent access your IMA notes and knowledge bases and send selected files, URLs, and note content to IMA/Tencent services. Use restrictive permissions or a credential manager for API keys, avoid uploading sensitive files from untrusted URLs, and confirm any ambiguous request before reading, uploading, creating, or appending content.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (4)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
knowledge-base/SKILL.md:273
Finding

Unrestricted URL Retrieval Enables Server-Side Request Forgery and Data Exfiltration

Content
View full analysis
` 查看响应头 - `application/pdf` → PDF 文件 - `application/msword` 或 `application/vnd.openxmlformats-*` → Word/PPT/Excel 文件 - `text/html` → 网页 3. **已知文件型 URL 模式**: - `arxiv.org/pdf/*` → PDF - `*.pdf`、`*.docx`、`*.pptx`、`*.xlsx` 结尾 → 对应文件类型 - GitHub raw 文件链接 → 按扩展名判断 # 1. 探测 URL 类型 CONTENT_TYPE=$(curl -sI -L "https://arxiv.org/pdf/2603.12268" | grep -i "^content-type:" | tail -1 | awk '{print $2}' | tr -d '\r') # 2. 下载文件到临时目录 TEMP_DIR=$(mktemp -d) # 根据 Content-Type 或 URL 推断文件名和扩展名 curl -sL -o "$TEMP_DIR/paper.pdf" "https://arxiv.org/pdf/2603.12268" ``` ### Technical Analysis The workflow instructs the Agent to issue HTTP requests to a supplied URL and follow redirects with `curl -L`. It does not impose an HTTPS-only policy, destination allowlist, port restriction, DNS/IP validation, redirect limit, or rejection of loopback, link-local, private, reserved, and cloud metadata address ranges. The separate rejection of local `file://` HTML content does not prevent network requests to destinations such as: - Loopback services such as `127.0.0.1` or `::1` - Private network services - Link-local services - Cloud instance metadata endpoints - Public URLs that redirect to one of these destinations - Hostnames affected by DNS rebinding The downloaded response is subsequently eligible for the normal upload flow, which sends it to Tencent COS and associates it with an IMA knowledge base. This turns the issue into both an internal request primitive and a possible data-exfiltration path. ### Attack Path 1. An attacker provides a URL presented as a downloadabl ...[truncated 1296 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:37
Finding

Long-Lived IMA Credentials Are Stored Without Restrictive File Permissions

Content
View full analysis
~/.config/ima/client_id echo "your_api_key" > ~/.config/ima/api_key ``` ``` ### Technical Analysis The recommended setup writes the Client ID and API key directly into plaintext files. It neither creates the containing directory with mode `0700` nor creates the credential files with mode `0600`. The resulting permissions depend on the user's current `umask` and any pre-existing directory permissions. In a permissive or misconfigured environment, another local user or process may be able to read the API key. The API key grants access to private IMA note and knowledge-base operations. Unlike the temporary COS credentials used during an individual upload, this is a long-lived credential. ### Attack Path 1. A user follows the recommended file-based setup. 2. The user's `umask` or existing `~/.config/ima` permissions permit access by other local principals. 3. The Client ID and API key are created as plaintext files without an explicit restrictive mode. 4. Another local user, compromised process, backup job, or diagnostic collector reads `~/.config/ima/api_key`. 5. The credential is used to call the IMA OpenAPI as the victim until it is revoked or expires. ### Impact Assessment Credential disclosure may allow unauthorized searching and reading of private notes, browsing knowledge bases, importing external content, uploading files, creating notes, or irreversibly appending content to existing notes, subject to the permissions associated with the stolen credentials. The scope is the victim's IMA account and any knowledge bases accessible through that account. This issue does not independently provide operating-system privilege escalation. ]]>
Remediation
View remediation
"$HOME/.config/ima/client_id" printf '%s\n' "$IMA_API_KEY_INPUT" > "$HOME/.config/ima/api_key" ``` Additionally: 1. Check the ownership and permissions of existing credential files before using them. 2. Refuse to load files writable or readable by unauthorized principals. 3. Avoid accepting credentials through shell history. 4. Document credential rotation and revocation procedures. 5. Limit API-key privileges and lifetime where supported. 6. Exclude credential files from backups, diagnostics, and source-control tooling. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
knowledge-base/scripts/cos-upload.cjs:23
Finding

IMA and COS Credentials Are Exposed Through Process Command-Line Arguments

Content
View full analysis
" \ --secret-key "" \ --token "" \ --bucket "" \ --region "" \ --cos-key "" \ --content-type "$CONTENT_TYPE" \ --start-time "" \ --expired-time "" ``` The upload script explicitly consumes these values from `process.argv`: ```javascript const REQUIRED = ['file', 'secret-id', 'secret-key', 'token', 'bucket', 'region', 'cos-key']; const secretId = args['secret-id']; const secretKey = args['secret-key']; const { token } = args; ``` Its usage message also establishes command-line arguments as the supported secret transport: ```javascript console.error( `Usage: node cos-upload.cjs --file --secret-id --secret-key --token --bucket --region --cos-key [--content-type ] [--start-time ] [--expired-time ]`, ); ``` ### Technical Analysis Process arguments are not an appropriate transport for secrets. Depending on operating-system policy and container isolation, command lines may be observable through process-listing tools, `/proc ...[truncated 1543 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
knowledge-base/SKILL.md:164
Finding

Unsafe Filename Interpolation Allows JSON Request Manipulation

Content
View full analysis
\", \"file_ext\": \"$FILE_EXT\" }" # 6. add_knowledge — 将已上传的文件关联到知识库 ima_api "openapi/wiki/v1/add_knowledge" "{ \"media_type\": $MEDIA_TYPE, \"media_id\": \"\", \"title\": \"$FILE_NAME\", \"knowledge_base_id\": \"\", \"file_info\": { \"cos_key\": \"\", \"file_size\": $FILE_SIZE, \"file_name\": \"$FILE_NAME\" } }" ``` ### Technical Analysis `FILE_NAME` and `FILE_EXT` originate from the local file path. They are extracted from valid JSON but subsequently inserted directly into a manually assembled JSON string without JSON escaping. A filename can legally contain quotation marks, backslashes, line breaks, and other characters significant to JSON on supported platforms. Such characters can terminate the intended JSON string, make the request invalid, o ...[truncated 1744 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (21)

Vague Triggers

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The activation rules are overly broad and include generic phrases like '帮我记一下' and ordinary note-taking or document access intents, which can cause the skill to trigger when the user did not intend to access or transmit data to the IMA service. In a skill that reads local credentials and can upload/search personal notes and knowledge-base content, accidental invocation materially increases the risk of unintended data access or external transmission.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The natural-language instructions and invocation guidance are entirely written to operate in Chinese and include Chinese trigger phrases, but do not state that language choice is optional or limited to a region-specific use case. This can amount to a locale/language policy issue because the skill appears to assume a single language without user opt-in.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
93% confidence
Finding

The same credential setup block also encourages exporting API secrets into the shell environment, which can persist within user sessions and may be exposed through process inspection, shell history patterns, crash dumps, or inherited subprocess environments depending on platform and tooling. This broadens the attack surface for credential theft beyond the immediate API call.

Content

Scanner excerpt · SKILL.md (reported line 39)May include surrounding context.

方式 A — 配置文件(推荐):

bash
mkdir -p ~/.config/ima
echo "your_client_id" > ~/.config/ima/client_id
echo "your_api_key" > ~/.config/ima/api_key

Session Persistence

Medium
Category
Rogue Agent
Confidence
93% confidence
Finding

The same credential setup block also encourages exporting API secrets into the shell environment, which can persist within user sessions and may be exposed through process inspection, shell history patterns, crash dumps, or inherited subprocess environments depending on platform and tooling. This broadens the attack surface for credential theft beyond the immediate API call.

Content

Scanner excerpt · SKILL.md (reported line 39)May include surrounding context.

方式 A — 配置文件(推荐):

bash
mkdir -p ~/.config/ima
echo "your_client_id" > ~/.config/ima/client_id
echo "your_api_key" > ~/.config/ima/api_key

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 77)May include surrounding context.

md
# All requests go ONLY to the official IMA API (ima.qq.com)
ima_api() {
  local path="$1" body="$2"
  curl -s -X POST "https://ima.qq.com/$path" \
    -H "ima-openapi-clientid: $IMA_CLIENT_ID" \
    -H "ima-openapi-apikey: $IMA_API_KEY" \
    -H "Content-Type: application/json" \

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · SKILL.md (reported line 89)May include surrounding context.

md
## 模块决策表

| 用户意图                                                                                   | 模块           | 读取                      |
| ------------------------------------------------------------------------------------------ | -------------- | ------------------------- |
| 搜索笔记、浏览笔记本、获取笔记内容、创建笔记、追加内容                                     | notes          | `notes/SKILL.md`          |
| 上传文件、添加网页链接、搜索知识库、浏览知识库内容、获取知识库信息、获取可添加的知识库列表 | knowledge-base | `knowledge-base/SKILL.md` |

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill instructions are written in Chinese and present the behavior and user-facing guidance in a single mandated language. There is no indication that the user can choose another language or that the skill is limited to a Chinese-only regulatory or regional context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation explicitly instructs clients to send credential-bearing headers and later exposes temporary COS credentials, but it does not warn that these secrets must be handled as sensitive material or must never be surfaced to end users, logs, or untrusted downstream tools. In a skill context, this omission increases the chance that an agent or integrator will inadvertently disclose API keys or temporary cloud credentials while performing uploads to an external service.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The quick-decision workflow tells the agent to upload files and import URLs into a remote knowledge base, but it never warns that local files, document contents, and submitted URLs will be transmitted to an external service. In an agent skill, this matters because users may phrase requests casually ('帮我记一下', upload a file, save a page) without realizing their local or private content is leaving the local environment.

Content

No source excerpt is available for this finding.

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · knowledge-base/references/api.md (reported line 140)May include surrounding context.

md
### MediaType(媒体类型枚举)

| 值  | 名称           | content_type / 说明                                                                                           |
| --- | -------------- | ------------------------------------------------------------------------------------------------------------- |
| 1   | PDF            | `application/pdf`                                                                                             |
| 2   | 网页           | N/A(直接 AddKnowledge,`web_info.content_id=<url>`)                                                         |

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The file’s natural-language instructions, examples, and required user prompts are all in Chinese, including the title and interaction text. This can force a specific language/locale on users without opt-in, which matches the language-policy violation category when no choice or justification is provided.

Content

No source excerpt is available for this finding.

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · knowledge-base/references/api.md (reported line 152)May include surrounding context.

md
## 接口决策表

| 用户意图                                                                                                  | 调用接口                     | 关键参数                                                                      |
| --------------------------------------------------------------------------------------------------------- | ---------------------------- | ----------------------------------------------------------------------------- |
| 搜索/查找笔记                                                                                             | `search_note_book`           | `query_info`(QueryInfo 对象)                                                |
| 查看笔记本列表                                                                                            | `list_note_folder_by_cursor` | `cursor`(必填,首页传`"0"`) + `limit`(必填)                                   |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · notes/SKILL.md (reported line 15)May include surrounding context.

md
## 接口决策表

| 用户意图                                                                                                  | 调用接口                     | 关键参数                                                                      |
| --------------------------------------------------------------------------------------------------------- | ---------------------------- | ----------------------------------------------------------------------------- |
| 搜索/查找笔记                                                                                             | `search_note_book`           | `query_info`(QueryInfo 对象)                                                |
| 查看笔记本列表                                                                                            | `list_note_folder_by_cursor` | `cursor`(必填,首页传`"0"`) + `limit`(必填)                                   |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · knowledge-base/references/api.md (reported line 142)May include surrounding context.

md
| 用户意图                                                                                                  | 调用接口                     | 关键参数                                                                      |
| --------------------------------------------------------------------------------------------------------- | ---------------------------- | ----------------------------------------------------------------------------- |
| 搜索/查找笔记                                                                                             | `search_note_book`           | `query_info`(QueryInfo 对象)                                                |
| 查看笔记本列表                                                                                            | `list_note_folder_by_cursor` | `cursor`(必填,首页传`"0"`) + `limit`(必填)                                   |
| 浏览某笔记本里的笔记,当用户表述"最新"、"最近"之类的通用限定,没有指明笔记本时,都应该直接在全部笔记里去拉 | `list_note_by_folder_id`     | `folder_id`(选填,空为全部笔记本) + `cursor`(必填,首次传`""`) + `limit`(必填) |
| 读取笔记正文                                                                                              | `get_doc_content`            | `doc_id` + `target_content_format`(必填,推荐`0`纯文本)                       |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · notes/SKILL.md (reported line 17)May include surrounding context.

md
| 用户意图                                                                                                  | 调用接口                     | 关键参数                                                                      |
| --------------------------------------------------------------------------------------------------------- | ---------------------------- | ----------------------------------------------------------------------------- |
| 搜索/查找笔记                                                                                             | `search_note_book`           | `query_info`(QueryInfo 对象)                                                |
| 查看笔记本列表                                                                                            | `list_note_folder_by_cursor` | `cursor`(必填,首页传`"0"`) + `limit`(必填)                                   |
| 浏览某笔记本里的笔记,当用户表述"最新"、"最近"之类的通用限定,没有指明笔记本时,都应该直接在全部笔记里去拉 | `list_note_by_folder_id`     | `folder_id`(选填,空为全部笔记本) + `cursor`(必填,首次传`""`) + `limit`(必填) |
| 读取笔记正文                                                                                              | `get_doc_content`            | `doc_id` + `target_content_format`(必填,推荐`0`纯文本)                       |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · notes/SKILL.md (reported line 18)May include surrounding context.

md
| 用户意图                                                                                                  | 调用接口                     | 关键参数                                                                      |
| --------------------------------------------------------------------------------------------------------- | ---------------------------- | ----------------------------------------------------------------------------- |
| 搜索/查找笔记                                                                                             | `search_note_book`           | `query_info`(QueryInfo 对象)                                                |
| 查看笔记本列表                                                                                            | `list_note_folder_by_cursor` | `cursor`(必填,首页传`"0"`) + `limit`(必填)                                   |
| 浏览某笔记本里的笔记,当用户表述"最新"、"最近"之类的通用限定,没有指明笔记本时,都应该直接在全部笔记里去拉 | `list_note_by_folder_id`     | `folder_id`(选填,空为全部笔记本) + `cursor`(必填,首次传`""`) + `limit`(必填) |
| 读取笔记正文                                                                                              | `get_doc_content`            | `doc_id` + `target_content_format`(必填,推荐`0`纯文本)                       |
| 新建一篇笔记(用户明确说"新建/创建笔记"时走此接口)                                                       | `import_doc`                 | `content` + `content_format`(必填,固定`1`) + 可选 `folder_id`                |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · notes/SKILL.md (reported line 20)May include surrounding context.

md
| 搜索/查找笔记                                                                                             | `search_note_book`           | `query_info`(QueryInfo 对象)                                                |
| 查看笔记本列表                                                                                            | `list_note_folder_by_cursor` | `cursor`(必填,首页传`"0"`) + `limit`(必填)                                   |
| 浏览某笔记本里的笔记,当用户表述"最新"、"最近"之类的通用限定,没有指明笔记本时,都应该直接在全部笔记里去拉 | `list_note_by_folder_id`     | `folder_id`(选填,空为全部笔记本) + `cursor`(必填,首次传`""`) + `limit`(必填) |
| 读取笔记正文                                                                                              | `get_doc_content`            | `doc_id` + `target_content_format`(必填,推荐`0`纯文本)                       |
| 新建一篇笔记(用户明确说"新建/创建笔记"时走此接口)                                                       | `import_doc`                 | `content` + `content_format`(必填,固定`1`) + 可选 `folder_id`                |
| 往已有笔记追加内容(⚠️ **敏感操作**:用户必须明确指定目标笔记,否则先确认再操作)                          | `append_doc`                 | `doc_id` + `content` + `content_format`(必填,固定`1`)                        |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · notes/references/api.md (reported line 91)May include surrounding context.

md
#### SearchedDoc

| 字段             | 类型                  | 说明                                                                                       |
| ---------------- | --------------------- | ------------------------------------------------------------------------------------------ |
| `doc`            | DocBasicInfo          | 笔记 basic 数据,见 [DocBasicInfo](#docbasicinfo)                                          |
| `highlight_info` | map\<string, string\> | 该条笔记匹配的高亮词,key: `doc_title`(文档标题),value: 包含 `<em>高亮词</em>` 的字段值 |

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The search-note trigger guidance includes very broad phrases like “搜索” and “查找”, which can cause the skill to activate for generic search requests unrelated to private notes. In a skill that can read user note metadata and content, overbroad invocation increases the risk of unintended access to sensitive personal data or use of the wrong tool without clear user intent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The notebook-list trigger description uses ambiguous phrases such as “有哪些分类” and “查看笔记本目录”, which may overlap with non-note organizational tasks. Because this skill exposes private notebook structure, vague routing criteria can cause accidental disclosure of notebook names, hierarchy, and note counts when the user did not clearly request access to notes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The API response example uses Chinese errmsg values and line L420 explicitly says to show errmsg directly to the user. This creates a locale policy issue because the skill mandates a specific language for user-visible output without opt-in or documented regional constraint.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.