Back to skill

Security audit

《毛选》1-7卷文本查询

Security checks for vulnerabilities and agentic risk

Overview

This is a local search skill for Mao Selected Works with optional remote RAG, and its sensitive behavior is mostly disclosed and purpose-aligned, though remote API configuration and historical violent political content require care.

Install only if you want a Mao Selected Works corpus/search tool. Keep the default local search mode for lowest risk. If enabling RAG, configure only a trusted HTTPS provider and a dedicated low-privilege API key, because queries and text passages may be sent to that endpoint. Treat returned passages as historical source material, especially where they discuss violence, repression, weapons, or protected groups.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/common.py:321
Finding

Unrestricted RAG endpoint can receive API credentials, user queries, and corpus content

Content
View full analysis
dict[str, Any]: body = json.dumps(payload).encode("utf-8") headers = {"Content-Type": "application/json"} if api_key: headers["Authorization"] = f"Bearer {api_key}" request = urllib.request.Request(url, data=body, headers=headers, method="POST") try: with urllib.request.urlopen(request, timeout=120) as response: return json.loads(response.read().decode("utf-8")) ``` `scripts/common.py:338-352`: ```python def resolve_service_config(config: dict[str, Any], section: str) -> dict[str, Any]: rag_cfg = config.get("rag", {}) api_cfg = rag_cfg.get("api", {}) service_cfg = dict(rag_cfg.get(section, {})) if not service_cfg.get("base_url") and api_cfg.get("base_url"): service_cfg["base_url"] = api_cfg["base_url"] if not service_cfg.get("provider") and api_cfg.get("provider"): service_cfg["provider"] = api_cfg["provider"] api_key_env = service_cfg.get("api_key_env") or api_cfg.get("api_key_env") if api_key_env: service_cfg["api_key_env"] = str(api_key_env) service_cfg["api_key"] = os.environ.get(str(api_key_env), "") elif service_cfg.get("api_key"): pass elif api_cfg.get("api_key"): service_cfg["api_key"] = os.environ.get(str(api_cfg["api_key"]), "") ``` `scripts/common.py:357-396`: ```python def embed_texts(texts: list[str], config: dict[str, Any]) -> list[list[float]]: embedding_cfg = resolve_service_config(config, "embedding") base_url = str(embedding_cfg.get("base_url", "")).rstrip("/") model = embedding_cfg.get ...[truncated 5653 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (255)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · README.md (reported line 108)May include surrounding context.

md
| 开启 RAG | `python scripts/config.py set rag.enabled true` |
| 开启向量建库 | `python scripts/config.py set rag.build_embeddings_on_index true` |
| 测试 embedding | `python scripts/search.py test-model --target embedding` |
| 重建索引 | `rm -f index/search.sqlite && python scripts/build_index.py` |

---

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The documented purpose is content retrieval, but the skill instructions also direct configuration mutation and index-building behavior, which are operational side effects beyond simple querying. This mismatch can mislead callers into invoking a 'search' skill that changes local state or enables remote RAG features, undermining informed consent and safe orchestration.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documented purpose is content retrieval, but the skill instructions also direct configuration mutation and index-building behavior, which are operational side effects beyond simple querying. This mismatch can mislead callers into invoking a 'search' skill that changes local state or enables remote RAG features, undermining informed consent and safe orchestration.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented purpose is content retrieval, but the skill instructions also direct configuration mutation and index-building behavior, which are operational side effects beyond simple querying. This mismatch can mislead callers into invoking a 'search' skill that changes local state or enables remote RAG features, undermining informed consent and safe orchestration.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

This markdown file contains natural-language content endorsing violent acts such as public humiliation, coercion, and the creation of 'terror' as politically necessary. Such language is a policy-relevant natural-language safety concern because it promotes harmful conduct rather than neutrally documenting it with clear distancing or warning.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The passage states that executing targets is effective and argues there is no reason it should be considered wrong. This is a direct natural-language endorsement of lethal violence and therefore constitutes a serious policy concern in the content of the file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file is dominated by prescriptive political language endorsing armed struggle, expansion of armed forces, and revolutionary escalation, including statements about creating and enlarging armed forces and preparing armed uprisings. Even though the text appears historical, the file itself does not provide any explicit framing that it is archival, educational, or non-operational, so the natural-language content can conflict with safety expectations for skill content.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file is a full-text retrieval source for political material that explicitly endorses revolutionary war, urges mass participation in armed struggle, and portrays violent confrontation as necessary and righteous. In a skill context, serving this content on demand can facilitate dissemination of extremist or violence-glorifying propaganda, especially because the skill is designed to help users locate and retrieve the exact passages efficiently.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file contains natural-language directives that define only one approved political alignment as legitimate, such as declaring a single standard for whether youth are 'revolutionary' and urging all youth toward that position. Under SQP-3, this is a natural-language policy concern because the text imposes a mandatory viewpoint without opt-in, choice, or a documented contextual justification tied to a bounded tool function.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file includes repeated instructions promoting armed conflict, building armed groups, and defeating opponents through military action. Such natural-language content raises a clear policy concern because it endorses coercive violence rather than presenting a neutral safety-bounded instruction set.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
89% confidence
Finding

The note states that some people '不敢坚决地用革命战争反对反革命战争' and presents the document as opposing that '错误思想,' which natural-language-wise endorses revolutionary war as the correct response. This is a policy-relevant issue because the file contains advocacy-like language around violence without clarifying that it is historical material or limiting it to archival context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

These lines include explicit calls to '拿起武器', '发展游击战争', and '全部地歼灭一切敌人', presenting violent political action as imperative instruction. As a natural-language policy concern applicable to all file types, this is a clear organizational-policy risk because the text promotes violent conduct rather than neutrally documenting it with safeguards or context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file is composed of advocacy for armed conflict, including language praising offensive military action and urging continued struggle against perceived enemies. In a skill repository context, embedding such mobilizing political language is a clear natural-language policy concern because it promotes violence rather than providing neutral, bounded functionality.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file contains explicit guidance about suppressing groups and approving death-penalty cases, but presents it as ordinary retrievable content with no warning, gating, or contextual safety handling. In a retrieval skill, surfacing such operational violent content directly to end users can normalize or facilitate harmful misuse, especially when users request exact passages or actionable excerpts.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file includes explicit language calling for the population to '坚决、彻底、干净、全部地粉碎' opponents' plans, framed as action against political enemies. Such natural-language directives endorse violent political repression rather than neutrally documenting a locale or language choice, which falls within policy-relevant content in natural language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

Line 23 prescribes government priorities including '肃清反动派的残余,镇压反动派的捣乱', which is direct natural-language support for suppressing political opponents. This is a substantive policy concern in the file's language content, independent of code execution or trigger quality.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
87% confidence
Finding

This markdown file includes natural-language statements endorsing deprivation of speech, coercive punishment, forced labor, and violent suppression of defined groups. Such prescriptive language is a policy-relevant natural-language concern applicable to all file types because it advocates coercive treatment rather than offering neutral historical or locale-specific guidance.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

Lines L07-L09 explicitly direct when people 'must' be sentenced to death and executed, and prescribe approval authority for arrests and killings. This is natural-language operational guidance for violent state action presented without any limiting context, which constitutes a policy-level safety concern in the file's language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
93% confidence
Finding

Line L05 contains natural-language statements endorsing suppression of certain viewpoints and prescribing what speech is or is not permitted, presented as an absolute policy. This is a policy-style natural-language constraint with no opt-in, choice, or narrow operational justification, which fits the organizational-policy-violation category for all file types.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file contains explicit endorsement of killing, arresting, and repressing named political target groups in natural language. Even though this appears to be historical source material rather than an operational instruction set, exposing or retrieving such content through a skill can facilitate extremist propaganda, glorification of violence, or unsafe political persuasion if returned without safeguards.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

This section endorses mass struggle, class-targeted confrontation, and coercive force against political and social groups. In a retrieval skill, such material is dangerous because users can directly request and reuse it as justification for violence or persecution, especially if the system provides the text verbatim and without critical context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The text praises violent public action, including physical attacks and mob-style pressure against officials and other targets, framing such acts as justified or welcome. In the context of a search skill, this increases the risk of harmful amplification because the system can be used to locate and surface rhetoric that legitimizes political violence.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The passage explicitly endorses a two-track approach in which violence is presented as a legitimate strategic option if political opponents do not yield. This is a natural-language policy concern because it normalizes violent action rather than neutrally describing historical events.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

This markdown file includes natural-language text explicitly endorsing obtaining and accelerating development of nuclear weapons, including atomic and hydrogen bombs. Such language is a genuine policy concern because it promotes weapons capability rather than neutrally describing a compliance-limited regional or language setting.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

This is a true positive: the file contains text that disparages Tibetan Buddhist clergy and advocates state-directed changes to religious practice in a one-sided, coercive framing. In a retrieval skill, serving such content without neutral context or safety framing can normalize religious denigration and cause the assistant to reproduce biased or discriminatory language as authoritative source material.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.exposed_secret_literal

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
scripts/common.py:361

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
scripts/search.py:334