Back to skill

Security audit

Facebook

Security checks for vulnerabilities and agentic risk

Overview

This Facebook Graph API skill is a coherent documentation-only guide, but it gives agents live Page posting, deletion, moderation, and token-handling guidance without enough guardrails around irreversible or public actions.

Install only if you are comfortable with an agent helping operate live Facebook Pages. Require the agent to use Authorization headers, never URL token parameters, and insist on explicit confirmation before publishing, editing, hiding, or deleting posts or comments.

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

Warning
Location
references/graph-api-overview.md:12
Finding

Bearer Access Tokens Permitted in URL Query Parameters

Content
View full analysis

Vulnerability Details

File Location: references/graph-api-overview.md, line 12
Vulnerability Type: Exposure of bearer credentials through URL query strings
Risk Level: Medium

Vulnerable Snippet:

markdown
- Access token in query (`access_token`) or `Authorization: Bearer` header.

Technical Analysis

The guidance permits Facebook Graph API access tokens to be supplied through the access_token URL query parameter. URLs are commonly recorded in browser history, HTTP client diagnostics, reverse-proxy and gateway access logs, application monitoring platforms, and server logs. Consequently, placing a bearer credential in a URL unnecessarily expands the number of systems and personnel that may gain access to it.

A Facebook access token is a bearer credential: possession may be sufficient to exercise its authorized Graph API permissions. Although the document also identifies the safer Authorization: Bearer header mechanism, it does not require that mechanism or warn against query-string credentials.

Attack Path

  1. A user or agent follows the documented query-parameter option and sends a request containing ?access_token=<token>.
  2. An intermediary, HTTP client, gateway, diagnostic system, or access-logging service records the full request URL.
  3. An unauthorized party with access to those records extracts the token.
  4. The party submits Graph API requests using the exposed bearer token.
  5. Facebook Page operations succeed to the extent allowed by the token's type, scopes, Page association, validity, and platform controls.

Impact Assessment

A leaked token may expose Page data or enable Page operations according to its effective permissions. Based on the documented workflows, potential actions include reading Page content, publishing or editing posts, deleting posts, adding comments, and hiding or deleting comments. The exact scope is constrained by the token's granted permissions, associated Pages, expiration, an ...[truncated 34 chars]

Remediation
View remediation

Remediation Suggestions

  • Require access tokens to be transmitted exclusively through the Authorization: Bearer <token> header.
  • Remove the recommendation to place access_token in query strings and explicitly state that credentials must never appear in URLs.
  • Configure HTTP clients, gateways, proxies, and application logging to redact authorization headers and sensitive parameters.
  • Avoid logging complete requests or token-bearing error objects.
  • Store tokens in an approved secret manager, grant only the permissions required for the workflow, and rotate or revoke any token suspected of exposure.
  • Add a safe request example such as:
http
GET /vXX.X/{page-id}/posts HTTP/1.1
Host: graph.facebook.com
Authorization: Bearer <page-access-token>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (13)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% 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 · references/comments-moderation.md (reported line 19)May include surrounding context.

md
## 4) Hide or delete a comment
- Hide: `POST /{comment-id}` with `is_hidden=true`
- Delete: `DELETE /{comment-id}`

## 5) Moderation workflow
- Validate comment text.

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/graph-api-overview.md (reported line 12)May include surrounding context.

md
- HTTP GET for reads.
- HTTP POST for creates/updates.
- HTTP DELETE for deletes (where supported).
- Access token in query (`access_token`) or `Authorization: Bearer` header.

## 3) Page publishing flow (high level)
- Obtain user access token with required scopes.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% 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 · references/page-posting.md (reported line 33)May include surrounding context.

md
## 5) Update or delete
- Update post: `POST /{post-id}` (fields you want to change)
- Delete post: `DELETE /{post-id}`

## Notes
- Page access token required for publish actions.

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

md
# Permissions and Tokens

## 1) Token types
- User access token (granted via OAuth).
- Page access token (used for Page content actions).

## 2) Common Page permissions

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/graph-api-overview.md (reported line 15)May include surrounding context.

md
# Permissions and Tokens

## 1) Token types
- User access token (granted via OAuth).
- Page access token (used for Page content actions).

## 2) Common Page permissions

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/permissions-and-tokens.md (reported line 4)May include surrounding context.

md
# Permissions and Tokens

## 1) Token types
- User access token (granted via OAuth).
- Page access token (used for Page content actions).

## 2) Common Page permissions

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/graph-api-overview.md (reported line 17)May include surrounding context.

md
## 1) Token types
- User access token (granted via OAuth).
- Page access token (used for Page content actions).

## 2) Common Page permissions
- `pages_manage_posts` (publish and edit Page posts)

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/page-posting.md (reported line 36)May include surrounding context.

md
## 1) Token types
- User access token (granted via OAuth).
- Page access token (used for Page content actions).

## 2) Common Page permissions
- `pages_manage_posts` (publish and edit Page posts)

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/permissions-and-tokens.md (reported line 5)May include surrounding context.

md
## 1) Token types
- User access token (granted via OAuth).
- Page access token (used for Page content actions).

## 2) Common Page permissions
- `pages_manage_posts` (publish and edit Page posts)

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/permissions-and-tokens.md (reported line 15)May include surrounding context.

md
## 1) Token types
- User access token (granted via OAuth).
- Page access token (used for Page content actions).

## 2) Common Page permissions
- `pages_manage_posts` (publish and edit Page posts)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill documentation includes a delete operation for comments but does not warn that deletion may be destructive or irreversible. Under the markdown-specific warning rule, actions affecting user data or system integrity should be accompanied by an explicit warning.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The template document includes actions that publish content, hide comments, and delete comments, but it provides no warning that these operations are externally visible or destructive. In an agent skill context, this omission increases the chance that an LLM or operator will invoke the endpoints without explicit confirmation, causing unintended posting, moderation, or permanent deletion on a live Facebook Page.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

This markdown file describes publish and delete operations, including DELETE /{post-id} and use of page access tokens for publish actions, but provides no warning about the consequences for live content, permissions, or irreversible deletion. For markdown files, safety-affecting behaviors that may impact user data or system integrity should include clear warnings or cautions.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.