Back to skill

Security audit

Techla FB Repost

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent with its Facebook reposting purpose, but it handles powerful posting and API credentials in ways that can leak them.

Review before installing. Use this only with Pages you own or are authorized to manage, and assume Apify, Google, and Facebook will receive the referenced content, prompts, images, and post text. Do not paste real tokens into commands or chats; use a protected secret store or environment variables, restrict token scopes, and rotate any token already used through these examples. The verify command should be fixed before use so it never requests or prints access_token values.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/scrape_fb.py:11
Finding

Apify credentials are exposed through command-line arguments

Content
View full analysis
2 else None FB_URL = sys.argv[1] if len(sys.argv) > 1 else None ``` The documented invocation explicitly places the credential on the command line: ```bash python3 scripts/scrape_fb.py "" "" ``` ### Technical Analysis The Apify API token is supplied through `argv`. Command-line arguments can be retained in shell history, captured by process-monitoring or observability systems, and exposed to other local users who have permission to inspect processes. Although sending an Apify token to Apify is necessary for the declared scraping functionality, accepting that token through a command-line argument is not necessary and creates avoidable local exposure. ### Attack Path 1. A user follows the documented command and supplies an Apify token as the second argument. 2. The complete command is saved in shell history or observed through process inspection. 3. A local attacker or log reader extracts the token. 4. The attacker reuses the token against Apify APIs until it is revoked or expires. ### Impact Assessment A compromised token may permit unauthorized actor runs, access to account-associated Apify resources subject to the token's permissions, consumption of paid platform resources, and exposure of datasets accessible with that token. This does not directly grant local code execution or Facebook Page access. ]]>
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate_image.py:12
Finding

Gemini API keys are exposed through command-line arguments

Content
View full analysis
1 else None API_KEY = sys.argv[2] if len(sys.argv) > 2 else None OUTPUT_PATH = sys.argv[3] if len(sys.argv) > 3 else "/tmp/gemini_image.png" ``` The documented invocation places the Gemini key in the process argument list: ```bash python3 scripts/generate_image.py "" "" /tmp/fb_image.png ``` ### Technical Analysis API keys should not be transported through command-line arguments because process arguments may be visible in process listings, shell history, Agent execution logs, and monitoring systems. The image-generation operation requires a Gemini credential, but exposing it through `argv` exceeds the minimum disclosure needed to perform the task. ### Attack Path 1. A user or Agent starts the image generator with a Gemini key in the command. 2. The command is retained in history, a transcript, process telemetry, or monitoring output. 3. An attacker with access to that data extracts the key. 4. The attacker submits unauthorized Gemini API requests under the victim's project or quota. ### Impact Assessment Exploitation may result in unauthorized model usage, quota exhaustion, financial cost, and access to other Google AI operations authorized by the same key and its API restrictions. The impact depends on how narrowly the key is restricted. ]]>
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/post_fb.py:102
Finding

Facebook Page access tokens are exposed through command-line arguments

Content
View full analysis
1 else None if command == "upload-photo": if len(sys.argv) < 5: print(json.dumps({"error": "Usage: upload-photo "})) sys.exit(1) result = upload_photo(sys.argv[2], sys.argv[3], sys.argv[4]) elif command == "post": if len(sys.argv) < 5: print(json.dumps({"error": "Usage: post '' []"})) sys.exit(1) photo_id = sys.argv[5] if len(sys.argv) > 5 else None result = post_to_page(sys.argv[2], sys.argv[3], sys.argv[4], photo_id) elif command == "verify": if len(sys.argv) < 4: print(json.dumps({"error": "Usage: verify "})) sys.exit(1) result = get_page_info(sys.argv[2], sys.argv[3]) ``` Documented examples also place the Page token on the command line: ```bash python3 scripts/post_fb.py upload-photo "" "" /tmp/fb_image.png python3 scripts/post_fb.py post "" "" "" "" ``` ### Technical Analysis The Page access token is a high-value publishing credential and is accepted directly through `argv` for upload, post, and verification operations. It can therefore be disclosed through shell history, process inspection, Agent transcripts, or process telemetry. The Page identifier, message, image path, and photo identifier may legitimately be command arguments. The access token does not need to be present there and should be independently retrieved from protected secret storage. ### Attack Path 1. A user follows the documented upload, post, or verify command. 2. The Page token appear ...[truncated 708 chars]
Remediation
View remediation
` from every command syntax and usage error. - Use a narrowly scoped Page token containing only permissions required by the posting workflow. - Separate verification and publishing credentials if the platform supports narrower permissions. - Redact tokens from Agent transcripts, process telemetry, and error reports. - Rotate exposed Page tokens and review recent Page activity for unauthorized actions. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/scrape_fb.py:48
Finding

Apify tokens are embedded in request URLs

Content
View full analysis
`. 2. A proxy, instrumentation library, access l ...[truncated 471 chars]
Remediation
View remediation
`. - Do not include the authentication token in query strings or actor input JSON. - Centralize request construction in a configured `requests.Session` with an authorization header. - Configure HTTP logging and telemetry to redact authorization headers. - Call `raise_for_status()` on polling and dataset responses and return sanitized errors. - Rotate tokens if URLs containing them may already have entered logs. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate_image.py:27
Finding

Gemini API keys are embedded in request URLs

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/post_fb.py:75
Finding

Facebook verification unnecessarily retrieves and prints an access token

Content
View full analysis
"})) sys.exit(1) result = get_page_info(sys.argv[2], sys.argv[3]) else: print(json.dumps({ "error": "Unknown command", "usage": "upload-photo | post | verify" })) sys.exit(1) print(json.dumps(result, ensure_ascii=False)) ``` ### Technical Analysis Verifying that a Page token works only requires non-sensitive fields such as `id` or `name`. Requesting `access_token` is unnecessary for verification and violates data minimization. Because the entire response is printed, any returned token may enter terminal output, Agent transcripts, CI logs, or centralized log storage. This behavior exceeds the minimum privilege and data-access requirements of the declared verification function. ### Attack Path 1. A user or Agent invokes the `verify` command with a valid Page token. 2. The script requests `name,access_token` from Facebook Graph API. 3. Facebook returns the Page information, potentially including an access token. 4. The script serializes the complete response to stdout. 5. The output is retained in a terminal transcript, Agent conversation, CI log, or monitoring system. 6. A party with access to ...[truncated 443 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (29)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Mô tả khai báo một quy trình đầy đủ cho repost bài Facebook: đọc bài từ link Facebook, viết lại nội dung, tạo ảnh minh họa, rồi đăng lên Facebook Page. Tuy nhiên, mã nguồn được cung cấp chỉ thực hiện một phần hẹp của quy trình đó: gọi Google Gemini/Imagen để sinh ảnh từ prompt và ghi ảnh ra file. Không có bất kỳ xử lý nào liên quan đến Facebook URLs, scraping/đọc nội dung bài viết, biến đổi văn bản, hay gọi Facebook Graph API để đăng bài. Vì vậy, mục đích thực tế của đoạn mã khác biệt đáng kể so với mô tả tổng thể của skill.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Mô tả khai báo một pipeline đầy đủ: đọc bài từ link Facebook, rewrite nội dung, tạo ảnh minh họa bằng Gemini, rồi đăng lên Page. Nhưng mã thực tế chỉ là tiện ích đăng bài cơ bản qua Facebook Graph API: upload ảnh từ đường dẫn local, post message, và verify page/token. Phần 'đăng lên Facebook Page qua Graph API' là phù hợp, nhưng đó chỉ là một phần nhỏ của mô tả. Các năng lực cốt lõi được khai báo như lấy nội dung từ link Facebook, viết lại bài, và tạo ảnh bằng Gemini hoàn toàn không xuất hiện trong code. Vì vậy đây là mismatch rõ ràng giữa declared purpose và actual behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Mô tả khai báo một pipeline đầy đủ gồm: lấy bài Facebook, rewrite nội dung, tạo ảnh minh họa, và đăng lại lên Facebook Page. Tuy nhiên code thực tế chỉ thực hiện phần đầu là scrape dữ liệu bài viết Facebook thông qua Apify actor, sau đó trả về JSON chứa text/media/metrics. Không có bất kỳ tích hợp nào với Gemini, không có xử lý sinh nội dung hay phong cách viết lại, và cũng không có gọi Facebook Graph API để đăng bài. Vì vậy mô tả vượt xa đáng kể so với hành vi thực tế của code và đây là mismatch rõ ràng.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The activation rule says to use the skill whenever there is a Facebook link plus a repost-related request, which is overly broad for a workflow that handles scraping, AI rewriting, image generation, and social posting. Over-triggering can cause the agent to solicit sensitive credentials or prepare external posting actions in situations where the user did not clearly intend that level of automation.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

The skill explicitly requests a Facebook Page Access Token with posting permissions, along with other API credentials, which creates a high-risk credential handling path. Because this skill's context includes scraping and automated publication to external platforms, compromised or over-shared tokens could be used for unauthorized posting, reputational damage, and third-party account abuse.

Content

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

md
1. **APIFY_TOKEN** — https://console.apify.com/account/integrations
2. **GEMINI_API_KEY** — https://aistudio.google.com/app/apikey  
3. **FB_PAGE_ID** — ID Facebook Page
4. **FB_PAGE_ACCESS_TOKEN** — Page Access Token (permission `pages_manage_posts`)

> Gợi ý user lưu vào OpenClaw secrets/env vars để không nhập lại.

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 112)May include surrounding context.

Facebook Page Token

  1. Go to Facebook Developer Console
  2. Create app with "Pages" product
  3. Get User Access Token with pages_manage_posts permission
  4. Exchange for Page Access Token:
    text
    GET https://graph.facebook.com/{USER_ID}/accounts?access_token={USER_TOKEN}
    

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/api_docs.md (reported line 112)May include surrounding context.

Facebook Page Token

  1. Go to Facebook Developer Console
  2. Create app with "Pages" product
  3. Get User Access Token with pages_manage_posts permission
  4. Exchange for Page Access Token:
    text
    GET https://graph.facebook.com/{USER_ID}/accounts?access_token={USER_TOKEN}
    

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/api_docs.md (reported line 113)May include surrounding context.

  1. Go to Facebook Developer Console
  2. Create app with "Pages" product
  3. Get User Access Token with pages_manage_posts permission
  4. Exchange for Page Access Token:
    text
    GET https://graph.facebook.com/{USER_ID}/accounts?access_token={USER_TOKEN}
    

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill orchestrates external network actions including scraping Facebook content, calling Gemini, and posting to Facebook, but it declares no explicit tool scope or allowed-tools boundary. That makes the operational surface broader and less auditable, increasing the chance of unintended network access or misuse of connected capabilities.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill encourages storing highly sensitive API keys and a Facebook Page access token in secrets or environment variables without any warning about token sensitivity, scope minimization, or rotation. In a skill that can post to Facebook and call third-party services, mishandling these credentials could enable account misuse, unauthorized posting, or abuse of paid API resources.

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

Facebook Posts Scraper (Primary)

  • Actor ID: apify~facebook-posts-scraper
  • Run URL: POST https://api.apify.com/v2/acts/apify~facebook-posts-scraper/runs

Request body:

json

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documentation provides direct instructions for publishing to a live Facebook Page via the Graph API without requiring any explicit user confirmation, dry-run mode, or warning that the action causes real external side effects. In the context of an agent skill whose purpose is to repost content automatically, this increases the risk of unintended publication, unauthorized posting, and reputational harm if the agent acts on ambiguous prompts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
80% confidence
Finding

The usage string instructs users to pass GEMINI_API_KEY as a command-line argument, and the key is then embedded in outbound request URLs. Although the purpose of the script involves calling the API, there is no warning that the credential is sensitive or that passing secrets via command-line arguments may expose them in shell history or process listings.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The script sends the user-provided PROMPT to Google's generativelanguage.googleapis.com endpoint, but there is no warning in code comments, output, or documentation about transmitting user data to a third-party service. For code files, network calls that transmit user data should have some form of disclosure unless the warning is clearly documented elsewhere.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% 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/generate_image.py (reported line 35)May include surrounding context.

python
}
    
    try:
        response = requests.post(url, json=payload, headers=headers, timeout=60)
        response.raise_for_status()
        data = response.json()

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% 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/generate_image.py (reported line 72)May include surrounding context.

python
}
    
    try:
        response = requests.post(url, json=payload, headers=headers, timeout=60)
        response.raise_for_status()
        data = response.json()

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The script writes generated image bytes directly to OUTPUT_PATH, which is supplied via command-line argument, but provides no user-facing disclosure at the point of write beyond the bare usage string. For code files, file writes that lack confirmation prompts, visible warnings, or clearer explanatory comments can qualify as missing user warnings.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The usage instructions require the user to pass a TOKEN on the command line, and the code then sends that credential in HTTP requests. There is no warning in comments, help text, or output that the token is sensitive or that passing secrets via command-line arguments may expose them in shell history or process listings.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code performs outbound HTTP requests to Facebook's Graph API and uploads a local image file, but the implementation provides no confirmation prompt or runtime disclosure before sending user content off-system. The module docstring shows usage syntax, but it does not warn that local files and message content will be transmitted to Facebook.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

get_page_info requests fields=name,access_token, which retrieves a page access token even though simple verification does not require returning that secret. Pulling broader sensitive data than necessary violates least privilege and increases the chance of credential exposure through logs, downstream tool output, or misuse by an agent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script sends both the user-supplied Facebook URL and the Apify token to a third-party scraping service, but the only disclosure is a brief usage string in the docstring. In this skill context, that matters because users may expect local processing while the skill actually transmits content targets and credentials off-platform to Apify, creating privacy, compliance, and secret-handling risk.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

The hardcoded Apify API base indicates that the skill is designed to send data to an external third-party service. By itself the constant is not malicious, but in context it confirms an external data flow that users may not anticipate, especially for scraped content workflows involving social media URLs and access tokens.

Content

Scanner excerpt · scripts/scrape_fb.py (reported line 20)May include surrounding context.

python
sys.exit(1)

ACTOR_ID = "apify~facebook-posts-scraper"
API_BASE = "https://api.apify.com/v2"

def run_actor():
    """Run Apify actor and get dataset items."""

External Transmission

Medium
Category
Data Exfiltration
Confidence
96% confidence
Finding

This code transmits the Facebook URL and Apify token to api.apify.com, which is an external service outside the local skill boundary. In a reposting skill, such exfiltration is somewhat aligned with function, but it is still security-relevant because it exposes potentially sensitive user targets and credentials to a third party and broadens the trust boundary.

Content

Scanner excerpt · scripts/scrape_fb.py (reported line 35)May include surrounding context.

python
}
    
    try:
        response = requests.post(run_url, json=payload, headers=headers, timeout=70)
        response.raise_for_status()
        run_data = response.json()

Tainted flow: 'status_url' from requests.post (line 108, network input) → requests.get (network output)

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/scrape_fb.py (reported line 45)May include surrounding context.

python
# Poll for completion
        status_url = f"{API_BASE}/actor-runs/{run_id}"
        for _ in range(30):  # Max 30 attempts
            status_resp = requests.get(f"{status_url}?token={APIFY_TOKEN}", timeout=30)
            status_data = status_resp.json()
            status = status_data["data"]["status"]

Tainted flow: 'status_url' from requests.post (line 108, network input) → requests.get (network output)

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/scrape_fb.py (reported line 110)May include surrounding context.

python
# Poll for completion
        status_url = f"{API_BASE}/actor-runs/{run_id}"
        for _ in range(30):  # Max 30 attempts
            status_resp = requests.get(f"{status_url}?token={APIFY_TOKEN}", timeout=30)
            status_data = status_resp.json()
            status = status_data["data"]["status"]