Back to skill

Security audit

Facebook Pages

Security checks for vulnerabilities and agentic risk

Overview

The skill is coherent for managing Facebook Pages, but it needs Review because it handles powerful publishing credentials and can send them to an unvalidated API host.

Install only if you trust the publisher and need authenticated Facebook Page management. Before use, verify any config.json and MBM_BASE_URL or --base-url setting, prefer the default MyBrandMetrics HTTPS host, use least-privileged or test credentials, and require explicit confirmation before publishing, hiding, editing, or deleting Page content.

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
scripts/facebook_pages.py:18
Finding

Credential Exfiltration Through Predictable Shared Configuration and Unrestricted API Endpoint Override

Content
View full analysis
Path: if explicit_path: return Path(explicit_path).expanduser() env_path = os.environ.get("FACEBOOK_PAGES_CONFIG") if env_path: return Path(env_path).expanduser() script_dir = Path(__file__).resolve().parent workspace_root = script_dir.parent.parent.parent return workspace_root / "config.json" ``` ```python base_url = ( getattr(args, "base_url", None) or os.environ.get("MBM_BASE_URL") or fb_config.get("base_url") or DEFAULT_BASE_URL ) ``` ```python class FacebookPagesClient: def __init__(self, settings: dict[str, Any]) -> None: self.base_url = settings["base_url"] self.page_id = settings.get("page_id") self.account_id = settings.get("account_id") self.connection_id = settings.get("connection_id") headers = {} if settings.get("access_token"): headers["Authorization"] = f"Bearer {settings['access_token']}" elif settings.get("api_key"): headers["X-API-KEY"] = settings["api_key"] self.headers = headers def _request(self, method: str, path: str, *, params=None, json_body=None) -> dict[str, Any]: response = requests.request( method, f"{self.base_url}{path}", headers=self.headers, params=params, json=json_body, timeout=300, ) ``` ### Technical Analysis The script calculates its default configuration path by traversing three directories above `scripts/`. Under the audited package layout, this resolves to the predictable shared path `/tmp/config.json`, rather than a c ...[truncated 2434 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

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 · references/configuration.md (reported line 77)May include surrounding context.

md
## Security rules

- Never commit real access tokens, API keys, Page IDs, account IDs, or
  connection IDs into the repository.
- Prefer environment variables or runtime arguments in shared environments.
- Do not echo secrets in logs or terminal output.

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 · scripts/facebook_pages.py (reported line 79)May include surrounding context.

python
if not access_token and not api_key:
        print(
            "Error: missing Facebook Pages credentials. Provide an access token or API key "
            "via arguments, environment variables, or config.json.",
            file=sys.stderr,
        )

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill advertises capabilities that likely require environment access, file reads, and outbound network access, but it does not declare any explicit tool scope such as permissions or allowed-tools. That mismatch weakens least-privilege controls and can let an agent invoke broader capabilities than a reviewer or runtime policy expects, which is especially risky for a skill that handles credentials and performs authenticated publishing actions to third-party services.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The examples explicitly demonstrate live external actions such as publishing posts, uploading media, creating comments, hiding comments, and deleting comments against Facebook Pages, but they provide no warning that these commands cause real side effects. In an agent skill context, copy-pasted examples are often treated as safe defaults, so omission of safety cues can lead to unintended content publication or moderation actions on real accounts connected through the preconfigured API integration.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.