T09 · Insecure Skill Coding Practices
- Location
ransomware_protection.py:66- Finding
File integrity verification accepts altered files without comparing hashes
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
ClawGuard is mostly a local proof tool, but it also includes under-scoped host security scanning and cleanup behavior that can inspect or delete local data beyond the proof workflow.
Review carefully before installing. Use only if you are comfortable with a proof tool that can also inspect local OS/network state, and avoid the clean command unless the working directory is disposable. Do not rely on the legal, ISO, malware-safety, or ransomware-integrity claims until the proof validation, scan logic, and user warnings are fixed.
ransomware_protection.py:66File integrity verification accepts altered files without comparing hashes
scan_files.py:103Files are classified as proven and safe solely by filename
init.py:338Proof verification accepts partial identifiers through substring matching
scan_network.py:166Suspicious network connection scan always returns a passing result
scan_os.py:75Windows update check assumes the system is secure without evaluating update state
scan_network.py:75Open-port scan unconditionally marks discovered listening ports as safe
scan_network.py:75Host security and network reconnaissance exceeds the core proof operation
init.py:363Cleanup command recursively deletes common directories outside a skill-owned root
Windows security scanning, PowerShell execution, firewall and antivirus inspection, network port enumeration, and process inspection are unrelated to the declared asset-proof use case. In this context, the mismatch strongly suggests covert reconnaissance capability, making the skill far more dangerous than the description implies.
Windows security scanning, PowerShell execution, firewall and antivirus inspection, network port enumeration, and process inspection are unrelated to the declared asset-proof use case. In this context, the mismatch strongly suggests covert reconnaissance capability, making the skill far more dangerous than the description implies.
Windows security scanning, PowerShell execution, firewall and antivirus inspection, network port enumeration, and process inspection are unrelated to the declared asset-proof use case. In this context, the mismatch strongly suggests covert reconnaissance capability, making the skill far more dangerous than the description implies.
Windows security scanning, PowerShell execution, firewall and antivirus inspection, network port enumeration, and process inspection are unrelated to the declared asset-proof use case. In this context, the mismatch strongly suggests covert reconnaissance capability, making the skill far more dangerous than the description implies.
Windows security scanning, PowerShell execution, firewall and antivirus inspection, network port enumeration, and process inspection are unrelated to the declared asset-proof use case. In this context, the mismatch strongly suggests covert reconnaissance capability, making the skill far more dangerous than the description implies.
The clean_all function recursively deletes directories such as pycache, logs, cache, tmp, and temp using shutil.rmtree. Although the command returns the removed names afterward, there is no prior confirmation, prompt, or warning before performing this irreversible filesystem action.
The manifest frames the skill as an offline-first digital asset proof system with local blockchain and format support, which suggests evidence/provenance functionality. In contrast, the code exposes commands for file security scanning, operating system security checks, network scanning, and a combined scan mode, which is a substantially different product behavior.
The CLI explicitly offers operating system and network security scans, and all invokes both in addition to file scanning. Those capabilities are not an obvious or necessary implementation detail of a digital asset proof system, especially one described as offline-first and focused on proofing assets.
This file performs broad host network reconnaissance even though the skill metadata describes a digital-asset proof/blockchain function, not local security auditing. That mismatch is dangerous because users or calling systems may grant trust or permissions based on the declared purpose while the code collects unrelated sensitive host information.
The skill launches shell/PowerShell commands to enumerate host network state without clear justification from the manifest. In an agent environment, this can expose local system details such as listening services and network posture, creating privacy and reconnaissance risk beyond the skill's stated purpose.
Using subprocess.run with shell=True grants the shell authority to interpret the command, which is an unsafe execution pattern in agent tools even when the current string is constant. In hostile or misconfigured environments, shell resolution, PATH hijacking, or future code changes that add variable input can turn this into command-execution abuse.
common_ports = [80, 443, 8080, 3306, 5432]
try:
cmd = 'powershell -Command "Get-NetTCPConnection -State Listen | Select-Object LocalPort"'
result = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=10)
open_ports = []
for line in result.stdout.split('\n'):
This tool call uses shell=True for a host-enumeration command, which is an unsafe primitive for an agent skill. Even without immediate injection, the pattern enables shell-mediated execution behavior that can be abused via environment manipulation or later modifications.
"""检查网络连接"""
try:
cmd = 'powershell -Command "Get-NetTCPConnection | Measure-Object | Select-Object -ExpandProperty Count"'
result = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=10)
count = int(result.stdout.strip()) if result.stdout.strip().isdigit() else 0
The DNS inspection command is executed through shell=True, exposing unnecessary shell semantics for a task that does not require them. In agent contexts this is dangerous because it normalizes risky command execution and increases the chance of abuse through environmental control or future parameterization.
trusted_dns = ['114.114.114.114', '8.8.8.8', '1.1.1.1', '223.5.5.5']
try:
cmd = 'powershell -Command "Get-DnsClientServerAddress | Select-Object -ExpandProperty ServerAddresses"'
result = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=10)
dns_servers = result.stdout.strip().split('\n')
is_trusted = any(dns in str(dns_servers) for dns in trusted_dns)
Running the suspicious-connection check through shell=True uses a high-risk tool parameter for local host enumeration. Combined with the misleading success result, this creates both execution-surface risk and deceptive security signaling.
"""检查可疑连接"""
try:
cmd = 'powershell -Command "Get-NetTCPConnection | Select-Object RemoteAddress,State"'
result = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=10)
# 简单检查:未发现明显异常
return {
This Wi-Fi inspection relies on shell=True, which is an unnecessarily permissive execution mode for collecting host network details. In an agent skill, such patterns are risky because they can be repurposed or become exploitable when the environment or command source changes.
"""检查 WiFi 安全"""
try:
cmd = 'powershell -Command "(netsh wlan show interfaces) -match \'Authentication\'"'
result = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=10)
if "WPA3" in result.stdout:
return {
The file performs host operating-system security scanning even though the declared skill purpose is a digital asset proof system. This capability mismatch is dangerous because it expands access to sensitive host-state information without a clear, user-justified need, making the skill more suspicious in context.
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).
try:
# PowerShell 检查最后更新时间
cmd = 'powershell -Command "Get-WindowsUpdateLog -ErrorAction SilentlyContinue; (Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate\\Auto Update).LastSuccessSyncTime"'
result = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=30)
# 简化检查:假设系统已更新
return {
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).
try:
# PowerShell 检查最后更新时间
cmd = 'powershell -Command "Get-WindowsUpdateLog -ErrorAction SilentlyContinue; (Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate\\Auto Update).LastSuccessSyncTime"'
result = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=30)
# 简化检查:假设系统已更新
return {
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).
try:
# PowerShell 检查最后更新时间
cmd = 'powershell -Command "Get-WindowsUpdateLog -ErrorAction SilentlyContinue; (Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate\\Auto Update).LastSuccessSyncTime"'
result = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=30)
# 简化检查:假设系统已更新
return {
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).
try:
# PowerShell 检查最后更新时间
cmd = 'powershell -Command "Get-WindowsUpdateLog -ErrorAction SilentlyContinue; (Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate\\Auto Update).LastSuccessSyncTime"'
result = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=30)
# 简化检查:假设系统已更新
return {
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).
try:
# PowerShell 检查最后更新时间
cmd = 'powershell -Command "Get-WindowsUpdateLog -ErrorAction SilentlyContinue; (Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate\\Auto Update).LastSuccessSyncTime"'
result = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=30)
# 简化检查:假设系统已更新
return {
Enumerating listening ports and local processes gives the skill visibility into host security posture and running tools, which is unrelated to a digital asset proof workflow. In this context, such reconnaissance-like behavior is more dangerous because it could be repurposed to fingerprint defenses or discover security tooling on the machine.
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).
message": "未发现开放的高危端口",
"recommendation": ""
}
except:
return {
"name": "高危端口",
"status": "warning",
"message": "无法检查端口状态",
"recommendation": "手动检查网络设置"
}
def check_suspicious_processes():
"""检查异常进程"""
suspicious_names = ['mimikatz', 'pwdump', 'procdump']
try:
cmd = 'powershell -Command "Get-Process | Select-Object ProcessName"'
result = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=10)
found = []
for name in suspicious_names:
if name.lower() in result.stdout.lower():
found.append(name)
if found:
return {
"name": "异常进程",
"status": "critical",
"message": f"发现可疑进程:{', '.join(found)}",
"recommendation": "
This markdown file advertises clean, backup, and restore management commands, including cache cleaning and configuration restore, but provides no warning about potential data loss, overwriting, or the need to verify targets before use. For markdown files, safety-relevant behaviors that can affect user data or system integrity should be accompanied by user-facing warnings.
The document makes affirmative legal-compliance claims tied to PRC Copyright Law and recommends direct evidentiary use without clearly limiting the claim to a jurisdiction-specific context or adding a legal disclaimer. In a security/legal-proof skill, users may rely on these statements as authoritative and use the system in unsuitable jurisdictions or overestimate evidentiary weight, creating compliance, fraud, or legal-risk exposure.