T09 · Insecure Skill Coding Practices
- Location
scripts/cls_sqlite_ingest.py:53- Finding
SQLite ingestion fails because date_key is bound twice
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill fetches public Cailian Press telegraph data and stores/query it locally in ways that match its stated purpose, with some operational caveats but no evidence of malicious behavior.
Before installing, expect the skill to contact CLS/Cailian Press endpoints and store fetched telegraph/news records locally. Review retention needs before using the prune script or cron examples, and prefer pinning dependencies plus fixing the SQLite binding bug for reliable operation.
scripts/cls_sqlite_ingest.py:53SQLite ingestion fails because date_key is bound twice
scripts/cls_migrate_jsonl_to_sqlite.py:39JSONL-to-SQLite migration fails because date_key is bound twice
The skill documentation is entirely in Chinese and does not provide a language choice, translation, or clear opt-in for non-Chinese readers. In a multi-user or mixed-language environment, this can prevent reviewers and downstream users from understanding operational constraints, usage rules, and security-relevant caveats, increasing the chance of misuse or missed risks.
Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
tags_json, sub_titles_json, timeline_json, ad_json, assoc_fast_fact_json, assoc_article_url,
assoc_video_title, assoc_video_url, assoc_credit_rating_json, stock_list_json, subjects_json,
plate_list_json, content_hash, first_seen_at, last_seen_at, seen_count, date_key
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
""",
(article_id, *values, captured_at, captured_at, 1),
)
Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
tags_json, sub_titles_json, timeline_json, ad_json, assoc_fast_fact_json, assoc_article_url,
assoc_video_title, assoc_video_url, assoc_credit_rating_json, stock_list_json, subjects_json,
plate_list_json, content_hash, first_seen_at, last_seen_at, seen_count, date_key
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
""",
(article_id, *values, captured_at, captured_at, 1),
)
The script fetches remote data via fetch_telegraph_list() and then persists raw and derived content into multiple database tables, but there is no docstring, comment, or user-facing notice explaining that network retrieval and local storage will occur. While the script prints a summary at the end, that output does not disclose the safety-relevant behavior before or during execution.
The formatter emits all user-facing Markdown labels and messages in Chinese, such as the heading and field names, with no indication that language selection is configurable or intentionally limited to a specific locale. This creates a natural-language policy concern because the skill imposes a language choice on all users without opt-in.
The file defines a fixed timezone of "Asia/Shanghai" and uses it for timestamp normalization, which imposes a specific locale behavior on all outputs. Under the policy, locale-specific behavior should either be user-selectable or clearly justified as region-specific; neither is present in this file.
The document leads with Chinese title and primary Chinese explanatory content before the later English overview, which may signal a default language requirement or expectation without explicitly offering a language choice to the user. Under the stated policy, skills should avoid forcing a specific language unless the constraint is documented and justified or users are given an explicit option.
This markdown file documents that the skill stores collected telegraph data in a local SQLite database, keeps raw ingest logs for 30 days, and deletes older logs, but it does not explicitly warn users that running the skill will persist fetched data on disk and perform retention-based deletion. For a skill description, these data-affecting behaviors should be disclosed clearly as operational warnings because they can impact local storage, audit expectations, and data lifecycle management.
The dependency is specified as requests>=2.31.0, which allows future unreviewed versions to be installed and makes builds non-reproducible. This increases supply-chain risk because a later vulnerable or malicious release could be pulled in without explicit review or testing.
requests>=2.31.0
Because requests is not pinned to a specific version, it is impossible to verify from this manifest whether the installed package includes fixes for known advisories. The danger is not that requests is inherently unsafe, but that the open-ended constraint can resolve to an affected version in some environments, leaving the skill exposed to publicly known issues.
The function performs a network request to an external domain using a supplied article_id and custom headers, but there is no docstring, comment, logging, or other user-facing disclosure indicating that external communication occurs. For code files, outbound network calls can warrant a warning when the file itself provides no visible notice of that behavior.
The code fixes its timezone to Asia/Shanghai via a global constant, and that locale is then used for date formatting and batch IDs. Because the file contains no natural-language justification or user opt-in for this locale constraint, it can violate the policy against forcing a specific locale without user choice.
The function is annotated as returning str, but the docstring says Return raw dict for JSON serialization. and the implementation returns result.to_dict(), which is consistent with a dict-like object rather than a string. This is an active contradiction between documentation/type intent and actual behavior, not merely missing detail.
The user-facing strings produced by this formatter are all in Chinese, including result summaries and item labels. For a general-purpose formatter, this imposes a fixed language/locale without any opt-in, selection mechanism, or documented region-specific justification, which matches the natural-language locale policy violation criteria.
This code appends serialized item data to a persistent JSONL file, which is a file-write operation covered by the missing-warning rule for code files. There is no confirmation prompt, logging/print output, docstring, or comment in this file explaining that snapshot data will be written to disk.
No suspicious patterns detected.