T09 · Insecure Skill Coding Practices
- Location
scripts/pipeline/ai_rerank.py:173- Finding
Academic abstracts and API credentials can be transmitted to an unrestricted external LLM endpoint
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill automates paid academic database research, but it also handles browser sessions, cookies, API keys, and abstracts with under-disclosed and overbroad security impact.
Install only if you are comfortable giving the skill access to authenticated academic database sessions and research artifacts. Avoid the cookie extractor/bridge unless you fully understand that cookies are active login credentials; do not paste cookie values into ordinary config files or logs. Review and pin the LLM base URL/provider before running rerank, summarize, or theme clustering, because paper metadata and abstracts may be sent outside your machine.
scripts/pipeline/ai_rerank.py:173Academic abstracts and API credentials can be transmitted to an unrestricted external LLM endpoint
scripts/utils/cookie-extractor.py:217Authentication cookies are printed in plaintext and recommended for plaintext configuration storage
scripts/utils/cookie_bridge.py:54Cookie bridge copies an overbroad set of browser sessions into the automation profile
scripts/pipeline/scopus_search.py:47Scopus API key is exposed in the request URL despite already being sent in a header
scripts/pipeline/setup.py:178Setup repair mode installs unpinned packages from the active package index
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
try:
with urllib.request.urlopen(req, timeout=30) as resp:
raw = resp.read().decode('utf-8')
声明描述的是一个较完整的学术数据库访问与内容处理管线,覆盖 IEEE/Scopus/EV/ACM、多步搜索与结果处理,并借用用户登录态作为权限桥接。实际代码则是一个非常具体的 ACM 页面下载链接提取器:读取当前详情页 DOM、识别下载/阅读链接、去重,并在缺失时按 DOI 构造 PDF URL。虽然它与“借用浏览器登录态访问 ACM 页面”这一大方向有弱相关性,但其实际功能范围远小于声明,且缺少声明中的核心能力(搜索、摘要处理、评分、多数据库支持)。因此属于明显的描述与行为不一致。
The declared description presents a broader academic-database access bridge for specific paid platforms (IEEE, Scopus, EV, ACM) with end-to-end workflow features: using browser CDP and user login state, searching, extracting, deduplicating, filling in abstracts, scoring, and outputting results. The supplied code instead is a narrow extractor for CNKI search result pages. It parses a specific HTML table on CNKI, infers document type from table cells, and returns metadata. There is no evidence of CDP session bridging, no interaction with IEEE/Scopus/EV/ACM, and none of the higher-level pipeline steps like deduplication, abstract supplementation, or scoring. This is a material description-behavior mismatch, not just an implementation detail.
The declared description presents a broader academic-database access bridge focused on specific providers (IEEE/Scopus/EV/ACM) and a full pipeline including search, deduplication, abstract supplementation, and scoring. The supplied code chunk is a narrow DOM scraper for Web of Science search results. While extraction is part of the declared workflow, this chunk accesses a materially different resource (WoS, not the listed databases) and lacks the distinctive behaviors highlighted in the description, especially abstract handling and CDP-based session bridging. That makes the description inaccurate for this code chunk.
The declared description presents a network/browser-based academic database access and retrieval pipeline. This code does not implement any of those core behaviors. It only accesses the local filesystem, enumerates recent downloaded files, optionally searches for an exact filename, matches filenames against supplied paper titles using simple token overlap, and writes a local JSON cache of match results. While downloaded-paper matching could be a supporting utility in a larger academic-paper workflow, the declared purpose specifically emphasizes CDP-based session reuse, paid database search/access, extraction, deduplication, abstract filling, and scoring; none of these are present in the supplied chunk. Therefore this code chunk materially differs from the declared purpose.
The description and code are materially different. The declared purpose describes a database-access/search bridge layer that uses browser CDP and user authentication to query paid academic sources and process results end-to-end. The supplied code does none of that. It is a local monitoring/diff tool for previously generated result files, storing monitor configs and baselines under memory/monitors and exposing CLI commands to create, inspect, diff, save, suppress, and delete monitors. The file header even states it 'never participates in search pipeline.' This is not a supporting subcomponent of the declared bridge/search functionality; it is a separate feature with a different primary purpose and different resources/triggers.
The declared description presents a full academic-database access and retrieval pipeline: connecting through browser CDP, leveraging the user's authenticated session, searching multiple paid sources, extracting records, deduplicating them, supplementing abstracts, scoring results, and producing output. The supplied code does none of that. It is a standalone Python script for post-processing already-produced paper JSON files by stripping abstract fields or emitting a metadata-only summary. While the script loosely relates to the declared phrase 'zero-token abstract handling,' that is only one small aspect and does not make the overall description accurate. The primary purpose and capabilities are materially different, so this is a clear mismatch.
The declared description centers on a browser-based authentication bridge into paid academic databases and an end-to-end retrieval pipeline. This code chunk does none of that. It is a post-processing/reranking component: it consumes already-enriched paper records, loads abstracts from local cache/files, calls a remote LLM API for semantic scoring, adds tags/metadata, and writes ranked output. While 'scoring' and handling abstracts are loosely related to part of the declared pipeline, the primary purpose and resource access are materially different, and key claimed capabilities—CDP login-state borrowing, database querying, search, extraction, and deduplication—are absent.
The declared description presents this skill as an access bridge for paid academic databases that leverages browser CDP and a user's authenticated session to search and retrieve papers, then post-processes them through extraction, deduplication, abstract completion, and scoring. The supplied code does none of that. It is narrowly focused on AI summarization: it loads papers from an input JSON, optionally reads local abstract files, constructs prompts, calls a chat-completions API, and stores generated Chinese summaries in the output. While the description mentions 'zero-token abstract handling,' the code's behavior of reading abstracts from files and avoiding broader context only loosely overlaps and does not make the overall description accurate. The primary purpose and capabilities are materially different.
The declared description presents a database-access bridge that uses browser CDP and authenticated sessions to query paid academic sources and run a broader retrieval/enrichment pipeline. The supplied code does none of that. It only operates on local files: it loads enriched.json, inspects referenced abstract text files, checks abstract length, reports completeness, and generates a Tier 2 task JSON if too many abstracts are missing. While abstract-related handling is loosely related to the broader pipeline, this chunk’s actual primary function is integrity checking and workflow routing, not paid-database access or browser-session bridging. Therefore the description does not accurately represent this code chunk.
The declared description presents a database-access and retrieval pipeline centered on authenticated browser-based access to paid scholarly platforms, followed by search, extraction, deduplication, abstract completion, scoring, and output. The supplied code instead operates entirely locally: it parses JSON inputs, validates schema, computes tier labels from preexisting score fields, reads abstracts from local files, formats metadata, and writes BibTeX/RIS. The header explicitly says 'no browser, no login, no network,' which directly contradicts the declared browser/CDP/database-access purpose. While there is limited overlap with 'output' and some abstract handling, the main behavior is materially different and lacks the core declared capabilities.
The declared description presents a paid-database access bridge centered on browser/CDP session reuse and downstream literature-processing steps. The provided code chunk is materially different: it is a lightweight preflight validator that calls the free OpenAlex API to estimate whether a query is too narrow or too broad before later stages. This is not merely a supporting low-level detail of the declared behavior; its primary purpose, accessed resource, and operational method are different from the description. The code neither touches paid databases nor uses browser state, and it lacks the extraction/dedup/abstract/scoring functions claimed in the description.
The declared description presents a broad capability: connecting to paid academic databases through browser CDP, reusing user login state, then searching, extracting, deduplicating, enriching abstracts, scoring, and outputting results. The supplied code chunk does not implement those access or acquisition behaviors. Instead, it operates on an already-produced local JSON dataset (themed.json) and formats the final Markdown report. It does include limited abstract fallback handling and scoring/tiering for presentation, which are consistent with a downstream output stage, but the primary behavior is materially narrower and different from the declared purpose. Therefore this chunk does not accurately represent the declared skill functionality.
The declared description presents a much broader acquisition pipeline component: borrowing a user's browser login state via CDP to access subscription databases, search them, extract papers, fill missing abstracts, score results, and output ranked data. The supplied code does none of that. It only reads already-produced JSON results, deduplicates/merges paper records by DOI and fuzzy title, normalizes type labels, validates schema, and writes an output file. The script explicitly states that scoring is handled elsewhere and that it only does load → deduplicate → write. This is a material description-behavior mismatch in primary purpose and capabilities, not merely an incomplete snippet of the declared functionality.
The declared description presents a database-access bridge that leverages a user's authenticated browser session to query paid academic sources and run a broader search/extract/deduplicate/score pipeline. The supplied code does not do any of that. It is a standalone merge utility for Tier 2 results: it loads JSON files, matches result entries to existing papers using docId/DOI/title similarity, writes abstract text to local files, updates references in enriched.json, and saves output. While '补摘要' (filling abstracts) is tangentially related, the primary behavior is local data merging and file management, not authenticated database access or browser automation. This is a material description-behavior mismatch.
The declared description presents this skill as an access bridge to paid academic databases that uses browser CDP and the user's login state to search and retrieve papers, then deduplicate, enrich abstracts, score, and output results. The supplied code chunk does something much narrower and materially different: it operates only on an input JSON file of already-merged papers and performs metadata normalization, multi-dimensional scoring, tagging, sorting, summary logging, schema validation, and optional file output. There is no network/database access, no browser automation, no CDP, no session reuse, no extraction from IEEE/Scopus/EV/ACM, no deduplication implementation, and no abstract backfilling. This is a clear description-behavior mismatch, although the scoring/output portion is partially aligned with the latter part of the declared pipeline.
The declared description presents a full academic-database access and processing pipeline: using browser CDP to reuse a logged-in user session, searching paid databases, extracting records, deduplicating them, filling in missing abstracts, scoring, and outputting results. The supplied code chunk does something much narrower: it builds search queries from structured JSON for several databases and prints them as URLs, strings, JSON, or command suggestions. While it references downstream scripts and browser actions in notes/printed commands, this code itself does not perform those actions. Therefore the code’s actual behavior is only a query builder component, which is materially narrower and different from the declared end-to-end bridge/search/extraction/scoring system.
The description presents a much broader and different system: a permission-bridging layer for paid academic databases via browser CDP and user login state, covering IEEE/Scopus/EV/ACM and including post-processing such as abstract completion and scoring. The supplied code does none of that. It only performs direct HTTP requests to the Elsevier Scopus Search API with an explicit API key, paginates results, normalizes a small metadata subset, deduplicates by DOI, and saves output. While deduplication and search/output are consistent with part of the description, the primary access mechanism, scope of databases, and several claimed processing steps are materially absent, so this is a clear description-behavior mismatch.
声明描述的是面向付费学术数据库的数据访问与处理流水线,而该代码块并未执行任何数据库搜索、内容提取、摘要补全、去重或评分逻辑。它的主要用途是安装前/运行前环境自检与修复,属于配套运维脚本,不是声明中的核心功能实现。虽然代码中提到 cookie bridge、浏览器引擎、数据库连通性、extractors 文件等,与整体项目背景有关,但这些只是在为后续功能做准备。更重要的是,代码具备声明未提及的能力:调用 pip 安装包、写回 config.yaml、探测本机浏览器与网络状态。因此,描述与该代码块的实际行为存在明显且实质性的不匹配。
The declared description describes an authentication/access bridge for paid academic databases using browser CDP and user session borrowing, plus a full retrieval pipeline (search, extract, dedupe, abstract补全, scoring, output). The supplied code does none of that. It operates on already-provided paper JSON input, clusters the top papers by theme using an external chat-completions API, adds _theme annotations, and writes structured output. Its primary purpose is thematic post-processing, not database access or retrieval. The only network access present is to a configured LLM endpoint, which is not mentioned in the declared purpose. Therefore the description materially misrepresents the code's actual behavior.
The declared description presents a system for bridging authenticated access to paid academic databases through browser CDP, reusing a user's login state, and performing a multi-step scholarly retrieval pipeline. The supplied code does none of that. It is a narrow utility focused on querying the public arXiv API over HTTP, parsing Atom-like XML text, selecting the best title match, applying DOI-based verification/rejection, and emitting arXiv metadata and optional PDF URLs. There is no browser automation, no CDP usage, no authenticated session handling, no interaction with IEEE/Scopus/EV/ACM, and no abstract processing. This is a clear material mismatch in both primary purpose and accessed resources.
The declared description presents a full academic-database access bridge that leverages browser CDP and user login state to search databases and process results. The supplied code does not implement any of that pipeline. Instead, it is a cookie-processing helper: it accepts cookie text from a file/stdin/interactive paste, parses name/value pairs, validates presence of required cookies for selected databases, and emits a compact cookie header string or JSON. While cookies and login state are related to the broader declared system, this chunk’s actual primary purpose is manual cookie extraction and formatting, not CDP-based authenticated browsing or literature retrieval/processing. Therefore this is a material description-behavior mismatch.
The code does relate to session transfer for academic database access, so it is partially aligned with the broad idea of a 'permission bridge.' However, the declared description specifically says access is bridged 'through browser CDP' and suggests a larger end-to-end academic search/extract/rank workflow. This code does not use CDP at all; instead it directly accesses local browser files, extracts encryption keys from Chromium Local State, decrypts cookies, and injects them into another browser profile. That is a materially different mechanism with stronger local credential-handling behavior than described. In addition, none of the claimed downstream functions—search, extract, deduplicate, supplement abstracts, score, or zero-token abstract handling—are present in this chunk. Therefore the description does not accurately represent what this code chunk actually does.
该代码片段的实际职责是一个狭窄的 DOI 工具模块,属于论文处理系统中的辅助实现细节,而不是声明所描述的“权限桥接层”或完整学术数据库抓取/处理流水线。虽然 DOI 提取、匹配、标题相似度可作为去重或标识管理的支持能力,但片段完全没有任何浏览器自动化、CDP 会话复用、认证态访问、数据库检索、摘要抓取/补全、评分或结果输出逻辑。因此,就此代码片段而言,声明描述与实际行为存在明显不匹配。
The declared description presents a database-access and paper-processing bridge that uses browser CDP and user session state to retrieve and process academic papers. The supplied code does none of that. It is a utility module for pipeline schema validation: it checks whether paper dictionaries contain expected fields for named stages, writes issue reports to memory/pipeline_issues.json, stamps metadata, and checks pipeline version compatibility. While some stage names reference search/enrichment/ranking/summarization, this file only validates outputs from those stages; it does not implement the described bridge behavior. Therefore the description materially misrepresents the actual code's primary function.
No suspicious patterns detected.