Back to skill

Security audit

CCPA-Compliance(CCPA合规工具)

Security checks for vulnerabilities and agentic risk

Overview

This is mostly a local CCPA compliance tool, but its main command trusts code outside the package while claiming it has no external dependencies.

Review this package before installing. Only run it if you trust the adjacent compliance_core module that will be imported from outside the skill package, or isolate it in a controlled environment. Treat outputs as compliance guidance only, not legal advice, and use explicit output paths carefully because the tools can write reports/templates to user-specified files.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
scripts/ccpa-check.py:12
Finding

Untrusted Out-of-Project Python Module Import

Content
View full analysis

Vulnerability Details

File Location: scripts/ccpa-check.py, lines 12–15
Vulnerability Type: Untrusted search-path modification and external module loading
Risk Level: Medium

Vulnerable code:

python
# Ensure compliance_core can be imported
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))

from compliance_core import UnifiedCLI, CheckEngine, CheckResult, Severity

Technical Analysis

The script prepends a directory outside the audited project to Python's module search path and then imports compliance_core. That module is not included in the audited project.

Because the inserted directory has the highest import precedence, Python will execute the initialization code of any compliance_core package found there. The implementation therefore places executable trust in an adjacent, unaudited component and contradicts the project's documented claim that it has no external dependencies.

The problem is also reachable indirectly through scripts/security_check_ccpa.py, which launches ccpa-check.py --help as a functional test. Argument parsing does not protect this path because Python resolves the import before main() handles --help.

Attack Path

  1. An attacker obtains write access to the directory two levels above scripts/ccpa-check.py, or compromises a pre-existing adjacent compliance_core package.
  2. The attacker creates or modifies compliance_core/__init__.py and places arbitrary Python statements in its module initialization path.
  3. A user runs either:
    • python scripts/ccpa-check.py, or
    • python scripts/security_check_ccpa.py.
  4. The script prepends the attacker-influenced parent directory to sys.path.
  5. Python imports the attacker-controlled compliance_core package.
  6. Its initialization code executes before the compliance checker performs its intended work.

Exploitation requires the attacker to control the relevant parent-direc ...[truncated 705 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the parent-directory search-path modification:
    python
    sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
    
  2. Bundle compliance_core within the audited distribution and import it through a package-relative path, or declare it as a version-pinned dependency obtained from a trusted and integrity-verified source.
  3. If loading an adjacent component is an intentional deployment requirement, resolve its canonical path and reject locations outside an explicitly trusted installation root. Validate ownership and permissions before importing it.
  4. Avoid relying on the current working directory or broadly writable parent directories for module discovery.
  5. Test the packaged Skill in an isolated environment to ensure that only bundled or explicitly installed dependencies are importable.
  6. Update the README, Skill description, package metadata, and dependency documentation so that the external runtime requirement is accurately disclosed.
  7. Modify the security checker so it does not execute a target whose dependencies have not first been resolved and validated.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (29)

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The declared purpose is business compliance assessment, but the observed behavior includes self-auditing project files and invoking subprocesses unrelated to the promised compliance workflow. That discrepancy increases the chance of unexpected local execution and undermines trust, especially when users expect a narrowly scoped compliance assistant rather than a codebase scanner.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared purpose is business compliance assessment, but the observed behavior includes self-auditing project files and invoking subprocesses unrelated to the promised compliance workflow. That discrepancy increases the chance of unexpected local execution and undermines trust, especially when users expect a narrowly scoped compliance assistant rather than a codebase scanner.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared purpose is business compliance assessment, but the observed behavior includes self-auditing project files and invoking subprocesses unrelated to the promised compliance workflow. That discrepancy increases the chance of unexpected local execution and undermines trust, especially when users expect a narrowly scoped compliance assistant rather than a codebase scanner.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 142)May include surrounding context.

md
python scripts/security_check_ccpa.py

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 189)May include surrounding context.

md
python scripts/security_check_ccpa.py

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 268)May include surrounding context.

md
python scripts/security_check_ccpa.py

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The file title and all substantive changelog entries are written in Chinese, with no indication that users may select another language or that the skill is intentionally limited to a Chinese-speaking audience. This creates a natural-language locale constraint that is not presented as optional or justified in the file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The guide is written entirely in Chinese, including the title and all operating instructions, with no indication that other languages are available or that the locale restriction is intentional. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless clearly justified.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill advertises executable scripts and cross-tool behavior but does not declare any explicit tool permissions or allowed-tools scope. In an agent environment, missing scope boundaries can enable broader-than-expected file, shell, or network access if the runtime infers capabilities from content or code, weakening least-privilege controls.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The skill metadata and usage description are presented in Chinese for a California privacy compliance tool, but there is no statement offering alternate language output or indicating that Chinese-only operation is intentional and justified. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Overly broad trigger keywords can cause the skill to activate in unrelated privacy or compliance conversations. Unintended invocation is dangerous here because users may receive domain-specific compliance guidance or run local scripts in contexts where they did not intend to use this skill, increasing confusion and accidental action.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Natural-language policy violations apply to all file types, including code comments, docstrings, and CLI descriptions. Here, the visible descriptive text and output messages are Chinese-only, and the file does not indicate that the tool is region- or language-restricted or provide an opt-in language choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file’s user-facing description and operational text are entirely in Chinese, and the script presents its interface and reports in Chinese without any opt-in or language-selection mechanism. Under the policy, forcing a specific language without user choice is a natural-language policy violation unless the locale restriction is clearly justified, which is not stated here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code's natural-language interface is entirely in Chinese, including the module description, CLI help text, status messages, and report output. Because the skill does not offer any user opt-in or language selection, it violates the policy against forcing a specific language or locale without user choice.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The CLI advertises opt-out types such as 'sharing' and 'marketing', but the implementation only produces checks for 'do_not_sell_link', 'global_signal_support', 'agent_authorization', and 'compliance_monitoring'. Selecting unsupported types can trigger incorrect filtering logic and cause missing or misleading compliance results, which is dangerous in a privacy compliance tool because users may wrongly believe required CCPA/CPRA controls were evaluated.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The documentation states the script verifies 'security' and 'pure local running' characteristics, but the implementation also executes another script. While subprocess execution remains local, this is still a significant trust-boundary issue because a verifier should not implicitly run code from the artifact it is validating without prominently disclosing that behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring and subsequent user-facing output strings are presented in Chinese, and the script does not offer a language selection or opt-in mechanism. This can violate language/locale policy requirements when users are not given a choice of language.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

A local CCPA compliance checker is expected to analyze files, not launch additional programs. This mismatch increases risk because an attacker could hide behavior in ccpa-check.py that will be executed automatically by the security-check script, undermining the claim that the tool is only performing local safety validation.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
88% confidence
Finding

The script executes another local program via subprocess.run, which expands its capabilities beyond passive file inspection into code execution. Even though the command is fixed to a local help invocation and shell injection is not present, running another script can still trigger unintended side effects if that target script is unsafe, replaced, or behaves unexpectedly during startup.

Content

Scanner excerpt · scripts/security_check_ccpa.py (reported line 273)May include surrounding context.

python
for cmd in test_commands:
                try:
                    result = subprocess.run(
                        cmd,
                        capture_output=True,
                        text=True,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The subprocess call occurs automatically and without any user-facing confirmation, so users may believe they are only performing a safe inspection while the script is actually running another program. That can lead to accidental execution of malicious or buggy code bundled in the skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code file contains natural-language docstrings and templates that consistently force a specific language/locale for generated compliance materials and user-facing instructions. Under the policy, language constraints should either provide user opt-in/choice or be clearly documented as region-justified; here the file is CCPA-focused but does not state that Chinese is an intentional user-selected output language.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

L390 的注释将“不自动创建目录”表述为是在遵守“ 不执行任何系统修改 ”声明,但紧接着 L394-L395 仍然会打开输出路径并写入文件。该注释把“不会创建目录”混同于“不会进行系统修改”,与实际存在文件写入副作用的代码行为相矛盾。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code file contains natural-language docstrings and user-facing print output entirely in Chinese, starting with the module description and continuing throughout the script. Under the policy rule for language/locale violations, forcing a specific language without user opt-in is a reportable issue when no alternative language selection or justification is provided.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The main test routine prints multiple status and result messages directly to the console in Chinese. Because the file does not provide any locale selection, fallback language, or documented region-specific justification, this is a natural-language policy violation under the language/locale rule.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

L117声明“网络调用: 无 (纯本地运行)”,紧接着L118却写“依赖安全: 仅两个常见库”,这与前文L008-L010、L019-L026以及后文L130所强调的“零外部依赖/仅标准库”相互冲突。虽然这是文档层面的矛盾而非代码行为,但它属于同一技能文档对实现意图的直接自相矛盾陈述。

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.