T09 · Insecure Skill Coding Practices
- Location
final_integrated.py:100- Finding
Hardcoded Feishu Credentials Silently Route User Data to a Fixed Tenant
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill matches its Feishu inventory purpose, but it includes hardcoded Feishu credentials and can read, write, and upload to a preset Feishu table if the user has not configured their own account.
Review carefully before installing. Only use this skill after removing all bundled Feishu credentials and fixed table IDs, rotating the exposed Feishu secret, and verifying that the tool fails closed unless your own FEISHU_APP_ID, FEISHU_APP_SECRET, FEISHU_BITABLE_TOKEN, and FEISHU_TABLE_ID are explicitly configured.
final_integrated.py:100Hardcoded Feishu Credentials Silently Route User Data to a Fixed Tenant
install.sh:16Unpinned Dependency Installation Creates Supply-Chain Exposure
The declared description broadly matches the main product purpose: intelligent location matching, location image handling, and one-click storage into Feishu. However, the declaration lists no permissions, while the code clearly performs significant external operations: it authenticates with Feishu using app credentials, lists all records from a Bitable table, uploads images to Feishu Drive, and creates records in Feishu Bitable. These are materially relevant capabilities and resource accesses that should be declared. The embedded hardcoded credentials also indicate sensitive credential use beyond an empty permission declaration. Therefore this is a description/behavior mismatch driven primarily by undeclared capabilities and resource access, not by an unrelated purpose.
The description broadly matches the core domain behavior: this is indeed a Feishu-based storage manager with intelligent location matching and location image handling. However, there are material gaps. First, the declared permissions are empty, yet the code performs network authentication to Feishu, reads from Bitable, uploads media, and writes records—these are significant external-resource accesses. Second, the description promises '一键入库' (one-click intake), but for new locations the code explicitly stops and returns 'needs_location_photo', requiring a separate upload step before intake can complete, so the behavior is not consistently one-click. Third, the code includes undeclared operational capabilities such as loading all existing records and using embedded/default secrets. Overall, this is a meaningful description-versus-behavior mismatch, though the main product theme is aligned.
The description presents a complete Feishu storage assistant with three major functions: intelligent location matching, location image management, and one-click inventory entry. The supplied code, however, is narrowly focused on the location image management portion only. It loads records from Feishu Bitable, extracts Location and Location_Image fields, caches mappings, and uploads images to Feishu's media API. There is no actual implementation of intelligent matching logic or inventory/record creation for 'one-click storage entry.' Additionally, the code uses network access to Feishu APIs and local filesystem access for reading image files and creating a test file, while the declared permissions are empty. Because the implemented behavior is only a subset of the advertised skill and includes resource access not reflected by the declaration, this is a mismatch.
声明描述的是一个更完整的收纳管理技能,至少包含智能位置匹配、图片管理和入库流程;而提供的代码块只覆盖了“智能位置匹配”这一部分,没有图片处理、文件/媒体管理、数据库或表单入库、网络请求、飞书 API 调用等实现。因此代码实际行为明显窄于声明的整体能力,属于描述与实际行为不一致。不过,已实现的那部分“智能位置匹配”与声明中的对应子功能是相符的。
声明描述的是一个较完整的收纳管理技能,至少应包含智能位置匹配之外的图片管理、入库流程以及可能的飞书侧操作。但提供的代码块只覆盖“智能位置匹配”这一子能力,且是纯算法实现,没有文件/图片处理、网络请求、数据库写入、API 调用、飞书 SDK/接口、触发器或自动化流程。因此描述显著夸大了实际代码能力,属于描述与行为不一致。
The description mostly aligns with the general domain and main functions: intelligent location matching and location image handling for Feishu-based storage records. The code indeed implements fuzzy location matching, checks whether a location has an image, uploads images, and creates records in Feishu Bitable. However, there is a material mismatch in completeness and behavior. The declared title says '完整版' and '一键入库', implying a complete one-click workflow, but for new locations the function explicitly stops and returns 'needs_location_photo', requiring a second submission. Also, location-image management is not durably implemented: add_location_photo stores the mapping only in the in-memory LocationImageManager and does not write a Location_Image field back to Feishu records, so the mapping is lost on restart unless it already existed in the table. Additionally, the declared permissions are empty, but the code authenticates with Feishu, lists Bitable records, creates records, and uploads files to Feishu Drive using credentials, which is undeclared external access. Therefore this should be flagged as a mismatch.
The description broadly matches the storage-management theme: the code does provide intelligent location matching, image upload/association, and add/update item records in Feishu Bitable. However, the declared permissions are empty while the code clearly authenticates to Feishu, performs remote API calls, reads/writes Bitable records, uploads images, and searches existing records to build location options. These are material capabilities and resource accesses that should be declared. In addition, the code supports retrieval/search and update operations beyond the description’s narrower wording of image management and one-click intake. Therefore this is a description/behavior mismatch, primarily due to undeclared external access and additional data-management capabilities.
描述与核心主题大体相关,确实包含智能位置匹配、图片上传关联和入库功能。但声明明显不完整:1) declared permissions 为空,而代码会访问飞书开放平台认证接口、bitable 记录读写接口、drive 媒体上传接口;2) 代码除“一键入库”外,还提供搜索物品和更新位置两类独立能力;3) 智能位置匹配依赖读取全部现有记录中的 Location 字段,因此具备批量读取表格数据的能力。由于这些都是实际对外能力和资源访问,不只是内部实现细节,因此应判定为描述与行为不完全一致,存在 mismatch。
The declared description presents a complete Feishu storage-management skill with multiple user-facing capabilities: intelligent location matching, image management for locations, and one-click warehousing/storage. However, the actual code chunk is only a test file. It verifies that a FeishuStorageManager can be initialized and can search for a storage item ('梳子') using environment-provided Feishu credentials and Bitable identifiers. There is no visible code for image management, intelligent matching, or one-click入库. The primary purpose of this code chunk is testing configuration loading and search behavior, which is materially different from the declared full-featured assistant. Therefore, this is a mismatch.
The declared description presents a complete Feishu storage assistant with smart location matching, image management, and one-click inventory entry. The supplied code chunk is instead a standalone test file focused on validating smart location matching and a small search integration. It also directly configures and uses Feishu/Bitable credentials and resource identifiers, which is an externally accessing capability not reflected in the declared permissions. While smart location matching is consistent with part of the description, major claimed features in the description are absent from this code chunk, and the actual primary purpose here is testing/integration rather than delivering the described assistant behavior.
The skill makes outbound HTTP requests to Feishu APIs, including authentication and record creation, without corresponding declared network permissions. Hidden network capability is dangerous because it enables data exfiltration and remote side effects beyond what users may expect from the skill interface.
The skill makes outbound HTTP requests to Feishu APIs, including authentication and record creation, without corresponding declared network permissions. Hidden network capability is dangerous because it enables data exfiltration and remote side effects beyond what users may expect from the skill interface.
The skill makes outbound HTTP requests to Feishu APIs, including authentication and record creation, without corresponding declared network permissions. Hidden network capability is dangerous because it enables data exfiltration and remote side effects beyond what users may expect from the skill interface.
The code embeds real-looking Feishu app credentials and tokens as defaults, then uses them for authentication and API access. Hardcoded secrets are a severe vulnerability because anyone with code access can reuse them to access the associated tenant resources, impersonate the application, or extract and modify remote data.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
self.image_manager = None
def get_tenant_access_token(self) -> str:
"""获取Tenant Access Token"""
if self.access_token:
return self.access_token
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
self.image_manager = None
def get_tenant_access_token(self) -> str:
"""获取Tenant Access Token"""
if self.access_token:
return self.access_token
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
self.image_manager = None
def get_tenant_access_token(self) -> str:
"""获取Tenant Access Token"""
if self.access_token:
return self.access_token
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
self.image_manager = None
def get_tenant_access_token(self) -> str:
"""获取Tenant Access Token"""
if self.access_token:
return self.access_token
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
self.image_manager = None
def get_tenant_access_token(self) -> str:
"""获取Tenant Access Token"""
if self.access_token:
return self.access_token
The code embeds usable default Feishu app credentials and table identifiers directly in source, then automatically uses them if environment variables are absent. Anyone with code access can extract these secrets and authenticate to the linked Feishu resources, potentially reading or modifying records and uploading content to the tenant's storage.
The skill uses 'shell' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
CONFIG_EXAMPLE="$SCRIPT_DIR/config.example.env"
cat > "$CONFIG_EXAMPLE" << EOF
# 飞书收纳管家配置
# 复制此文件为 .env 并填写实际值
# 飞书应用配置
FEISHU_APP_ID=cli_xxxxxxxxxxxxxxx
The code embeds Feishu app credentials and table identifiers directly in source as fallback defaults. Anyone with access to the skill can reuse those secrets to access the associated Feishu tenant and bitable, causing unauthorized data access or modification unrelated to the current user.
Using hardcoded Feishu credentials and tokens as implicit defaults means the skill can silently operate against a preconfigured remote account without user awareness. This creates a direct secret exposure and enables unintended access to third-party data stores if the code is reused or executed elsewhere.
The code hardcodes live Feishu app credentials and table identifiers as defaults, meaning anyone with access to the skill source can reuse them to authenticate to the associated Feishu tenant and operate on its data. In a storage-management skill this is not necessary as embedded secrets expose a real external account and can enable unauthorized read/write access far beyond the local tool's function.