Back to skill

Security audit

Agent Security Dlp

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real DLP skill, but it stores checked sensitive data in a local plaintext audit log by default and overstates some protections.

Review before installing in any environment that handles secrets, personal data, regulated records, or high-impact tools. Disable or redesign audit logging so raw protected data is not stored, enforce tool approval outside this library instead of relying on blocked=false results, and avoid relying on the lightweight input API until it calls the real input guard.

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 (3)

T09 · Insecure Skill Coding Practices

Warning
Location
lib/agent_dlp.py:1631
Finding

Plaintext audit logging retains raw sensitive input, memory content, and tool parameters

Content
View full analysis
Dict: result = { "blocked": False, "injection_detected": False, "findings": [], "text": text } ``` ```python class MemoryGuard: def check(self, memory_data: Dict) -> Dict: result = { "blocked": False, "findings": [], "sanitized_data": memory_data } ``` ```python class ToolGuard: def check(self, tool_name: str, params: Dict = None) -> Dict: result = { "blocked": False, "require_approval": False, "tool": tool_name, "params": params } ``` ```python class AuditLogger: def __init__(self, config: DLPConfig): self.config = config self.log_file = os.path.expanduser( config.get("audit.log_file", "~/.openclaw/logs/dlp-audit.log") ) def log(self, event_type: str, data: Dict): if not self.config.get("audit.enabled", True): return os.makedirs(os.path.dirname(self.log_file), exist_ok=True) log_entry = { "timestamp": datetime.now().isoformat(), "type": event_type, "data": data } with open(self.log_file, "a") as f: f.write(json.dumps(log_entry, ensure_ascii=False) + "\n") ``` ```python def check_input(self, text: str) -> Dict: result = self.input_guard.check(text) self.audit_logger.log("input_check", result) return result def check_memory(self, memory_data: Dict) -> Dict: result = self.memory_guard.check(memory_data) self.audit_logger ...[truncated 2352 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
lib/agent_dlp.py:1610
Finding

Dangerous tool approval is advisory and does not enforce blocking

Content
View full analysis
Dict: dangerous_tools = self.config.get("tools.dangerous", []) result = { "blocked": False, "require_approval": False, "tool": tool_name, "params": params } if tool_name in dangerous_tools: result["require_approval"] = True if self.config.get("tools.approval_required"): result["message"] = f"Tool {tool_name} requires approval" return result ``` The configured dangerous tools include: ```json "tools": { "dangerous": [ "exec", "delete", "write", "rm", "format", "drop", "truncate", "shutdown", "restart" ], "approval_required": true } ``` ### Technical Analysis The guard recognizes configured dangerous tools and sets `require_approval` to `True`, but it never sets `blocked` to `True`. It also does not invoke an approval provider, validate an approval token, or maintain an authorization decision. This makes the control advisory rather than enforcing. An integration that uses the returned `blocked` field as its allow-or-deny decision will treat every dangerous operation as permitted. The design therefore fails open despite `approval_required` being enabled. This is especially significant because the dangerous-tool list includes destructive operations such as command execution, deletion, formatting, database truncation, and shutdown. ### Attack Path 1. An attacker influences an Agent or application into requesting a configured dangerous tool. 2. The application calls `check_tool()` before execution ...[truncated 886 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
bin/dlp_client.py:125
Finding

Lightweight input checking bypasses prompt-injection detection

Content
View full analysis
0 output = { "blocked": is_blocked, "result": result if not is_blocked else text, "findings": findings, "cached": False, "time_ms": (time.perf_counter() - start) * 1000, "skipped": False } if use_cache and self.config["cache_enabled"]: self.cache.set(cache_key, output) return output def check_input(self, text): return self.check(text) def check_output(self, text): return self.check(text) ``` The actual prompt-injection detector is only reached by the core input API: ```python def check_input(self, text: str) -> Dict: result = self.input_guard.check(text) self.audit_logger.log("input_check", result) return result ``` ### Technical Analysis `LightweightDLP.check_input()` and `LightweightDLP.check_output()` both delegate to the same `check()` method. That method always calls `self.dlp.check_output(text)`. As a result, the lightweight input API runs sensitive-output regular expressions but never invokes ...[truncated 1653 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (27)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% 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 104)May include surrounding context.

result = dlp.check_input(user_input)

工具执行前检查

result = dlp.check_tool("exec", {"command": "rm -rf /"})

text

### 方式3: 装饰器自动触发

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% 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 · SKILL.md (reported line 217)May include surrounding context.

result = dlp.check_input(user_input)

工具执行前检查

result = dlp.check_tool("exec", {"command": "rm -rf /"})

text

### 方式3: 装饰器自动触发

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 104)May include surrounding context.

result = dlp.check_input(user_input)

工具执行前检查

result = dlp.check_tool("exec", {"command": "rm -rf /"})

text

### 方式3: 装饰器自动触发

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 · SKILL.md (reported line 217)May include surrounding context.

result = dlp.check_input(user_input)

工具执行前检查

result = dlp.check_tool("exec", {"command": "rm -rf /"})

text

### 方式3: 装饰器自动触发

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · lib/agent_dlp.py (reported line 467)May include surrounding context.

python
"pattern": r"npm_[A-Za-z0-9]{36}",
            "action": "block",
            "severity": "critical",
            "description": "NPM Access Token",
            "category": "credential"
        },
        "pypi_token": {

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The natural-language content, headings, descriptions, and command annotations are presented in Chinese throughout the file. Under the policy, forcing a specific language without user opt-in or documented justification is a locale/language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The user-facing documentation is written almost entirely in Chinese, including headings, usage instructions, and trigger descriptions, with no indication that this skill is China-specific or that alternative language support is available. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
81% confidence
Finding

The skill advertises operational capabilities including logging and a CLI entrypoint, and the static analyzer detected file-write capability, but the manifest does not declare any tool scope such as permissions or allowed-tools. Undeclared write-capable behavior weakens least-privilege controls and makes it harder for a host agent to constrain where the skill can write, especially given the documented audit logging feature.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The natural-language content of the skill forces a specific language/locale for users, and the document does not provide an opt-in, alternative language, or explanation that the skill is intended only for a Chinese-speaking or region-specific audience. This matches the policy category for language or locale constraints without user choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The module docstrings and inline user-facing descriptions are written in Chinese only, while the file does not indicate that the tool is region-specific or provide any opt-in language selection. Per the policy, forcing a specific language without user choice is a natural-language locale violation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This client exposes check_input() and check_output() but both use the same output-style text check, and there is no tool-execution control despite the skill metadata claiming separate input, output, and tool protection. In the context of a security/DLP skill, this mismatch is dangerous because integrators may deploy it assuming broader protections than are actually enforced, creating silent security gaps.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The check_input() API claims to validate inbound content, but it simply delegates to check(), which always calls self.dlp.check_output(text). In a DLP/security product that advertises entry and exit protection, routing input through output-only logic can leave prompt-injection, unsafe-ingest, or inbound secret-handling controls unapplied while callers wrongly believe input is protected.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown file is written exclusively in Chinese, including headings, instructions, and examples, with no indication that users may choose another language or that the skill is intended only for a Chinese-language audience. Under the language/locale policy, forcing a single language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · docs/RULE_EXPLORATION.md (reported line 111)May include surrounding context.

md
"""规则自动更新"""
    
    def __init__(self):
        self.remote_url = "https://api.example.com/rules"
    
    def check_update(self):
        """检查更新"""

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The module presents itself as a broad enterprise DLP system with 170 rules, but the default output configuration only enables four rules. In practice, users may rely on it for comprehensive outbound protection and unknowingly leak credentials, PII, or regulated data that exist in the ruleset but are never applied by default.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

Audit logging persists the full checked data structure to disk, including raw input, memory content, tool parameters, and potentially sensitive findings. A DLP system that stores the very secrets or personal data it inspects can create a secondary data-exposure channel through local files, backups, log readers, or compromised user accounts.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown file contains substantial user-facing natural language in Chinese across most entries, while the surrounding file structure and headings are in English. Under the policy rule for language/locale, this can be a violation because the skill documentation forces a specific language for key content without explicit user opt-in or justification.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The file claims '146 条规则 | 20+ 行业' and repeats '146 条...20+ 行业场景', while the provided skill manifest states 170 rules covering 25+ industries. This is an intent/documentation mismatch about the stated scope and capabilities of the skill.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

L024 states the project has '无外部依赖 (仅使用内置库)', but L025 instructs users to install dependencies from requirements.txt. These statements directly conflict in the documentation about whether external packages are required.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README advertises '五层防护' including '记忆' at L021, and the architecture diagram repeats 'Memory Guard' at L192-L193. However, throughout the documented usage and trigger surfaces, only check-output, check-input, and check-tool are exposed (L073-L105, L141-L145), with no corresponding memory-check API or command shown. This is a documentation-to-described-interface contradiction rather than mere incompleteness because the text explicitly claims a five-layer capability while presenting only three callable checks.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file describes the skill as supporting 166 rules at L021, 146 rules at L025, and the manifest header claims 170 rules at L006/L014. It also reports version v2.1.2 at L013 while the footer says v2.0.0 at L262. These contradictions undermine the stated intent and capabilities of the skill, because the documentation actively presents incompatible facts about what the skill contains.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest states the skill covers 170 rules, but the CLI status output hardcodes "Rules: 166". This is a direct contradiction between user-facing documentation/intent and the implemented reporting behavior, which can mislead operators about the skill's actual protection scope.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The module description and many built-in detection rules are explicitly centered on Chinese-language content and Chinese identifiers, but the file does not state that the skill is intended only for a China-specific deployment or offer any locale choice. This creates a natural-language locale-policy concern because the skill appears to privilege a specific language/region by default.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
99% confidence
Finding

The method belongs to OutputFilter and is invoked by check_output, yet its docstring says 过滤入口返回, which describes input-side filtering. This is an intent/documentation contradiction that could mislead integrators about where the protection is applied.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The pyproject description says the package is an 'Enterprise DLP system with 146 rules for 20+ industries', while the supplied manifest context claims 170 rules covering 25+ industries. This is an active contradiction in published metadata about the skill's intended scope, not merely omitted detail.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.