Back to skill

Security audit

Agent Security Skill Scanner Gitee

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a security scanner, but its own code can produce misleading safe results and its installation/deployment guidance is under-scoped.

Install only with review. Do not rely on this as a final security gate until the whitelist bypass, fixed-benign LLM path, suppressed intent failures, fabricated batch results, and unsafe dependency declarations are fixed. Avoid enabling daemon or scheduled modes unless you explicitly scope what it may scan and where it may write reports.

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

T08 · Insecure Dependencies

Error
Location
requirements.txt:2
Finding

Interpreter declarations resolve unrelated and unpinned third-party packages

Content
View full analysis
=3.8 ``` `package.json:41-43`: ```json "dependencies": { "python": ">=3.8" } ``` `SKILL.md:54-57`: ```bash git clone https://github.com/agent-security/scanner.git cd scanner/release/v4.1 pip install -r requirements.txt ``` ### Technical Analysis Python interpreter requirements must not be expressed as package dependencies named `python`. Running `pip install -r requirements.txt` asks the Python package index to resolve a third-party distribution with that name rather than validating the installed interpreter. The npm declaration similarly asks npm to resolve a package named `python`. The declarations use an open lower bound and provide neither a lockfile nor integrity hashes. As a result, installation behavior depends on mutable third-party registry content that is not part of the audited project. This creates a supply-chain exposure and may also make installation unreliable. The Python version requirement should instead be represented through packaging metadata such as `requires-python`. The existing `engines.python` field may communicate compatibility to users, but it does not make the `python` package dependency safe. ### Attack Path 1. A user follows the installation instructions in `SKILL.md`. 2. The user runs `pip install -r requirements.txt`, or installs the npm package with its declared dependencies. 3. The package manager interprets `python` as the name of a registry-hosted package. 4. It resolves an unrelated, mutable package version satisfying the open constraint. 5. Package installation hooks or subsequently imported package code execute with the privileges of the installing user or build environment. Successful exploitation depends on the registr ...[truncated 649 chars]
Remediation
View remediation
=3.8` from `requirements.txt`. 2. Remove the npm dependency named `python`. 3. Declare interpreter compatibility using standard Python package metadata: ```toml [project] requires-python = ">=3.8" ``` 4. Retain an engine declaration only as compatibility metadata, not as an installable package dependency. 5. Pin actual third-party dependencies to reviewed versions. 6. Use lockfiles and integrity hashes, such as pip hash-checking mode, for reproducible releases. 7. Add CI checks that reject interpreter names in dependency lists and audit resolved dependency trees before publication. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
src/multi_language_scanner_v4.py:125
Finding

Attacker-controlled source markers unconditionally bypass malware detection

Content
View full analysis
tuple: if not self.use_whitelist: return (False, False) # Check whitelist first for pattern, label in self.whitelist_patterns: if pattern in code: return (True, False) # Then check blacklist for pattern, label in self.blacklist_patterns: if pattern in code: return (False, True) return (False, False) ``` `src/multi_language_scanner_v4.py:663-669`: ```python # Whitelist samples are directly classified as safe if is_whitelisted: risk_score = 5.0 is_malicious = False behaviors.append('whitelisted') elif is_blacklisted: risk_score = max(risk_score, 50) behaviors.append('blacklisted') ``` ### Technical Analysis The scanned source code is attacker-controlled input. The scanner treats the presence of any whitelist substring anywhere in that input as authoritative proof that the entire file is benign. The whitelist is evaluated before the blacklist, and its result later overwrites findings produced by language-specific analysis and smart scoring. A malicious file ...[truncated 1704 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
src/multi_language_scanner_v4.py:676
Finding

Intent-analysis layer silently fails because of incompatible call and return interfaces

Content
View full analysis
IntentAnalysis: ``` `src/intent_detector_v2.py:30-40`: ```python @dataclass class IntentAnalysis: intent: IntentType confidence: float reasons: List[str] risk_score: float matched_patterns: List[str] = field(default_factory=list) whitelisted: bool = False whitelist_reason: str = "" def to_dict(self) -> Dict: ``` ### Technical Analysis The main scanner calls: ```python self.intent_analyzer.analyze(code, str(path)) ``` The second positional argument of `analyze()` is `yara_matches`, not `file_path`. The path is consequently processed as an iterable of match names rather than being used as the filename. More importantly, `analyze()` returns an `IntentAnalysis` dataclass instance, while the caller assumes a dictionary and invokes `.get()`. `IntentAnalysis` does not prov ...[truncated 1410 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
src/llm_analyzer.py:20
Finding

Enabled LLM verification always produces a fixed benign classification

Content
View full analysis
Optional[Dict]: if not self.enabled: return None prompt = self._build_prompt(code, context) try: # Call LLM API # result = self._call_llm_api(prompt) # return self._parse_result(result) # Temporary return return { 'is_malicious': False, 'confidence': 0.8, 'reason': 'Code pattern is common, with no obvious malicious intent', 'suggestions': ['Manual review is recommended'] } except Exception as e: return None ``` `src/llm_analyzer.py:83-87`: ```python def _call_llm_api(self, prompt: str) -> str: """Call LLM API""" # Implement LLM API call # OpenAI/Claude/local models may be used pass ``` `src/multi_language_scanner_v4.py:718-729`: ```python if llm_result: if llm_result.get('is_malicious'): risk_score += llm_result.get('confidence', 0.5) * 30 behaviors.append(f'llm:malicious:{llm_result.get("confidence", 0):.2f}') else: risk_score *= 0.5 behaviors.append(f'llm:benign:{llm_result.get("confidence", 0):.2f}') if 'reason' in llm_result: behaviors.append(f'llm_reason:{llm_result["reason"][:50]}') ``` ### Technical Analysis When `ENABLE_LLM_ANALYSIS=true`, the analyzer builds a prompt but never sends it t ...[truncated 1931 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
Findings (85)

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

bash
# 删除不应发布的目录
rm -rf logs/ config/ metrics/
rm -rf samples/ data/ expert_mode/ scripts/
rm -rf round*/ reports/temp/

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

bash
# 删除不应发布的目录
rm -rf logs/ config/ metrics/
rm -rf samples/ data/ expert_mode/ scripts/
rm -rf round*/ reports/temp/

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

bash
# 删除不应发布的目录
rm -rf logs/ config/ metrics/
rm -rf samples/ data/ expert_mode/ scripts/
rm -rf round*/ reports/temp/

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

bash
# 删除不应发布的目录
rm -rf logs/ config/ metrics/
rm -rf samples/ data/ expert_mode/ scripts/
rm -rf round*/ reports/temp/

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

删除不应发布的目录

rm -rf logs/ config/ metrics/ rm -rf samples/ data/ expert_mode/ scripts/ rm -rf round*/ reports/temp/

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

删除不应发布的目录

rm -rf logs/ config/ metrics/ rm -rf samples/ data/ expert_mode/ scripts/ rm -rf round*/ reports/temp/

text

### 3. 验证阶段

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
94% confidence
Finding

The checklist explicitly instructs use of git push ... --force to master on external remotes, which can overwrite repository history and destroy prior content if followed by an automated agent or an operator without safeguards. In a release skill context, this is more dangerous because it normalizes a destructive publication step that could erase audit history, bypass review expectations, or replace a public repo with unintended contents.

Content

Scanner excerpt · PUBLISH_CHECKLIST.md (reported line 117)May include surrounding context.

  • 只保留必要的开源文件"

推送到对外仓库

git push origin master --force git push github master --force

text

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

md
rm -rf samples/ data/ expert_mode/ scripts/
rm -rf logs/ config/ metrics/
rm -rf round*/ reports/temp/
rm -rf __pycache__/ *.pyc
rm -rf .idea/ .vscode/

echo "✅ 清理完成"

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

md
rm -rf logs/ config/ metrics/
rm -rf round*/ reports/temp/
rm -rf __pycache__/ *.pyc
rm -rf .idea/ .vscode/

echo "✅ 清理完成"
git status

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Superficial extension matching or keyword heuristics do not justify claims of multilingual, AST-based, intent-aware, and LLM-validated analysis. For a security product, overstating detection depth materially increases risk because operators may substitute this tool for stronger review controls and fail to detect real malicious behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

Superficial extension matching or keyword heuristics do not justify claims of multilingual, AST-based, intent-aware, and LLM-validated analysis. For a security product, overstating detection depth materially increases risk because operators may substitute this tool for stronger review controls and fail to detect real malicious behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Superficial extension matching or keyword heuristics do not justify claims of multilingual, AST-based, intent-aware, and LLM-validated analysis. For a security product, overstating detection depth materially increases risk because operators may substitute this tool for stronger review controls and fail to detect real malicious behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

Superficial extension matching or keyword heuristics do not justify claims of multilingual, AST-based, intent-aware, and LLM-validated analysis. For a security product, overstating detection depth materially increases risk because operators may substitute this tool for stronger review controls and fail to detect real malicious behavior.

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

md
python3 src/multi_language_scanner_v4.py /path/to/sample.py

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

Scanner excerpt · docs/CAPABILITIES.md (reported line 113)May include surrounding context.

SENSITIVE_PATHS = [ '/etc/passwd', '/etc/shadow', '~/.ssh/id_rsa', '/proc/self/environ', ]

text

YARA rule 'agent_skill_mcp_tool_poisoning_metadata': MCP/tool metadata poisoning indicators in tool schemas or skill manifests [agent_skills]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · docs/CAPABILITIES.md (reported line 318)May include surrounding context.

~3% | 测试样本集 | | CPU 利用率 | ≤80% | ~60% | 多核并行 |


四、使用场景

4.1 技能市场审核 🔒

  • ✅ 新技能上架前安全扫描
  • ✅ 定期安全复审 (每季度)
  • ✅ 用户举报响应处理

4.2 企业 Agent 治理 🏢

  • ✅ 内部技能库安全审计
  • ✅ 供应链安全检查
  • ✅ 合规性验证 (等保/GDPR)

4.3 开发者自检 👨‍💻

  • ✅ 发布前安全自测
  • ✅ CI/CD 集成检查
  • ✅ 代码质量持续提升

五、集成方式

5.1 CLI 命令行

bash
# 单个技能扫描
python cli.py scan <skill_path>

# 批量扫描
python cli.py scan-all <skills_dir>

# JSON 格式输出
python cli.py scan <skill_path> --format json

# 详细模式
python cli.py scan <skill_path> --verbose

# 指定输出文件
python cli.py scan <skill_path> --output report.json

5.2 Python API

python
from cli import scan_skill

# 扫描技能
result = scan_skill("path/to/skill")

# 获取评分
score = resu

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code ignores the actual scanner output and unconditionally records every file as detected. In a security-scanner skill, this creates materially false results, undermines evaluation integrity, and can hide scanner failures or fabricate detection performance claims.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · src/benchmark_full_scan.py (reported line 39)May include surrounding context.

python
rules_content = merged_rules.read_text(errors='ignore')
        rules = yara.compile(source=rules_content)
        print(f"   ✅ 加载 merged_rules.yar ({len(rules_content):,} 字节)")
        return rules
    except Exception as e:
        print(f"❌ 规则编译失败:{e}")
        return None

Obfuscated Code

High
Category
Supply Chain
Confidence
85% confidence
Finding

Code contains obfuscation (base64, hex encoding with execution). This is often used to hide malicious functionality.

Content

Scanner excerpt · src/engine/smart_pattern_detector.py (reported line 22)May include surrounding context.

python
HIGH_RISK_PATTERNS = {
        # 命令执行
        "exec(": 15, "eval(": 15, "compile(": 8,
        "__import__('os').system": 15, "__import__('subprocess'": 12,
        "subprocess.Popen(": 12, "subprocess.run(": 6, "subprocess.call(": 6,
        "shell=True": 7, "os.system(": 8, "os.popen(": 8,

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 · src/engine/smart_pattern_detector.py (reported line 23)May include surrounding context.

python
# 命令执行
        "exec(": 15, "eval(": 15, "compile(": 8,
        "__import__('os').system": 15, "__import__('subprocess'": 12,
        "subprocess.Popen(": 12, "subprocess.run(": 6, "subprocess.call(": 6,
        "shell=True": 7, "os.system(": 8, "os.popen(": 8,
        
        # 权限提升

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 · src/engine/smart_pattern_detector.py (reported line 23)May include surrounding context.

python
# 命令执行
        "exec(": 15, "eval(": 15, "compile(": 8,
        "__import__('os').system": 15, "__import__('subprocess'": 12,
        "subprocess.Popen(": 12, "subprocess.run(": 6, "subprocess.call(": 6,
        "shell=True": 7, "os.system(": 8, "os.popen(": 8,
        
        # 权限提升

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 · src/engine/smart_pattern_detector.py (reported line 38)May include surrounding context.

python
"persistence": 8, "backdoor": 10,
        
        # 凭据窃取
        "mimikatz": 25, "keyring.get_password": 12, "win32security.CredRead": 15,
        "getpass.getpass": 10, "AWS_SECRET": 12, "get_password": 8,
        "/etc/shadow": 15, "Get-Credential": 10,

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 · src/intent_detector_v2.py (reported line 81)May include surrounding context.

python
"persistence": 8, "backdoor": 10,
        
        # 凭据窃取
        "mimikatz": 25, "keyring.get_password": 12, "win32security.CredRead": 15,
        "getpass.getpass": 10, "AWS_SECRET": 12, "get_password": 8,
        "/etc/shadow": 15, "Get-Credential": 10,

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 · src/multi_language_scanner_v4.py (reported line 369)May include surrounding context.

python
"persistence": 8, "backdoor": 10,
        
        # 凭据窃取
        "mimikatz": 25, "keyring.get_password": 12, "win32security.CredRead": 15,
        "getpass.getpass": 10, "AWS_SECRET": 12, "get_password": 8,
        "/etc/shadow": 15, "Get-Credential": 10,

YARA rule 'info_stealer': Information stealer patterns (credential harvesting, browser data theft) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · src/engine/smart_pattern_detector.py (reported line 38)May include surrounding context.

python
"setgid": 10,
        "privilege": 8, "escalat": 8,
        
        # 持久化
        "crontab": 10, "/etc/cron": 10, "systemctl enable": 10, "systemctl start": 8,
        "winreg.SetValue": 12, "winreg.CreateKey": 12, "launchd.plist": 10,
        "/etc/profile.d": 10, ".bashrc": 8, "Register-ScheduledTask": 12,
        "persistence": 8, "backdoor": 10,
        
        # 凭据窃取
        "mimikatz": 25, "keyring.get_password": 12, "win32security.CredRead": 15,
        "getpass.getpass": 10, "AWS_SECRET": 12, "get_password": 8,
        "/etc/shadow": 15, "Get-Credential": 10,
        
        # 网络外传
        "requests.post(": 10, "requests.get(": 5,
        "urllib.request.urlopen(": 7, "urllib.request.urlretrieve": 10,
        "socket.socket(": 8, "ftplib.FTP": 10, "smtplib.SMTP": 10,
        
        # 数据破坏 (增强)
        "shutil.rmtree(": 12, "os.remove(": 8, "os.unlink(": 8,
        "fernet.encrypt(": 10, "Remove-Item": 10,
        "data_destruction": 10, "r