Back to skill

Security audit

Release Package

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its Feishu storage-manager purpose, but it ships apparent live Feishu credentials in a test and can upload arbitrary local files to Feishu with weak user safeguards.

Review before installing. Do not run the bundled test unless the embedded Feishu credentials have been removed and rotated. Treat any item names, locations, search terms, and uploaded images as data sent to Feishu, and only use image paths you intentionally want uploaded. Prefer installing with pinned dependencies and least-privilege Feishu app scopes.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
test_basic.py:32
Finding

Hardcoded Feishu Application Credentials in a Network-Enabled Test

Content
View full analysis

Vulnerability Details

File Location: test_basic.py, lines 32-43
Vulnerability Type: Hardcoded secrets and authenticated external API access
Risk Level: High

Vulnerable Code

python
os.environ["FEISHU_APP_ID"] = "cli_a956c03ffcb9dcbb"
os.environ["FEISHU_APP_SECRET"] = "HHEZEDoNZwfNdoediXiGSbaRFKDmpB71"
os.environ["FEISHU_BITABLE_TOKEN"] = "AO6rbfj7aa8nbGsG7Rfc90honjK"
os.environ["FEISHU_TABLE_ID"] = "tbl0T6d9uTv4Fk3c"

manager = FeishuStorageManager()

try:
    results = manager.search_storage_item("梳子")

The credentials are consumed by the following authentication request in storage_manager.py, lines 29-36:

python
url = "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal"
data = {
    "app_id": self.app_id,
    "app_secret": self.app_secret
}

response = requests.post(url, json=data, timeout=10)

Technical Analysis

The test source contains credential-shaped Feishu application identifiers, an application secret, a Bitable token, and a table identifier. Unlike a mocked unit test, test_search_function() instantiates the production manager and performs a real outbound authentication and Bitable query.

Anyone who obtains the package can extract these values without executing the code. If the credentials remain valid, the application ID and secret can be exchanged for a tenant access token. The resulting privileges depend on the permissions granted to the Feishu application. The embedded Bitable token and table ID identify the resource subsequently queried by the test.

The audit did not validate whether the exposed credentials are currently active. Nevertheless, committing non-placeholder secret values and wiring them into live network calls is an insecure coding practice and requires immediate rotation.

Attack Path

  1. An attacker downloads or otherwise reads the distributed project.
  2. The attacker extracts the four values from `test_basi ...[truncated 1367 chars]
Remediation
View remediation

Remediation Suggestions

  1. Immediately revoke and rotate the exposed Feishu application secret.
  2. Review Feishu access logs and Bitable audit history for unauthorized activity.
  3. Remove all real credentials and resource identifiers from the repository and its version history.
  4. Replace the values with unmistakable placeholders or inject test configuration through a protected CI secret store.
  5. Mock requests.post() and requests.get() in unit tests so tests never contact Feishu.
  6. Keep live integration tests separate, disabled by default, and require an explicit opt-in flag.
  7. Add secret scanning to local hooks and CI, covering Feishu application secrets and Bitable tokens.
  8. Grant the Feishu application only the narrowest required Bitable and upload scopes.

T09 · Insecure Skill Coding Practices

Warning
Location
storage_manager.py:50
Finding

Unrestricted Local File Read and Upload Through the Image Argument

Content
View full analysis

Vulnerability Details

File Location: storage_manager.py, lines 50-78
Vulnerability Type: Arbitrary readable-file disclosure to an external service
Risk Level: Medium

Vulnerable Code

python
def upload_image(self, image_path: str) -> str:
    """上传图片到飞书,返回file_token"""
    if not self.access_token:
        self.get_tenant_access_token()

    try:
        with open(image_path, "rb") as f:
            image_data = f.read()
        file_size = len(image_data)
    except Exception as e:
        raise Exception(f"读取图片失败: {e}")

    url = "https://open.feishu.cn/open-apis/drive/v1/medias/upload_all"
    headers = {"Authorization": f"Bearer {self.access_token}"}

    form_data = {
        "file_name": os.path.basename(image_path),
        "parent_type": "bitable_image",
        "parent_node": self.bitable_token,
        "size": str(file_size)
    }

    files = {"file": (os.path.basename(image_path), image_data, "image/jpeg")}

    try:
        response = requests.post(
            url,
            headers=headers,
            data=form_data,
            files=files,
            timeout=30
        )

The path reaches this function through storage_manager.py, lines 110-115:

python
if image_path and os.path.exists(image_path):
    try:
        file_token = self.upload_image(image_path)
        fields["Image"] = [{"file_token": file_token}]

Technical Analysis

Image upload is part of the declared Skill functionality, so file reading and outbound access to the fixed official Feishu endpoint are legitimate in principle. However, the implementation treats any existing path as an image and reads the entire target into memory without validating:

  • Whether the path is inside an approved upload directory.
  • Whether the target is a regular file rather than a symlink or special file.
  • Whether its content is an actual supported image.
  • Whether it ...[truncated 2011 chars]
Remediation
View remediation

Remediation Suggestions

  1. Resolve the path with Path.resolve() and require it to remain within a dedicated, explicitly approved upload directory.
  2. Reject symlinks, directories, device files, FIFOs, sockets, and all other non-regular files.
  3. Verify file content using a trusted image decoder rather than relying on the extension or a hardcoded MIME type.
  4. Permit only a narrow set of formats and derive the multipart MIME type from verified content.
  5. Enforce a conservative size limit before reading or uploading the file.
  6. Stream uploads rather than loading the entire file into memory.
  7. Display the resolved path, destination, and file size and obtain explicit user confirmation before upload.
  8. Restrict filesystem permissions to the approved media directory instead of requesting unrestricted file-read access where the host supports granular permissions.
  9. Document clearly that selected files are transmitted to Feishu.

T08 · Insecure Dependencies

Warning
Location
install.sh:17
Finding

Unpinned and Unbounded Python Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: install.sh, lines 17-20
Vulnerability Type: Insecure dependency installation and supply-chain exposure
Risk Level: Medium

Vulnerable Code

bash
python3 -c "import requests" 2>/dev/null || {
    echo "安装requests库..."
    pip3 install requests
}

The package metadata also permits every future version at or above 2.25.0 in package.json, lines 19-22:

json
"dependencies": {
  "requests": ">=2.25.0"
},

Technical Analysis

The installer retrieves requests from pip's configured package index without a pinned version, lock file, hash verification, isolated virtual environment, or explicit trusted repository. The metadata's open-ended >=2.25.0 constraint does not constrain installation to an audited release.

requests is a legitimate and well-known package, and no typosquatted package name was identified. The risk arises from accepting whichever package artifact the runtime's pip configuration resolves in the future. A compromised index, malicious mirror, poisoned local pip configuration, or future compromised release could cause unreviewed code to be installed and later imported by the Skill.

Installation occurs with the privileges of the user running install.sh. If that account has elevated permissions or uses a system-wide pip configuration, the affected scope may extend beyond the Skill.

Attack Path

  1. A user runs install.sh on a system where requests is unavailable.
  2. The script invokes pip3 install requests without a version or hash.
  3. pip resolves the package using its active index and configuration.
  4. A compromised index, mirror, configuration, or future package release supplies an unaudited artifact.
  5. The artifact is installed with the installer's privileges.
  6. storage_manager.py imports requests, executing package initialization code in the Skill process.

Impact Assessment

A malicious d ...[truncated 357 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin requests and its transitive dependencies to reviewed versions in a lock file.
  2. Install with hash verification, such as pip install --require-hashes -r requirements.txt.
  3. Use an isolated virtual environment rather than the ambient system Python environment.
  4. Configure a trusted package index explicitly and protect pip configuration from modification.
  5. Remove the open-ended >= constraint from package metadata.
  6. Run dependency vulnerability and provenance checks in CI.
  7. Avoid running the installer as root or with sudo.
  8. Prefer a deterministic packaging mechanism that records exact artifacts and integrity hashes.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (21)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents the skill as an integrated Feishu Bitable storage manager supporting item storage, retrieval, and location updates. However, the supplied code chunk is only a test file. It verifies initialization defaults and invokes a search method on an imported FeishuStorageManager after populating environment variables with Feishu credentials. There is no implementation here for storing items or updating locations, and the primary purpose of this chunk is testing/search validation rather than providing the described manager functionality. This is a material description-behavior mismatch for the supplied code chunk.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill uses 'network' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill uses 'shell' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · install.sh (reported line 40)May include surrounding context.

sh
CONFIG_EXAMPLE="$SCRIPT_DIR/config.example.env"
cat > "$CONFIG_EXAMPLE" << EOF
# 飞书收纳管家配置
# 复制此文件为 .env 并填写实际值

# 飞书应用配置
FEISHU_APP_ID=cli_xxxxxxxxxxxxxxx

Lp1

High
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill uses 'env' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · storage_manager.py (reported line 25)May include surrounding context.

python
self.token_expire = 0
        
    def get_tenant_access_token(self) -> str:
        """获取Tenant Access Token"""
        if self.access_token and self.token_expire > 0:
            return self.access_token

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The test file hard-codes what appear to be real Feishu app credentials and tokens directly in source code. Embedded secrets are dangerous because anyone with repository or package access can reuse them to access the associated Feishu/Bitable resources, and such secrets are often copied into logs, forks, and backups, making compromise persistent.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The code programmatically sets sensitive credentials into process environment variables inside the test, which normalizes insecure secret handling and can expose values to child processes, crash reports, debug tooling, or test harness output. In this case the risk is amplified because the credentials are also hard-coded, so the issue is not just disclosure but active propagation of exposed secrets during execution.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README content is entirely written in Chinese and does not indicate that language selection is optional or that the skill is region-specific. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill explicitly describes uploading item images and storage-location records to Feishu, which can include highly sensitive personal information such as passports, medicine, or home-location details. Because the documentation provides no user-facing warning, consent step, or data-handling notice, users may unknowingly transmit sensitive data off-device to a third-party service, creating privacy and security exposure.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The phrase "A simple storage manager" is a generic description that does not define specific trigger phrases, activation conditions, or scope boundaries. Because it overlaps with many common storage-related tasks, it could cause unintended invocation or confusion about when the skill applies.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Natural-language strings throughout the module, including docstrings, CLI descriptions, help text, and runtime messages, are exclusively in Chinese. The file does not offer a language/locale choice or explain that the skill is intentionally limited to a Chinese-speaking or region-specific environment.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% 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 · storage_manager.py (reported line 36)May include surrounding context.

python
}
        
        try:
            response = requests.post(url, json=data, timeout=10)
            if response.status_code == 200:
                result = response.json()
                if result.get("code") == 0:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The upload_image function reads an arbitrary local file path and transmits the file contents to Feishu, but the CLI and tool behavior do not clearly warn the user that a local file will be exfiltrated to an external service. In an agent setting, this can cause unintentional disclosure of sensitive local images or files if the path is influenced by user or agent input.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% 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 · storage_manager.py (reported line 177)May include surrounding context.

python
data = {"fields": fields}
        
        try:
            response = requests.post(url, headers=headers, json=data, timeout=10)
            if response.status_code == 200:
                result = response.json()
                if result.get("code") == 0:

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% 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 · storage_manager.py (reported line 205)May include surrounding context.

python
data = {"fields": fields}
        
        try:
            response = requests.put(url, headers=headers, json=data, timeout=10)
            if response.status_code == 200:
                result = response.json()
                if result.get("code") == 0:

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
76% confidence
Finding

User-visible messages and documentation throughout the file are written exclusively in Chinese, with no indication that the language is optional or that the skill is region-specific. This can constitute a language/locale policy issue because the file implicitly enforces a single language without opt-in or justification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The call to search_storage_item is clearly intended to query Feishu-backed storage and therefore likely sends the search term and associated authentication context over the network. The file shows generic test progress messages, but it does not explicitly warn the user that running this test will contact an external service and transmit data.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The read_when entries use broad need-based phrases such as 'Need to find item locations' and 'Need to manage personal item storage' without defining boundaries or negative examples. In a manifest/markdown context, this can cause the skill to match generic storage-related requests more often than intended.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The only user-facing natural-language description in this file is written in Chinese and presents the CLI as Chinese-only, with no indication that users can select another language or locale. Under the policy rules, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The package description is written entirely in Chinese, which indicates the skill is presented in a fixed language without offering a user language choice. The provided manifest content does not document that the skill is region-specific or otherwise justify the locale restriction.

Content

No source excerpt is available for this finding.