Back to skill

Security audit

feishu-calendar-event

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent Feishu calendar integration, but it asks for broad calendar permissions and includes a test command that can read and print live calendar data.

Install only if you trust the Feishu app credentials and scopes you will provide. Prefer read-only Feishu permissions unless you need writes, avoid putting real App Secrets in source code or prompts, and do not run npm test in an environment with production credentials because it can fetch and print real calendar details.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T09 · Insecure Skill Coding Practices

Warning
Location
calendar-client.js:132
Finding
Sensitive calendar event data is written to process logs## Vulnerability Details **File Location**: `calendar-client.js:132-140` **Vulnerability Type**: Sensitive information exposure through logging **Risk Level**: Medium ### Vulnerable Code ```javascript result.events.forEach(event => { const start = new Date(parseInt(event.start_time.timestamp) * 1000); const end = new Date(parseInt(event.end_time.timestamp) * 1000); console.log(`\n📝 ${event.summary}`); console.log(` 时间: ${start.toLocaleTimeString()} - ${end.toLocaleTimeString()}`); if (event.description) console.log(` 描述: ${event.description}`); if (event.location?.name) console.log(` 地点: ${event.location.name}`); }); ``` ### Technical Analysis When the module is run directly, it prints event titles, times, descriptions, and locations to standard output. Calendar descriptions and locations may contain confidential meeting details, customer names, internal project information, physical locations, or links to restricted resources. Standard output is frequently captured by terminal history, CI systems, container runtimes, process supervisors, support bundles, and centralized log aggregation platforms. These systems may have broader access controls and longer retention periods than the Feishu calendar itself. The logging is not required for the core calendar API client functionality. The exported functions can return structured event data without disclosing it to an additional storage or monitoring channel. ### Attack Path 1. A user, CI job, or process supervisor runs `calendar-client.js`, directly or through the package test command. 2. The script authenticates using the configured Feishu application credentials. 3. It retrieves events from the selected calendar. 4. Event summaries, descriptions, times, and locations are written to standard output. 5. An operator or attacker with access to retained logs reads calendar information despite not necessarily having direct Feishu calendar access. ...[truncated 486 chars]
Remediation
## Remediation Suggestions - Do not print event contents by default. Return structured results to the caller instead. - Place human-readable output behind an explicit command-line option such as `--show-events`. - Redact or omit sensitive fields, particularly descriptions and locations. - Document that verbose output may contain confidential calendar information. - Ensure production and CI logging systems apply appropriate access controls, encryption, retention limits, and deletion policies. - Where diagnostic logging is necessary, log only metadata such as the event count and request status.

T09 · Insecure Skill Coding Practices

Warning
Location
package.json:16
Finding
The package test command performs authenticated access to live calendar data## Vulnerability Details **File Location**: `package.json:16` and `calendar-client.js:125-145` **Vulnerability Type**: Unexpected production-data access and side effects in a test command **Risk Level**: Medium ### Vulnerable Code `package.json`: ```json "scripts": { "test": "node calendar-client.js" }, ``` `calendar-client.js`: ```javascript // 如果直接运行脚本 if (require.main === module) { getTodayEvents().then(result => { console.log('\n📋 今日日程:'); console.log('================'); if (result.events.length === 0) { console.log('今天没有安排日程'); } else { result.events.forEach(event => { const start = new Date(parseInt(event.start_time.timestamp) * 1000); const end = new Date(parseInt(event.end_time.timestamp) * 1000); console.log(`\n📝 ${event.summary}`); console.log(` 时间: ${start.toLocaleTimeString()} - ${end.toLocaleTimeString()}`); if (event.description) console.log(` 描述: ${event.description}`); if (event.location?.name) console.log(` 地点: ${event.location.name}`); }); } }).catch(console.error); } ``` ### Technical Analysis The conventional `npm test` command does not execute isolated tests. It runs the production client, obtains a tenant access token, enumerates calendars, reads events from the primary calendar, and prints event details. Developers and automated systems commonly assume that a test command is safe to execute repeatedly and does not access production data. This behavior creates an unexpected authenticated network side effect. It also causes CI and package-validation environments containing Feishu credentials to retrieve and potentially retain live calendar data. The operation does not require calendar write privileges, but it exceeds the minimum privileges and side effects necessary for testing. Unit tests should use mocked network responses and synthetic event data. ### Attac ...[truncated 1041 chars]
Remediation
## Remediation Suggestions - Replace the `test` script with unit tests that mock `fetch` and use synthetic credentials and calendar data. - Move live behavior to an explicitly named command, such as `calendar:today` or `example:live`. - Require explicit confirmation or a dedicated flag before accessing a production tenant. - Ensure CI test environments do not expose production Feishu credentials. - Separate integration tests from unit tests and run integration tests only in a restricted environment. - Prevent integration-test output from including event descriptions, locations, access tokens, or credentials.

T09 · Insecure Skill Coding Practices

Note
Location
SKILL.md:60
Finding
Documentation encourages storing Feishu application secrets in source code## Vulnerability Details **File Location**: `SKILL.md:60-66` **Vulnerability Type**: Insecure credential-management guidance **Risk Level**: Low ### Vulnerable Code ```javascript 或者在代码中直接使用: ```javascript const config = { appId: 'cli_xxxxxxxxxxxx', appSecret: 'xxxxxxxxxxxxx' }; ``` ``` ### Technical Analysis The documented values are placeholders and no real credential is committed in the audited project. However, the documentation explicitly presents direct source-code embedding as an alternative configuration method. Users who follow this guidance may commit an actual App Secret to version control or expose it through source archives, backups, code review systems, support bundles, or shared examples. Environment variables or a dedicated secret manager provide a safer credential boundary and simplify rotation. The network transmission identified by the pre-scan is otherwise consistent with the declared functionality: the App ID and App Secret are sent over HTTPS to Feishu’s official `open.feishu.cn` tenant-token endpoint. No unrelated or attacker-controlled destination was identified. ### Attack Path 1. A user follows the documented source-code configuration example. 2. The user replaces the placeholders with a real Feishu App ID and App Secret. 3. The source file is committed, archived, logged, or shared. 4. An attacker obtains the exposed App Secret. 5. The attacker submits the App ID and App Secret to Feishu’s tenant authentication endpoint. 6. If the credentials remain valid and Feishu accepts the request, the attacker receives a tenant access token and can invoke APIs within the application’s granted scopes. ### Impact Assessment Successful exploitation requires a user to embed a genuine secret and expose the resulting source. If that occurs, the attacker may obtain the same tenant-level API permissions granted to the application. Based on the documented configuration, the potential scope ...[truncated 233 chars]
Remediation
## Remediation Suggestions - Remove the recommendation to place the App Secret directly in source code. - Require environment variables, a protected configuration provider, or a secrets-management service. - Add real secret files and local environment files to `.gitignore`. - Document credential rotation and immediate revocation procedures. - Recommend separate credentials for development, testing, and production. - Grant only the Feishu scopes required by the enabled operations. Read-only deployments should not receive create, update, or delete permissions. - Add secret scanning to CI and repository pre-commit checks. - Avoid including credentials or tenant access tokens in examples, logs, error messages, or support artifacts.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (17)

Credential Access

High
Category
Privilege Escalation
Content
## 使用方法

### 获取 Access Token

```javascript
const response = await fetch('https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal', {
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
## 使用方法

### 获取 Access Token

```javascript
const response = await fetch('https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal', {
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
## 使用方法

### 获取 Access Token

```javascript
const response = await fetch('https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal', {
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Ae1

High
Category
analysis-evasion
Content
见 `example.md` 和 `calendar-client.js` 获取完整示例。
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Credential Access

High
Category
Privilege Escalation
Content
*/
async function getTodayEvents() {
  try {
    // 1. 获取 access token
    const token = await getAccessToken();
    console.log('✅ 获取 Access Token 成功');
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
*/
async function getTodayEvents() {
  try {
    // 1. 获取 access token
    const token = await getAccessToken();
    console.log('✅ 获取 Access Token 成功');
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
## 步骤说明

### 1. 获取 Access Token

使用 web_fetch 工具调用飞书认证接口:
Confidence
84% confidence
Finding
The skill explicitly instructs the user to obtain an access token and then use it to enumerate calendars and read event data, which is credential-enabled access to potentially sensitive organizational information. In the context of an agent skill, normalizing token retrieval and reuse without safeguards increases the risk of secret exposure and unauthorized data access if the skill is misused or copied into insecure environments.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill explicitly advertises create, update, and delete calendar capabilities but does not warn that these actions can modify or permanently remove user calendar data. In a skill context, omission of destructive-action warnings increases the chance of accidental misuse, especially if an agent invokes these operations without clear user confirmation.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The documentation includes an example showing App ID and App Secret embedded directly in source code, which encourages insecure credential handling. Hardcoded secrets are commonly exposed through source control, logs, screenshots, or copied examples, enabling unauthorized access to the Feishu application and its calendar permissions.

Missing User Warnings

Medium
Confidence
84% confidence
Finding
The examples demonstrate sending app credentials and bearer tokens in network requests without any warning about secure storage, transport handling, or accidental disclosure in logs and debugging output. While HTTPS is used, the missing security guidance can lead implementers to mishandle tokens in surrounding code, increasing credential exposure risk.

External Transmission

Medium
Category
Data Exfiltration
Content
### 获取 Access Token

```javascript
const response = await fetch('https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Natural-Language Policy Violations

Medium
Confidence
83% confidence
Finding
The file includes Chinese-only user-facing labeling and comments such as the Chinese API/client description, and later output messages are also presented only in Chinese. This can violate language/locale policy when a skill forces a specific language experience without offering user choice or documenting that the skill is intentionally region-specific.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill includes a concrete workflow for obtaining and using a tenant access token with embedded app_id and app_secret examples, but provides no guidance on secure secret storage, redaction, least privilege, or privacy handling for calendar data. This can normalize unsafe credential handling and lead users to expose secrets or retrieve sensitive calendar contents without considering data protection obligations.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The manifest explicitly states that the skill can create, update, and delete calendar events, but it does not include any user-facing warning, confirmation requirement, or safety language about making destructive changes to calendar data. In a productivity skill with write/delete capabilities, this increases the risk of accidental or unauthorized modifications because users and integrators may not understand that the skill performs state-changing actions.

Natural-Language Policy Violations

Low
Confidence
79% confidence
Finding
The note says to uniformly use `Asia/Shanghai`, which imposes a locale-specific default in natural language without indicating that users may choose another timezone. The policy allows locale constraints when clearly justified, but no such justification or opt-in is provided here.

Natural-Language Policy Violations

Low
Confidence
83% confidence
Finding
The file's instructional content is entirely in Chinese, which can amount to a language policy issue when no user opt-in or locale constraint is stated. There is no indication that the skill is intended only for a Chinese-speaking audience or a region-specific compliance context.

Natural-Language Policy Violations

Low
Confidence
83% confidence
Finding
The visible natural-language description forces a single language presentation without offering an alternative or indicating that the skill is region- or language-specific. Under the language/locale policy criterion, this can be a policy concern when users are not given a language choice or informed constraint.

Static analysis

Detected: suspicious.env_credential_access

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
calendar-client.js:8