Back to skill

Security audit

Fang: protect your env variables from being stealed.

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent security scanner, but its optional LLM mode can upload broad source-code contents and a bearer API key to a configurable remote endpoint without strong safeguards.

Install only if you intend to use the local static scan by default. Do not enable LLM mode on proprietary or sensitive directories unless you are comfortable sending source excerpts and paths to the configured provider. Avoid custom --base-url values unless you fully trust the endpoint and are willing to disclose the bearer key to it; inspect targets for symlinks before remote analysis.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/fang_audit.py:43
Finding

Unrestricted remote disclosure of scanned source code and API credentials

Content
View full analysis
str: try: import urllib.request import urllib.error except ImportError: return "[ERROR] urllib not available" # Build file content block (trim to 3000 chars per file to stay within limits) content_blocks = [] for item in files: snippet = item["content"][:3000] content_blocks.append(f"### File: {item['path']}\n```\n{snippet}\n```") combined = "\n\n".join(content_blocks) prompt = f"""You are a security analyst. Analyze the following script files from an AI agent skill directory. Your job: detect any HIGH-RISK behavior that could STEAL or LEAK environment variables. Focus on: 1. Code that reads env vars (os.environ, process.env, os.getenv, $ENV, etc.) 2. Code that sends data externally (HTTP requests, WebSockets, DNS lookups, etc.) 3. Combined risk: reading env vars AND sending them out (this is the most critical) 4. Obfuscation tricks: base64 encoding, hex encoding, compressed payloads 5. Suspicious subprocess / eval / exec usage 6. Hardcoded URLs or IPs that look like data exfiltration endpoints For each suspicious file, output: - File path - Risk level: HIGH / MEDIUM / LOW - Reason: one clear sentence - Code snippet: the exact suspicious lines (max 5 lines) If a file is clean, skip it entirely. At the ...[truncated 3493 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/fang_audit.py:43
Finding

Symlink traversal can disclose files outside the selected audit directory

Content
View full analysis
str: try: return Path(path).read_text(encoding="utf-8", errors="ignore") except Exception: return "" ``` ### Technical Analysis The recursive collector accepts filesystem entries based on their apparent suffix and reads them without rejecting symbolic links. It does not resolve each candidate to its canonical path or verify that the resolved path remains beneath the canonical target directory. `Path.read_text()` follows a symbolic link to its target. Consequently, a supported-extension symlink located inside an untrusted Skill can point to a readable file outside the requested audit tree. The external file is then treated as if it belonged to the target and, when LLM analysis is enabled, up to its first 3,000 characters are included in the remote request. The scanner only needs access to regular files physically contained within the selected audit scope. Following links outside that scope exceeds the minimum filesystem privileges necessary for the declared functionality. ### Attack Path 1. An attacker packages an untrusted Skill containing a symbolic link with a supported extension, such as `leak.py`. 2. The link points to a predictable sensitive file outside the Skill directory that is readable by the user running the auditor. 3. The user extracts or installs the Skill in a manner that preserves the symbolic link. 4. The user invokes `fang_audit.py` against ...[truncated 987 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documented behavior claims a two-phase audit with optional LLM analysis, broad script coverage, and structured reporting, but the implementation reportedly provides only a narrower regex scan with reduced file coverage and plain output. This mismatch is dangerous because users may rely on the tool for security assurance it does not actually provide, causing malicious skills to be incorrectly treated as vetted or clean.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill advertises capabilities that include environment access, file operations, network use, and shell execution, but it does not declare any explicit tool scope or permission boundaries. In a security-auditing skill, this is risky because the same broad powers used to inspect files and call an LLM endpoint could also be abused to access secrets or transmit scanned contents without clear user-visible constraints.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation states that all discovered scripts may be sent to an OpenAI-compatible LLM for analysis, but it does not clearly disclose that source code leaves the local environment and may be transferred to a third-party service. This can expose proprietary code, embedded credentials, internal paths, or other sensitive content during a security audit workflow where users may expect analysis to remain local.

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

python scripts/fang_audit.py <target_dir>
--llm-key any
--model deepseek-chat
--base-url https://api.deepseek.com/v1

text

### Save report to file

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The workflow indicates Phase 2 may run automatically when an LLM key is available, which creates a risk of silent external transmission of scanned script contents without fresh user consent. Automatic upload is especially dangerous in a security scanner because the target files may themselves contain secrets, customer code, or incident-response artifacts that should not be sent off-host by default.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · scripts/fang_audit.py (reported line 53)May include surrounding context.

python
return risky

# ── LLM Analysis via OpenAI-compatible API ────────────────────────────────────
def llm_analyze(files: list, api_key: str, model: str = "gpt-4o-mini", base_url: str = "https://api.openai.com/v1") -> str:
    try:
        import urllib.request
        import urllib.error

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · scripts/fang_audit.py (reported line 161)May include surrounding context.

python
return risky

# ── LLM Analysis via OpenAI-compatible API ────────────────────────────────────
def llm_analyze(files: list, api_key: str, model: str = "gpt-4o-mini", base_url: str = "https://api.openai.com/v1") -> str:
    try:
        import urllib.request
        import urllib.error

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The optional deep-analysis feature uploads collected script contents to an external API, which can disclose proprietary code, embedded secrets, or sensitive local data from the audited directory. While this appears to be an intended product feature rather than theft, it materially expands the data exposure surface beyond a purely local scanner.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Allowing an arbitrary --base-url means a user can be induced to send audited file contents and the API key to any attacker-controlled endpoint under the guise of 'compatible' LLM analysis. This is especially risky because the uploaded material is entire script content blocks, and the Authorization bearer token is also transmitted to that endpoint.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The tool proceeds with LLM analysis after showing model/base URL information, but it does not present a direct, prominent warning that local file contents are about to be transmitted externally. Users may reasonably interpret 'deep analysis' as an internal feature and unknowingly exfiltrate sensitive code or secrets.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This code includes natural-language comments in Chinese and presents a mixed-language CLI description without any indication that language is configurable or intentionally region-specific. The audit rule requires flagging language or locale constraints when a skill effectively enforces a specific language without user opt-in or documented justification.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.