Back to skill

Security audit

Facebook评论分析

Security checks for vulnerabilities and agentic risk

Overview

The report workflow needs review because crafted comments can escape its documented shell command, and some report data is inserted into HTML unsafely.

Wait for report generation to pass comment data without shell interpolation and to escape or sanitize HTML fields before normal use. Redfox receives the complete submitted post URL; avoid links containing private tokens. Comment data is saved locally even before you approve opening a finished report.

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

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md
Finding

External comment text can escape the report command's shell quoting

Content
View full analysis

Impact

An attacker-controlled comment can execute commands with the agent process's permissions. Execution occurs before Python parses the JSON, so json.loads cannot prevent it.

Vulnerability Patterns
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (10)

Tainted flow: 'file_path' from sys.stdin.read (line 278, user input) → subprocess.run (code execution)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

External input (network, user) flows to a code execution sink. This enables remote code execution or command injection.

Content

Scanner excerpt · scripts/consolidate_report.py (reported line 228)May include surrounding context.

python
if sys.platform == "win32":
            os.startfile(file_path)
        else:
            subprocess.run(["open", file_path])
    except Exception:
        pass

Tainted flow: 'req' from os.environ.get (line 43, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/facebook_comment_search.py (reported line 55)May include surrounding context.

python
)

    try:
        with urllib.request.urlopen(req, timeout=30) as resp:
            result = json.loads(resp.read().decode("utf-8"))
    except urllib.error.HTTPError as e:
        body = e.read().decode("utf-8", errors="replace")

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Comment retrieval, cursor-based pagination, and HTML report generation match the description. However, the script only formats and displays comments; it contains no sentiment classifier, analysis-service call, category assignment, or analytical results. This materially omits the advertised comment-analysis capability. The Redfox API request, API-key access, and local report writing are supporting implementation details consistent with the declared workflow, not separate mismatches. The referenced HTML template was not supplied, so any behavior inside it cannot be assessed.

Content

No source excerpt is available for this finding.

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, file_write, network, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

The workflow submits the complete Facebook post URL to an external API without disclosing that data transfer to the user.

Medium
Category
Output Handling
Confidence
88% confidence
Finding

The workflow requires forwarding the complete user-supplied URL unchanged through a third-party-backed retrieval service, without explicitly explaining that disclosure. Although the Redfox API-key setup signals an external dependency, it does not explain that full URLs may expose sensitive query parameters or nonpublic post identifiers; the supplied scripts are unavailable to verify endpoint or retention details.

Content

No source excerpt is available for this finding.

Tainted flow: 'file_path' from sys.stdin.read (line 213, user input) → open (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/consolidate_report.py (reported line 215)May include surrounding context.

python
filename = f"Facebook评论分析_{key}_全部{total_pages}页.html"
    file_path = os.path.join(out_dir, filename)

    with open(file_path, "w", encoding="utf-8") as f:
        f.write(html)

    print(f"[consolidate] 合并报告已生成: {file_path}", file=sys.stderr)

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/consolidate_report.py (reported line 228)May include surrounding context.

python
if sys.platform == "win32":
            os.startfile(file_path)
        else:
            subprocess.run(["open", file_path])
    except Exception:
        pass

Comment timestamps are forced to Beijing time (UTC+8) without user opt-in or a region-specific justification.

Low
Category
Output Handling
Confidence
92% confidence
Finding

The skill specifies a fixed regional timezone for all comment publish times without offering users a timezone choice. Although the conversion is documented, no region-specific purpose is given to justify imposing this locale setting.

Content

No source excerpt is available for this finding.

Comment timestamps are forced to Beijing time (UTC+8) without user choice or a justified regional requirement.

Low
Category
Output Handling
Confidence
96% confidence
Finding

The README requires all comment timestamps to be displayed in Beijing time. This imposes a locale-specific presentation setting without offering user opt-in or explaining why this timezone is necessary for Facebook comment analysis.

Content

No source excerpt is available for this finding.

Comment timestamps are required to use Beijing time without user choice or a documented regional justification.

Low
Category
Output Handling
Confidence
96% confidence
Finding

The rendering instructions mandate Beijing time for comment timestamps. This imposes a specific locale convention even though the skill serves analysis of a global platform and provides neither a timezone choice nor a regional justification.

Content

No source excerpt is available for this finding.