Back to skill

Security audit

Feishu Bitable API

Security checks for vulnerabilities and agentic risk

Overview

This is mostly a real Feishu Bitable API client, but it needs review because it can modify or delete live business data and has weak guardrails around credentials, file inputs, and request destinations.

Install only after review if you need write-capable Feishu Bitable automation. Use a least-privilege Feishu app, keep credentials out of source control and logs, test on non-production tables first, confirm app/table/record IDs before delete operations, avoid passing @file paths to sensitive local files, and do not let untrusted input configure the API baseURL.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
src/api.js:12
Finding
Caller-Controlled API Origin Can Receive Feishu Bearer Tokens<![CDATA[ ## Vulnerability Details **File Location**: `src/api.js`, lines 12–35 **Vulnerability Type**: Unrestricted authenticated API endpoint configuration **Risk Level**: Medium ### Vulnerable Code ```js this.baseURL = options.baseURL || 'https://open.feishu.cn/open-apis/bitable/v1'; this.accessToken = options.accessToken; this.autoRefreshToken = options.autoRefreshToken !== false; if (!this.appId || !this.appSecret) { throw new Error('缺少FEISHU_APP_ID或FEISHU_APP_SECRET环境变量'); } this.client = axios.create({ baseURL: this.baseURL, timeout: 30000, headers: { 'Content-Type': 'application/json; charset=utf-8' } }); // 请求拦截器:添加认证头 this.client.interceptors.request.use(async (config) => { if (!this.accessToken) { await this.refreshAccessToken(); } config.headers.Authorization = `Bearer ${this.accessToken}`; return config; }); ``` ### Technical Analysis The exported `FeishuBitableAPI` constructor accepts an unrestricted `options.baseURL`. The Axios request interceptor subsequently adds a valid Feishu bearer token to every request sent through the configured client. There is no validation requiring the destination to use HTTPS or belong to the expected `open.feishu.cn` origin. Consequently, a programmatic caller that can influence constructor options can redirect authenticated API requests to an arbitrary server. The bundled CLI does not expose `baseURL`, which reduces direct exploitability through normal command-line usage. However, `src/api.js` is also the package's main exported interface, so applications integrating the package programmatically may pass configuration from environment files, user input, or another untrusted source. ### Attack Path 1. An application imports the package and constructs `FeishuBitableAPI` with externally influenced options. 2. An attacker causes `options.baseURL` to reference an attacker-controlled server. 3. The client obtains a tenant access token using the configured Feishu application ID and s ...[truncated 973 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove support for a configurable API origin if custom Feishu endpoints are not a functional requirement. 2. If endpoint configuration is required, parse the URL and enforce an exact allowlist: - Require the `https:` scheme. - Require the hostname to be exactly `open.feishu.cn`. - Reject embedded credentials, unexpected ports, and look-alike subdomains. 3. Validate the final request URL inside the request interceptor before adding the `Authorization` header. 4. Keep authentication and Bitable API clients separate so that credentials cannot be attached automatically to arbitrary destinations. 5. Reject absolute request URLs that override the configured trusted origin. 6. Add tests proving that bearer tokens are never attached to HTTP requests or requests to unapproved hosts. 7. Ensure applications embedding this library do not populate endpoint options from untrusted input. An appropriate defense-in-depth pattern is: ```js const TRUSTED_ORIGIN = 'https://open.feishu.cn'; const configuredUrl = new URL( options.baseURL || `${TRUSTED_ORIGIN}/open-apis/bitable/v1` ); if ( configuredUrl.protocol !== 'https:' || configuredUrl.origin !== TRUSTED_ORIGIN ) { throw new Error('Untrusted Feishu API endpoint'); } this.client.interceptors.request.use(async (config) => { const finalUrl = new URL(config.url, configuredUrl); if (finalUrl.origin !== TRUSTED_ORIGIN) { throw new Error('Refusing to send credentials to an untrusted origin'); } if (!this.accessToken) { await this.refreshAccessToken(); } config.headers.Authorization = `Bearer ${this.accessToken}`; return config; }); ``` ]]>

T08 · Insecure Dependencies

Note
Location
package-lock.json:25
Finding
Dependency Lockfile Uses a Third-Party Package Registry Mirror<![CDATA[ ## Vulnerability Details **File Location**: `package-lock.json`, lines 25–319 **Vulnerability Type**: Third-party dependency source and supply-chain trust risk **Risk Level**: Low ### Vulnerable Code Representative direct dependency entries include: ```json "node_modules/axios": { "version": "1.13.4", "resolved": "https://registry.npmmirror.com/axios/-/axios-1.13.4.tgz", "integrity": "sha512-1wVkUaAO6WyaYtCkcYCOx12ZgpGf9Zif+qXa4n+oYzK558YryKqiL6UWwd5DqiH3VRW0GYhTZQ/vlgJrCoNQlg==", "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.4", "proxy-from-env": "^1.1.0" } }, "node_modules/commander": { "version": "11.1.0", "resolved": "https://registry.npmmirror.com/commander/-/commander-11.1.0.tgz", "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", "license": "MIT", "engines": { "node": ">=16" } }, "node_modules/dotenv": { "version": "16.6.1", "resolved": "https://registry.npmmirror.com/dotenv/-/dotenv-16.6.1.tgz", "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", "license": "BSD-2-Clause", "engines": { "node": ">=12" }, "funding": { "url": "https://dotenvx.com" } } ``` The transitive dependencies in the lockfile are also resolved through `registry.npmmirror.com`. ### Technical Analysis The committed lockfile directs package installation to a third-party registry mirror rather than npm's canonical registry. Users following the documented `npm install` instruction therefore depend on that mirror's infrastructure, distribution controls, and availability. The included SHA-512 integrity values are an important mitigation: npm should reject downloaded archives that do not match the committed hashes. This substantially limits silent package substitution when the lockfile remains trusted. However, it does not eliminate denial-of-service ri ...[truncated 1632 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Configure npm to use the canonical registry: ```bash npm config set registry https://registry.npmjs.org/ ``` 2. Regenerate and review the lockfile against that registry: ```bash rm package-lock.json npm install --package-lock-only ``` 3. Commit the regenerated lockfile and verify that its `resolved` entries use `https://registry.npmjs.org/`. 4. Use `npm ci` in CI/CD and deployment environments to enforce reproducible installation from the reviewed lockfile. 5. Retain and verify package integrity hashes. 6. Pin reviewed dependency versions where predictable builds are required instead of relying solely on broad semver ranges. 7. Run dependency vulnerability and provenance checks during release workflows. 8. Protect changes to `package.json` and `package-lock.json` through code review and repository branch controls. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (35)

Tp4

High
Category
MCP Tool Poisoning
Confidence
88% confidence
Finding
整体上代码确实围绕飞书多维表格 API 展开,并覆盖了数据表与记录的多种 CRUD/读取能力,因此与声明主题大体相关。但声明称“用于创建、读取、更新和删除飞书多维表格的数据表、记录和字段”,而实际代码并未实现字段的创建、更新、删除,只实现了字段列表读取;同时还实现了若干未在声明中体现的能力:连接测试、获取应用信息、列出视图、批量创建记录。由于这些属于对外可用的实际功能,且声明对字段 CRUD 的表述又高于实际实现,描述与行为并不完全准确,构成不匹配。

Tool Parameter Abuse

High
Category
Tool Misuse
Content
- `GET /bitable/v1/apps/{app_token}/tables` - 获取数据表列表
- `POST /bitable/v1/apps/{app_token}/tables` - 创建数据表
- `GET /bitable/v1/apps/{app_token}/tables/{table_id}` - 获取数据表详情
- `DELETE /bitable/v1/apps/{app_token}/tables/{table_id}` - 删除数据表

### 记录相关
- `POST /bitable/v1/apps/{app_token}/tables/{table_id}/records` - 新增记录
Confidence
80% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
- `POST /bitable/v1/apps/{app_token}/tables/{table_id}/records` - 新增记录
- `GET /bitable/v1/apps/{app_token}/tables/{table_id}/records` - 获取记录列表
- `PUT /bitable/v1/apps/{app_token}/tables/{table_id}/records/{record_id}` - 更新记录
- `DELETE /bitable/v1/apps/{app_token}/tables/{table_id}/records/{record_id}` - 删除记录
- `POST /bitable/v1/apps/{app_token}/tables/{table_id}/records/batch_create` - 批量新增记录
- `POST /bitable/v1/apps/{app_token}/tables/{table_id}/records/batch_update` - 批量更新记录
- `POST /bitable/v1/apps/{app_token}/tables/{table_id}/records/batch_delete` - 批量删除记录
Confidence
80% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Credential Access

High
Category
Privilege Escalation
Content
npm install

# 配置环境变量
cp .env.example .env
# 编辑.env文件,填入你的飞书应用凭证

# 测试连接
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Known Vulnerable Dependency: axios==1.13.4 — 16 advisory(ies): CVE-2026-44494 (axios Vulnerable to Full Man-in-the-Middle via Prototype Pollution Gadget in `co); CVE-2026-44495 (axios Vulnerable to Credential Theft and Response Hijacking via Prototype Pollut); CVE-2025-62718 (Axios has a NO_PROXY Hostname Normalization Bypass that Leads to SSRF) +13 more

High
Category
Supply Chain
Confidence
93% confidence
Finding
The lockfile pins axios to 1.13.4, and the supplied advisory set includes multiple high-severity issues such as SSRF-related proxy bypass and prototype-pollution-driven request/response compromise. This skill is an API client that makes outbound HTTP requests to Feishu, so a vulnerable HTTP library is directly in the attack path and can affect confidentiality of tokens, integrity of requests, and trust in responses.

Known Vulnerable Dependency: form-data==4.0.5 — 1 advisory(ies): CVE-2026-12143 (form-data: CRLF injection in form-data via unescaped multipart field names and f)

High
Category
Supply Chain
Confidence
86% confidence
Finding
form-data 4.0.5 is flagged for CRLF injection via unescaped multipart field names/filenames. If this skill ever builds multipart requests from untrusted input, an attacker may be able to manipulate request boundaries or inject additional headers/content, which can lead to request smuggling-like effects or malformed authenticated API calls.

Known Vulnerable Dependency: axios==1.13.4 — 16 advisory(ies): CVE-2026-44494 (axios Vulnerable to Full Man-in-the-Middle via Prototype Pollution Gadget in `co); CVE-2026-44495 (axios Vulnerable to Credential Theft and Response Hijacking via Prototype Pollut); CVE-2025-62718 (Axios has a NO_PROXY Hostname Normalization Bypass that Leads to SSRF) +13 more

High
Category
Supply Chain
Confidence
92% confidence
Finding
The static analysis indicates resolution to a known vulnerable axios version with multiple advisories, including SSRF and prototype-pollution-related impacts. In a Feishu Bitable API skill, axios is central to outbound HTTP requests and may handle access tokens, so a vulnerable HTTP client can materially increase the risk of request forgery, credential exposure, or response manipulation depending on how the library is used elsewhere in the project.

Missing User Warnings

High
Confidence
95% confidence
Finding
This method deletes multiple records in a single request, increasing the potential impact of accidental invocation. There is no visible confirmation, warning, or other user disclosure in the code to signal that the operation is destructive and potentially irreversible.

Credential Access

High
Category
Privilege Escalation
Content
missingVars.forEach(varName => {
    console.log(`  - ${varName}`);
  });
  console.log('\n请设置环境变量或创建 .env 文件');
  console.log('参考 .env.example 文件');
  process.exit(1);
}
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Missing User Warnings

Medium
Confidence
86% confidence
Finding
This is a markdown file, so SQP-2 applies to omissions in user-facing safety disclosures. The document lists delete operations for tables and records as supported features, but it does not warn users that these actions can remove data or require caution, which could affect user data and system integrity.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The README explicitly shows placing the Feishu app secret directly in a .env file and in a JSON config example without any caution about secret storage, access controls, or avoiding commits. This increases the chance that users will store long-lived credentials insecurely, leak them through source control or logs, and enable unauthorized access to Feishu data through the documented write-capable API skill.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
This is a markdown file, so missing user-facing warnings about actions affecting data integrity should be flagged. The usage examples show create, update, batch-create, and delete operations, but there is no nearby warning about irreversible changes, confirming targets, or potential data loss.

Lp3

Medium
Category
MCP Least Privilege
Confidence
82% confidence
Finding
The skill declares required environment variables in metadata but does not declare an explicit tool scope such as permissions or allowed-tools. This weakens least-privilege controls and makes it harder for the host agent to reason about what resources the skill is allowed to access, increasing the chance of unintended credential exposure or unauthorized execution paths.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill documents destructive delete operations for tables and records without warning about data loss, confirmation requirements, or guardrails. In an agent setting, this increases the chance that a model or user invokes irreversible actions accidentally or with insufficient validation, causing integrity loss in production data.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The `delete-record` command performs an irreversible record deletion via `api.deleteRecord(...)`, but this command path provides no confirmation prompt or explicit warning to the user before executing the destructive action. Although errors are logged, there is no disclosure of deletion risk or safeguard at the point of invocation.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
This README advertises deleting tables and performing CRUD/batch delete operations, but it does not include any user warning about irreversible deletion, backups, or confirming targets before execution. For a skill that can modify and remove user data at scale, the omission is a meaningful safety gap in the user-facing description.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
This code performs irreversible remote deletion of a table via an HTTP DELETE request, but there is no confirmation prompt, user-facing warning, or disclosure near the operation. The same pattern appears for record deletion methods, making destructive actions easy to invoke without explicit notice to the user.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The method deletes a record remotely using an HTTP DELETE call, which is a safety-critical destructive action. The code contains no prompt, warning comment, or user-visible disclosure indicating that data will be permanently removed.

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
This JavaScript file uses Chinese natural-language comments and user-visible warning/error strings such as '无法读取文件' and '获取访问令牌失败'. Because the file provides no language selection or opt-in mechanism, it appears to enforce a specific locale in user-facing output, which matches the language/locale policy-violation category.

Context-Inappropriate Capability

Medium
Confidence
94% confidence
Finding
The parseJsonInput helper treats any string beginning with '@' as a local file path and reads it directly with fs.readFileSync, allowing callers to access arbitrary local files available to the skill runtime. In a Feishu Bitable CRUD skill, this behavior is broader than necessary and can expose secrets, tokens, configuration files, or other sensitive host data if attacker-controlled input reaches this function.

Missing User Warnings

Low
Confidence
76% confidence
Finding
The skill is described as a Feishu Bitable API integration and later references enterprise account permissions and credentials, indicating external network interactions with potentially sensitive workspace data. In markdown descriptions, SQP-2 requires warnings when behavior could affect privacy, but no disclosure is provided about data being sent to Feishu APIs or the need to protect credentials.

Description-Behavior Mismatch

Low
Confidence
91% confidence
Finding
The manifest description says the skill can create, read, update, and delete Bitable tables, records, and fields. However, the feature list and API endpoint list only show field create/list/update operations and omit any field delete capability, so the documented behavior does not fully match the claimed scope.

Description-Behavior Mismatch

Low
Confidence
88% confidence
Finding
The manifest describes the skill as operating on tables, records, and fields, but the documentation also advertises view management and app information retrieval. Those are additional Bitable capabilities beyond the narrower manifest description, creating a description-to-behavior/documented-scope mismatch.

Missing User Warnings

Low
Confidence
81% confidence
Finding
The documentation instructs users to place sensitive Feishu application credentials in environment variables or files without any handling guidance. This can lead to accidental disclosure through logs, shell history, screenshots, or overbroad agent access to the runtime environment.

Natural-Language Policy Violations

Low
Confidence
89% confidence
Finding
User-facing natural-language strings throughout the CLI, including the top-level description and command messages, are hard-coded in Chinese. There is no indication that users can choose a language or that the locale restriction is intentionally documented as a region-specific tool.

Static analysis

Detected: suspicious.env_credential_access, suspicious.exposed_secret_literal

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
src/utils.js:13

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
src/api.js:13