Back to skill

Security audit

Tweet Pipeline

Security checks for vulnerabilities and agentic risk

Overview

This skill has a coherent tweet-scheduling purpose, but it uses undocumented credential sources and hard-coded out-of-package execution paths that users should review before installing.

Review carefully before installing. Only use this in an environment where you intentionally allow it to read the listed local credential files, use 1Password/OpenClaw credentials, create scheduled OpenClaw cron jobs, modify the configured Notion database, and post publicly to the configured X account. Prefer fixing the docs/auth mismatch and replacing hard-coded external paths with package-relative paths first.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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
Findings (2)

T07 · Tool Hijacking and Spoofing

Warning
Location
scripts/tweet_poster.py:18
Finding

Posting workflow executes an unaudited script from outside the Skill package

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/tweet_poster.py:23
Finding

Skill accesses undocumented password-manager and local OAuth credential stores

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
Findings (30)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared behavior says the skill posts via OAuth2, but the implementation reportedly uses OAuth 1.0a for posting and includes a broken or unused OAuth2 refresh helper. This mismatch is dangerous because operators may provision the wrong secrets, misunderstand the trust model, and run unreviewed authentication code paths, which can cause credential misuse, failed auth recovery, or unintended posting behavior.

Content

No source excerpt is available for this finding.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/tweet_post_one.py (reported line 19)May include surrounding context.

python
def notion_headers():
    sa = open(os.path.expanduser("~/.config/openclaw/.op-service-token")).read().strip()
    env = {**os.environ, "OP_SERVICE_ACCOUNT_TOKEN": sa}
    key = subprocess.check_output(
        ["op", "read", "op://OpenClaw/Notion API Key/credential"], env=env
    ).decode().strip()

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/tweet_poster.py (reported line 27)May include surrounding context.

python
def notion_headers():
    sa = open(os.path.expanduser("~/.config/openclaw/.op-service-token")).read().strip()
    env = {**os.environ, "OP_SERVICE_ACCOUNT_TOKEN": sa}
    key = subprocess.check_output(
        ["op", "read", "op://OpenClaw/Notion API Key/credential"], env=env
    ).decode().strip()

Tainted flow: 'req' from open (line 110, file read) → urllib.request.urlopen (network output)

High
Category
Data Flow
Confidence
80% confidence
Finding

File contents flow to a network sink. This may indicate data exfiltration of sensitive files.

Content

Scanner excerpt · scripts/tweet_post_one.py (reported line 34)May include surrounding context.

python
req = urllib.request.Request(
        f"https://api.notion.com/v1/blocks/{page_id}/children", headers=headers
    )
    blocks = json.loads(urllib.request.urlopen(req).read()).get("results", [])
    parts = []
    for block in blocks:
        if block["type"] == "paragraph":

Tainted flow: 'req' from open (line 110, file read) → urllib.request.urlopen (network output)

High
Category
Data Flow
Confidence
80% confidence
Finding

File contents flow to a network sink. This may indicate data exfiltration of sensitive files.

Content

Scanner excerpt · scripts/tweet_post_one.py (reported line 47)May include surrounding context.

python
req = urllib.request.Request(
        f"https://api.notion.com/v1/pages/{page_id}", headers=headers
    )
    page = json.loads(urllib.request.urlopen(req).read())
    return page["properties"]["Status"]["select"]["name"]

Tainted flow: 'req' from open (line 110, file read) → urllib.request.urlopen (network output)

High
Category
Data Flow
Confidence
80% confidence
Finding

File contents flow to a network sink. This may indicate data exfiltration of sensitive files.

Content

Scanner excerpt · scripts/tweet_post_one.py (reported line 62)May include surrounding context.

python
f"https://api.notion.com/v1/pages/{page_id}",
        data=data, headers=headers, method="PATCH"
    )
    urllib.request.urlopen(req)


def load_oauth1_creds():

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
94% confidence
Finding

The function copies the full parent environment and adds a service account token before invoking secret-retrieval subprocesses inside a broken, inconsistent auth-refresh path. Even if not currently called, this broad environment propagation unnecessarily exposes ambient secrets to child processes and increases the blast radius if the refresh path is later enabled or modified incorrectly.

Content

Scanner excerpt · scripts/tweet_post_one.py (reported line 100)May include surrounding context.

python
def refresh_twitter_token():
    # OAuth1 doesn't need refresh — kept for compat
    sa = open(os.path.expanduser("~/.config/openclaw/.op-service-token")).read().strip()
    env = {**os.environ, "OP_SERVICE_ACCOUNT_TOKEN": sa}
    client_id = subprocess.check_output(
        ["op", "read", "op://OpenClaw/aennkmzygiq2z63vm7rbpmwn6a/username"], env=env
    ).decode().strip()

Tainted flow: 'req' from open (line 110, file read) → urllib.request.urlopen (network output)

High
Category
Data Flow
Confidence
98% confidence
Finding

The refresh_twitter_token function performs OAuth2 token exchange and is internally inconsistent and unsafe: it references undefined variables (refresh, user, xurl_path, d), yet would transmit a refresh token and handle new access tokens if ever invoked. Dead or partially migrated auth code like this is dangerous because future callers may enable it and inadvertently break token handling, leak credentials, or corrupt local auth state.

Content

Scanner excerpt · scripts/tweet_post_one.py (reported line 114)May include surrounding context.

python
"Authorization": f"Basic {basic}",
        "Content-Type": "application/x-www-form-urlencoded",
    })
    tokens = json.loads(urllib.request.urlopen(req).read())
    user["access_token"] = tokens["access_token"]
    if "refresh_token" in tokens:
        user["refresh_token"] = tokens["refresh_token"]

Tainted flow: 'req' from open (line 110, file read) → urllib.request.urlopen (network output)

High
Category
Data Flow
Confidence
80% confidence
Finding

File contents flow to a network sink. This may indicate data exfiltration of sensitive files.

Content

Scanner excerpt · scripts/tweet_post_one.py (reported line 130)May include surrounding context.

python
"Authorization": auth_header,
        "Content-Type": "application/json",
    })
    resp = urllib.request.urlopen(req)
    return json.loads(resp.read())

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill advertises code execution capabilities through metadata (env access, outbound network use, and Python execution) but does not declare an explicit tool scope such as permissions or allowed-tools. That weakens policy enforcement and user visibility, making it easier for the skill to access sensitive environment variables and perform network actions without clear confinement.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The workflow explicitly states that approved overdue tweets are posted immediately, but the skill description does not prominently warn users about this autonomous action. In a content-publishing context, that creates a real risk of accidental or unauthorized publication, especially if a stale approval or timezone mistake causes immediate posting without a final confirmation step.

Content

No source excerpt is available for this finding.

External Transmission

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

python
from zoneinfo import ZoneInfo

AEST = ZoneInfo("Australia/Sydney")
TWEET_API = "https://api.x.com/2/tweets"


def notion_headers():

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

python
def notion_headers():
    sa = open(os.path.expanduser("~/.config/openclaw/.op-service-token")).read().strip()
    env = {**os.environ, "OP_SERVICE_ACCOUNT_TOKEN": sa}
    key = subprocess.check_output(
        ["op", "read", "op://OpenClaw/Notion API Key/credential"], env=env
    ).decode().strip()
    return {

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

python
def notion_headers():
    sa = open(os.path.expanduser("~/.config/openclaw/.op-service-token")).read().strip()
    env = {**os.environ, "OP_SERVICE_ACCOUNT_TOKEN": sa}
    key = subprocess.check_output(
        ["op", "read", "op://OpenClaw/Notion API Key/credential"], env=env
    ).decode().strip()
    return {

Tainted flow: 'env' from open (line 100, file read) → subprocess.check_output (code execution)

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

python
def notion_headers():
    sa = open(os.path.expanduser("~/.config/openclaw/.op-service-token")).read().strip()
    env = {**os.environ, "OP_SERVICE_ACCOUNT_TOKEN": sa}
    key = subprocess.check_output(
        ["op", "read", "op://OpenClaw/Notion API Key/credential"], env=env
    ).decode().strip()
    return {

External Transmission

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

python
def get_tweet_text(page_id: str, headers: dict) -> str:
    req = urllib.request.Request(
        f"https://api.notion.com/v1/blocks/{page_id}/children", headers=headers
    )
    blocks = json.loads(urllib.request.urlopen(req).read()).get("results", [])
    parts = []

External Transmission

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

python
def get_tweet_text(page_id: str, headers: dict) -> str:
    req = urllib.request.Request(
        f"https://api.notion.com/v1/blocks/{page_id}/children", headers=headers
    )
    blocks = json.loads(urllib.request.urlopen(req).read()).get("results", [])
    parts = []

External Transmission

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

python
def get_tweet_text(page_id: str, headers: dict) -> str:
    req = urllib.request.Request(
        f"https://api.notion.com/v1/blocks/{page_id}/children", headers=headers
    )
    blocks = json.loads(urllib.request.urlopen(req).read()).get("results", [])
    parts = []

External Transmission

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

python
def get_tweet_text(page_id: str, headers: dict) -> str:
    req = urllib.request.Request(
        f"https://api.notion.com/v1/blocks/{page_id}/children", headers=headers
    )
    blocks = json.loads(urllib.request.urlopen(req).read()).get("results", [])
    parts = []

External Transmission

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

python
def get_tweet_text(page_id: str, headers: dict) -> str:
    req = urllib.request.Request(
        f"https://api.notion.com/v1/blocks/{page_id}/children", headers=headers
    )
    blocks = json.loads(urllib.request.urlopen(req).read()).get("results", [])
    parts = []

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The comment says OAuth1 does not need refresh, yet the function implements OAuth2 refresh logic and local file updates with undefined variables. This contradiction strongly suggests abandoned or copy-pasted auth code that can cause insecure future maintenance, token corruption, or accidental secret exposure if someone tries to use it.

Content

No source excerpt is available for this finding.

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

python
# OAuth1 doesn't need refresh — kept for compat
    sa = open(os.path.expanduser("~/.config/openclaw/.op-service-token")).read().strip()
    env = {**os.environ, "OP_SERVICE_ACCOUNT_TOKEN": sa}
    client_id = subprocess.check_output(
        ["op", "read", "op://OpenClaw/aennkmzygiq2z63vm7rbpmwn6a/username"], env=env
    ).decode().strip()
    client_secret = subprocess.check_output(

Tainted flow: 'env' from open (line 100, file read) → subprocess.check_output (code execution)

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

python
# OAuth1 doesn't need refresh — kept for compat
    sa = open(os.path.expanduser("~/.config/openclaw/.op-service-token")).read().strip()
    env = {**os.environ, "OP_SERVICE_ACCOUNT_TOKEN": sa}
    client_id = subprocess.check_output(
        ["op", "read", "op://OpenClaw/aennkmzygiq2z63vm7rbpmwn6a/username"], env=env
    ).decode().strip()
    client_secret = subprocess.check_output(

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

python
client_id = subprocess.check_output(
        ["op", "read", "op://OpenClaw/aennkmzygiq2z63vm7rbpmwn6a/username"], env=env
    ).decode().strip()
    client_secret = subprocess.check_output(
        ["op", "read", "op://OpenClaw/aennkmzygiq2z63vm7rbpmwn6a/credential"], env=env
    ).decode().strip()

Tainted flow: 'env' from open (line 100, file read) → subprocess.check_output (code execution)

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

python
client_id = subprocess.check_output(
        ["op", "read", "op://OpenClaw/aennkmzygiq2z63vm7rbpmwn6a/username"], env=env
    ).decode().strip()
    client_secret = subprocess.check_output(
        ["op", "read", "op://OpenClaw/aennkmzygiq2z63vm7rbpmwn6a/credential"], env=env
    ).decode().strip()

Static analysis

No suspicious patterns detected.