T09 · Insecure Skill Coding Practices
- Location
upload_cos.py:30- Finding
Hardcoded Tencent COS Credentials Exposed in Source and Configuration
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill has a coherent reporting purpose, but it bundles cloud credentials and routinely publishes potentially internal support reports to a public URL without adequate safeguards.
Review before installing. Do not run this skill on real customer, employee, or internal issue data unless the COS credentials have been revoked/replaced, public-read upload is disabled or explicitly approved, reports are reviewed/redacted, and tests are changed to use local synthetic fixtures with network upload mocked or gated.
upload_cos.py:30Hardcoded Tencent COS Credentials Exposed in Source and Configuration
upload_cos.py:70Employee and Internal Operational Data Is Published as Public-Read Content
generate_report.py:167Stored Cross-Site Scripting Through Unsafe Spreadsheet and JSON Values
test.py:48Test Harness Automatically Reads an External Workbook and Publishes a Report
check_before_deploy.py:205Caller-Controlled URL Fetch Enables Server-Side Request Forgery
generate_report.py:64Unpinned Dependencies and Unsafely Loaded Third-Party Browser Script
The file contains hardcoded COS cloud credentials (secret_id and secret_key) in a skill configuration artifact, which creates an immediate secret-exposure risk. Anyone with access to the skill or repository can reuse these credentials to read, overwrite, or publish content in the bucket, and the surrounding instructions explicitly enable browser-rendered HTML hosting, increasing abuse potential.
The script hardcodes live Tencent COS credentials directly in source code, which enables anyone with access to the file to authenticate to the cloud bucket. In the context of an issue-analysis/reporting skill, embedding secrets plus upload capability creates a strong exfiltration path and can lead to unauthorized read/write access, data publication, bucket abuse, and full compromise of the associated cloud storage account scope.
The code explicitly sets uploaded objects to ACL='public-read' and returns a public URL, making any uploaded report accessible on the public internet. For a customer issue report workflow, this is especially dangerous because reports may contain sensitive operational, customer, or security data, and the publication behavior is built in rather than gated by user consent or classification checks.
This markdown file contains operational instructions only in Chinese, including headings, checklist items, and deployment steps. The policy for natural-language violations applies to all file types, and forcing a specific language without user opt-in or documented regional justification can violate language/locale requirements.
The README explicitly states the workflow uploads generated reports to COS and returns a public URL, but provides no warning that the report may contain sensitive operational or personal data from customer-service issue records. In this skill context, the data originates from Excel issue exports with fields like submitter, resolver, platform, status, and descriptions, so publishing to a public object store can cause unauthorized disclosure of internal business and possibly personal information.
The README tells users to check that the file ACL is set to public-read so the report link is accessible, which directly encourages public exposure of generated reports. Because the report aggregates customer-service issue data and may include unresolved issues, staff names, and business-sensitive trends, making the object world-readable materially increases the risk of data leakage.
The skill explicitly advertises generating a public COS link for reports, but the documentation does not warn that uploaded reports may contain internal operational data, names, unresolved issue ownership, or other sensitive business information. This creates a real risk of unintended external disclosure because users may treat upload/publication as a normal step without informed consent or data-classification checks.
The output is explicitly named report_cn_latest.html, indicating Chinese-language output as the default or fixed behavior. The skill description does not offer users a language choice or explain why Chinese-only output is required, which can violate language or locale choice policy.
The weekly workflow operationalizes upload, permission setting, and link distribution as a routine step, increasing the chance that sensitive customer-support analytics are exposed externally every week. In context, the report includes named personnel rankings and unresolved issue statistics, so silent public sharing could leak internal performance data and business-sensitive trends.
This markdown file presents all operational guidance, workflow steps, and usage instructions exclusively in Chinese. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified, which is not stated here.
This code file contains natural-language text in the module docstring that presents the skill as Chinese-only, and the runtime usage/help and status messages elsewhere in the script follow the same pattern. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly justified.
The top-level documentation describes checks of field names, response headers, chart rendering, and report generation as a pre-deployment validation script, but it does not disclose that the script will contact an external URL when a COS link is provided. This is an intent-level mismatch because the implementation in L204-L272 performs outbound HTTP requests rather than only local inspection.
The module docstring and CLI usage text are entirely in Chinese, and the script continues this pattern in all user-facing output. For a general-purpose checking script, this imposes a specific language/locale on users without offering a choice or documenting a justified region-specific constraint.
The configuration enables auto_upload and documents COS publication behavior without any warning, consent step, or data-classification guardrails. In this skill's context, the generated reports include customer issue data and are uploaded as inline HTML to a public-accessible path, which creates a real risk of unintended external data exposure.
The output file name report_cn.html indicates the generated report is specifically Chinese-language, and the document does not offer any language choice or opt-in. This is a natural-language locale policy concern because the skill appears to enforce a specific language by default.
The published COS artifact report_cn_latest.html reinforces that the skill outputs Chinese-language reports, but the file provides no user-facing option to choose another language or acknowledge the locale restriction. This can violate language/locale policy unless the constraint is explicitly justified.
The test script directly calls weekly_report(test_file), and based on the surrounding skill context this report flow may include network upload behavior via the referenced upload_cos.py path. Running a test command is typically expected to be local and non-destructive, so invoking functionality that may exfiltrate generated data or perform external side effects without an explicit warning or confirmation is unsafe.
The put_object call is part of an outbound transfer path that copies local file contents to remote cloud storage. In isolation cloud upload is not always malicious, but in this skill context it is risky because the upload is paired with embedded credentials, public exposure settings, and a report-handling purpose that does not justify unrestricted external publication.
print(f"\n【尝试 {retry_count + 1}/{max_retries}】上传文件...")
# 上传并设置正确的响应头
response = client.put_object(
Bucket=BUCKET,
Body=content,
Key=cos_key,
The script can upload arbitrary local file contents and expose them publicly without a clear warning, approval step, or validation that the file is safe for internet publication. This increases the chance of accidental disclosure of confidential files and turns the skill into an easy data-leak mechanism if misused by a user or another component.
The script automatically uploads the generated HTML report to COS using a public URL flow without any explicit consent, warning, or configuration gate at the point of transmission. Because the report summarizes customer issue data and may contain sensitive operational or user-related information, this creates a real data exfiltration/privacy risk if operators run the tool assuming processing is local-only.
The skill documentation appears to force a single language/locale for all user-facing instructions and outputs such as report_cn.html, with no indication that users may choose another language. Under the stated policy, forcing a specific language without opt-in can be a natural-language policy violation unless clearly justified.
The file-level description repeatedly states Chinese-only behavior, including '中文完美显示', and all user-facing strings are fixed in Chinese. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern unless the locale restriction is explicitly justified.
This markdown report is written fully in Chinese, including headings, labels, and the linked report name, with no indication that users can choose another language or that the skill is intentionally region-specific. Under the policy for natural-language violations, forcing a specific language without user opt-in can be a locale-policy issue.
This markdown template forces a single language/locale for the generated report content, including headings and labels, and does not indicate any user opt-in or configurable language option. Under the stated policy, fixed language output without user choice can be a natural-language policy violation unless it is explicitly justified as region-specific.
The file's natural-language strings and description are entirely in Chinese, including the skill description and user-facing test output, with no indication that language is configurable or intentionally limited to a Chinese-speaking context. This can violate language/locale policy when a skill implicitly forces one language without user opt-in.
No suspicious patterns detected.