Back to skill

Security audit

Facebook Manager

Security checks for vulnerabilities and agentic risk

Overview

This Facebook management skill is not plainly malicious, but it relies on powerful long-lived Facebook tokens and documents posting, messaging, reading, deletion, and token-refresh workflows with weak safety controls.

Review this skill before installing. Use only the minimum Facebook scopes needed, avoid storing page or user tokens in plaintext config when possible, do not paste tokens into chats or logs, and require manual confirmation before any post, deletion, reply, or Messenger send. The cron refresh example should not be used as written on shared or sensitive systems.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • 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
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
references/setup-guide.md:68
Finding

OAuth credentials exposed through URL query parameters

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/check-connection.sh:13
Finding

Facebook access-token prefixes disclosed in script output

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
references/setup-guide.md:37
Finding

Default setup recommends permissions broader than individual workflows require

Content
View full analysis
Remediation
View remediation

T06 · System Persistence

Warning
Location
references/setup-guide.md:108
Finding

Persistent token-refresh job uses an unsafe predictable temporary file

Content
View full analysis
/dev/null; then jq --arg t "$NEW_TOKEN" \ '.skills.entries["facebook-manager"].env.FACEBOOK_USER_TOKEN = $t' \ ~/.openclaw/openclaw.json > /tmp/oc.json && mv /tmp/oc.json ~/.openclaw/openclaw.json echo "Đã cập nhật openclaw.json" fi ``` ```text Cronjob: `0 0 */50 * * /path/to/refresh-fb-token.sh` ``` ### Technical Analysis The guide recommends recurring cross-session execution through cron and writes a secret-bearing configuration through the predictable path `/tmp/oc.json`. It does not use `mktemp`, establish a restrictive `umask`, validate ownership, preserve destination permissions, or protect the scheduled script path. On a shared host, predictable temporary paths are susceptible to pre-creation, symlink manipulation, and race conditions. The exact exploitability depends on operating-system protections, file permissions, and the account running the job. Even where symlink protections prevent exploitation, the design can cause configuration corruption or accidental exposure. The cron recommendation also creates persistent execution. Persistence is legitimate for token refresh only when explicitly desired, but it increases risk if the script or its parent directories are writable by another account. If configured under a privileged account, any script-path compromise would execute with that account's privileges. The shown cr ...[truncated 1368 chars]
Remediation
View remediation
"$TMP" chmod 600 "$TMP" mv -f "$TMP" "$CONFIG" trap - EXIT ``` ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (25)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents a broad Facebook management skill with many operational capabilities for both pages and personal accounts. The supplied code, however, is only a diagnostic script that verifies whether page/user tokens work and whether group permission may be present. It performs simple read-only API checks against /{page_id}, /me, and /me/groups and prints status messages. This is materially narrower than the declared purpose and reflects a different primary purpose: connection testing rather than comprehensive Facebook management.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
88% confidence
Finding

The skill explicitly advertises access-token acquisition and token-driven operation, which is credential-sensitive functionality. In a skill context, encouraging token handling without strong safety guidance increases the chance of credential theft, oversharing, insecure storage, or misuse of long-lived Facebook access tokens.

Content

Scanner excerpt · SKILL.md (reported line 9)May include surrounding context.

md
Messenger, xem insights. User Token: tìm nhóm, đọc bài trong nhóm, tìm trang khác,
  tìm kiếm bài viết công khai. Hướng dẫn lấy token từ A đến Z.
  Sử dụng khi người dùng nhắc đến: Facebook, Fanpage, Messenger, nhóm Facebook,
  group, đăng bài, auto reply, tìm bài, search Facebook, Page ID, access token,
  Graph API, quản lý fanpage, social media.
version: 2.0.0
metadata:

Credential Access

High
Category
Privilege Escalation
Confidence
87% confidence
Finding

Documenting Page Access Tokens as effectively permanent and central to operations highlights use of powerful long-lived credentials. If mishandled, these tokens can enable unauthorized posting, messaging, comment actions, and insight access on behalf of a page.

Content

Scanner excerpt · SKILL.md (reported line 45)May include surrounding context.

md
| Nhu cầu | Chế độ | Token |
|---------|:------:|-------|
| Quản lý Fanpage (đăng bài, reply, Messenger, insights) | **Page** | Page Access Token (vĩnh viễn) |
| Tìm nhóm, đọc bài nhóm, tìm trang khác, search bài viết | **User** | User Access Token (~60 ngày) |
| Cả hai | **Cả hai** | Cấu hình 2 token riêng |

Credential Access

High
Category
Privilege Escalation
Confidence
84% confidence
Finding

The skill also relies on user access tokens for reading groups, pages, and public-post search, which are sensitive delegated credentials tied to personal accounts. Misuse or leakage can expose personal and group-derived data and permit actions within the granted scope.

Content

Scanner excerpt · SKILL.md (reported line 46)May include surrounding context.

md
| Nhu cầu | Chế độ | Token |
|---------|:------:|-------|
| Quản lý Fanpage (đăng bài, reply, Messenger, insights) | **Page** | Page Access Token (vĩnh viễn) |
| Tìm nhóm, đọc bài nhóm, tìm trang khác, search bài viết | **User** | User Access Token (~60 ngày) |
| Cả hai | **Cả hai** | Cấu hình 2 token riêng |

**→ Đọc `references/setup-guide.md` để lấy token từng bước.**

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/setup-guide.md (reported line 1)May include surrounding context.

md
# Hướng dẫn lấy Facebook Access Token

Hướng dẫn chi tiết lấy **cả 2 loại token**: Page Token (vĩnh viễn) và User Token (60 ngày).

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/setup-guide.md (reported line 38)May include surrounding context.

md
# Hướng dẫn lấy Facebook Access Token

Hướng dẫn chi tiết lấy **cả 2 loại token**: Page Token (vĩnh viễn) và User Token (60 ngày).

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/setup-guide.md (reported line 58)May include surrounding context.

md
# Hướng dẫn lấy Facebook Access Token

Hướng dẫn chi tiết lấy **cả 2 loại token**: Page Token (vĩnh viễn) và User Token (60 ngày).

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/setup-guide.md (reported line 44)May include surrounding context.

md
- `user_posts`
   - `groups_access_member_info`
   - `pages_show_list`
4. Click **Generate Access Token** → đồng ý cấp quyền
5. Copy token từ ô Access Token

**Token này là Short-lived (~1-2 giờ).** Đổi sang Long-lived ở Bước 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/setup-guide.md (reported line 45)May include surrounding context.

md
- `user_posts`
   - `groups_access_member_info`
   - `pages_show_list`
4. Click **Generate Access Token** → đồng ý cấp quyền
5. Copy token từ ô Access Token

**Token này là Short-lived (~1-2 giờ).** Đổi sang Long-lived ở Bước 4.

Credential Access

High
Category
Privilege Escalation
Confidence
78% confidence
Finding

This line explicitly instructs users to place a long-lived user token into the Access Token field in order to obtain a permanent page token, normalizing use of effectively non-expiring credentials. In the context of the broader guide, promoting permanent tokens without strong compensating controls increases the blast radius of any token leak and makes abuse persist until manual revocation.

Content

Scanner excerpt · references/setup-guide.md (reported line 80)May include surrounding context.

md
### 4B: Long-lived User Token → Permanent Page Token

1. Đặt Long-lived User Token vào ô Access Token
2. Query: `me/accounts` → Submit
3. Token trả về cho mỗi page là **VĨNH VIỄN**

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · references/setup-guide.md (reported line 118)May include surrounding context.

bash
#!/bin/bash
# refresh-fb-token.sh
NEW_TOKEN=$(curl -s "https://graph.facebook.com/v22.0/oauth/access_token?\
grant_type=fb_exchange_token&\
client_id=$APP_ID&\
client_secret=$APP_SECRET&\

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/setup-guide.md (reported line 144)May include surrounding context.

md
| Lỗi | Giải pháp |
|-----|-----------|
| `(#200) Requires ... permission` | Thêm quyền → Generate Token lại |
| `Invalid OAuth access token` | Token hết hạn → lấy mới (Bước 3→4) |
| `(#11) Search is not supported` | Dùng cách: tìm nhóm → đọc bài nhóm |
| `App Not Live` | App Dashboard → App Review → chuyển Live |
| Rate limit | Giảm tần suất, batch requests, cache |

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill documents shell-based actions using curl against external APIs but does not declare an explicit tool scope such as allowed-tools or permissions. In an agent environment, this can cause the skill to be invoked with broader shell/network capability than users expect, increasing the chance of unintended outbound actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill describes access to group content, personal account data, and page data without a prominent privacy warning or consent boundary. In context, this is sensitive social-media data, and unclear disclosure can cause users to expose or process third-party content without understanding the privacy implications.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases are extremely broad and cover many ordinary Facebook-related conversations, making accidental activation more likely. Because the skill includes credentialed external actions and data access, overbroad routing increases the risk of invoking sensitive functionality without clear user intent.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest requires FACEBOOK_ACCESS_TOKEN while the documented usage relies on FACEBOOK_PAGE_TOKEN and FACEBOOK_USER_TOKEN. This inconsistency can lead operators to place credentials in the wrong variable, break security assumptions, or encourage overbroad reuse of a single token for multiple purposes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation includes examples for posting, replying, and sending Messenger messages without an explicit warning that these actions are externally visible and may be irreversible. In an agent setting, that omission materially raises the risk of unintended public posts or outbound messages under a valid token.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
96% confidence
Finding

The skill contains direct examples for transmitting content and authorization-bearing requests to Facebook's external API. External transmission is expected for this domain, but it is still security-relevant because it can send user-provided content and act under privileged tokens against a third-party service.

Content

Scanner excerpt · SKILL.md (reported line 98)May include surrounding context.

bash
# Đăng bài text
curl -X POST "https://graph.facebook.com/v22.0/$FACEBOOK_PAGE_ID/feed" \
  -H "Authorization: Bearer $FACEBOOK_PAGE_TOKEN" \
  -d "message=Nội dung bài đăng"

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The reference documents a destructive DELETE /{POST_ID} capability that is broader than the manifest’s stated posting, replying, auto-reply, insights, and search/read functions. This creates a scope mismatch that can enable an agent or user to remove content unexpectedly, increasing the risk of unauthorized or accidental destructive actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The destructive post-deletion endpoint is presented as a normal operation with no caution, approval flow, or rollback guidance. In an agent skill context, that omission increases the chance of accidental, coerced, or unauthorized deletion of page content, especially when agents may act on natural-language instructions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This section documents access to conversations, messages, group feeds, and personal account data without any privacy, consent, or user-impact warnings. Because the skill is designed for broad Facebook management using page and user tokens, the lack of safeguards makes misuse more dangerous by normalizing surveillance, bulk data access, and outbound messaging operations that can affect third parties.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file includes personal account endpoints such as /me?fields=id,name,email and /me/posts, which expose user profile and personal posting data beyond the manifest’s described fanpage management and search/group features. That undocumented access expands the skill’s effective privilege and can lead to collection or misuse of personal data without clear user expectation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The guide explicitly instructs users to place long-lived user tokens and permanent page tokens into a local JSON configuration file, but does not pair that with guidance on file permissions, secret management, redaction, backups, or source-control exclusion. These tokens grant durable access to Facebook assets, so exposure through logs, repo commits, shared home directories, or support bundles could enable account/page takeover actions such as posting, reading messages, or harvesting data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The refresh script handles sensitive credentials in a shell context and writes a fresh token back into a local config file without warning about credential exposure through process listings, shell history, temporary files, terminal output, or unsafe file replacement. While the script talks only to Facebook, the operational pattern increases the chance of accidental secret leakage or config corruption on multi-user or poorly secured systems.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The skill description and examples are entirely in Vietnamese, and the metadata includes a 'vietnamese' tag, but there is no indication that the locale is optional or that the skill is intentionally restricted to Vietnamese-speaking users for a stated reason. This may conflict with language/locale policy expectations requiring opt-in or explicit justification.

Content

No source excerpt is available for this finding.