Back to skill

Security audit

Social Media Automation

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches a social-media automation tool, but review is warranted because it handles live account actions and secrets with weak disclosure and safeguards.

Install only if you are comfortable giving the tool tokens that can act on your social-media accounts. Use least-privilege API credentials, keep the .env file private, rotate tokens if config output has been logged, verify account and target IDs before posting, liking, retweeting, deleting, or scheduling, and avoid using the undocumented Discord/Telegram integration until its file-upload and webhook scoping issues are fixed.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (4)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
social_media_automation/integration/bot_integration.py:136
Finding

Arbitrary Local File Upload Through Telegram Integration

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
social_media_automation/integration/bot_integration.py:83
Finding

Unrestricted Outbound Request to Caller-Controlled Discord Webhook URL

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
social_media_automation/cli.py:351
Finding

Twitter API Key Prefix Disclosed by Configuration Command

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
social_media_automation/core/oauth.py:75
Finding

OAuth Tokens Stored Without Restrictive Permission and Path Controls

Content
View full analysis
None: """Save tokens to .env file""" with open(env_path, "r") as f: lines = f.readlines() updated = False for i, line in enumerate(lines): if line.startswith("TWITTER_ACCESS_TOKEN="): lines[i] = f"TWITTER_ACCESS_TOKEN={access_token}\n" updated = True elif line.startswith("TWITTER_ACCESS_SECRET="): lines[i] = f"TWITTER_ACCESS_SECRET={access_token_secret}\n" updated = True with open(env_path, "w") as f: f.writelines(lines) ``` ### Technical Analysis The function writes the OAuth access token and token secret to a plaintext `.env` file. It does not enforce restrictive file permissions, validate file ownership, reject symlinks, constrain the destination to an approved path, or perform an atomic replacement. Opening an existing file with `"w"` generally preserves its existing permission mode. Therefore, a previously group-readable or world-readable `.env` can remain accessible after the secrets are written. Since `env_path` is accepted as an arbitrary string and normal file opening follows symlinks, a caller or local attacker who can prepare the destination may redirect credential storage to an unintended file. The function also reads and rewrites the file directly, which creates a risk of partial file contents if execution is interrupted during the write. ### Attack Path **Permissive-file scenario:** 1. A `.env` file exists with group-readable or world-readable permissions. 2. The user completes OAuth authentication. 3. `save_tokens()` writes the access token and secret into the existing file. 4. The permissive mode remains in effect. 5. Another local ...[truncated 935 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (64)

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · social_media_automation/cli.py (reported line 77)May include surrounding context.

python
@app.command()
def init(
    force: bool = typer.Option(False, "--force", "-f", help="Overwrite existing config"),
) -> None:
    """
    Initialize configuration for social media automation

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · social_media_automation/cli.py (reported line 82)May include surrounding context.

python
# Load environment variables
PROJECT_DIR = Path(__file__).parent.parent
ENV_FILE = PROJECT_DIR / ".env"
load_dotenv(ENV_FILE)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · social_media_automation/config.py (reported line 15)May include surrounding context.

python
# Load environment variables
PROJECT_DIR = Path(__file__).parent.parent
ENV_FILE = PROJECT_DIR / ".env"
load_dotenv(ENV_FILE)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · social_media_automation/config/__init__.py (reported line 11)May include surrounding context.

python
# Load environment variables
PROJECT_DIR = Path(__file__).parent.parent
ENV_FILE = PROJECT_DIR / ".env"
load_dotenv(ENV_FILE)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · social_media_automation/core/oauth.py (reported line 75)May include surrounding context.

python
# Load environment variables
PROJECT_DIR = Path(__file__).parent.parent
ENV_FILE = PROJECT_DIR / ".env"
load_dotenv(ENV_FILE)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · social_media_automation/tests/test_cli.py (reported line 38)May include surrounding context.

python
# Load environment variables
PROJECT_DIR = Path(__file__).parent.parent
ENV_FILE = PROJECT_DIR / ".env"
load_dotenv(ENV_FILE)

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 · social_media_automation/core/oauth.py (reported line 35)May include surrounding context.

python
return oauth1_user_handler.get_authorization_url()

    def get_access_token(self, verifier: str) -> tuple[str, str]:
        """Get access token from verifier"""
        oauth1_user_handler = tweepy.OAuth1UserHandler(
            consumer_key=self.config.twitter_api_key or "",
            consumer_secret=self.config.twitter_api_secret or "",

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 · social_media_automation/core/oauth.py (reported line 61)May include surrounding context.

python
return oauth1_user_handler.get_authorization_url()

    def get_access_token(self, verifier: str) -> tuple[str, str]:
        """Get access token from verifier"""
        oauth1_user_handler = tweepy.OAuth1UserHandler(
            consumer_key=self.config.twitter_api_key or "",
            consumer_secret=self.config.twitter_api_secret or "",

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 · social_media_automation/core/oauth.py (reported line 68)May include surrounding context.

python
return oauth1_user_handler.get_authorization_url()

    def get_access_token(self, verifier: str) -> tuple[str, str]:
        """Get access token from verifier"""
        oauth1_user_handler = tweepy.OAuth1UserHandler(
            consumer_key=self.config.twitter_api_key or "",
            consumer_secret=self.config.twitter_api_secret or "",

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

python
return oauth1_user_handler.get_authorization_url()

    def get_access_token(self, verifier: str) -> tuple[str, str]:
        """Get access token from verifier"""
        oauth1_user_handler = tweepy.OAuth1UserHandler(
            consumer_key=self.config.twitter_api_key or "",
            consumer_secret=self.config.twitter_api_secret or "",

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

python
return oauth1_user_handler.get_authorization_url()

    def get_access_token(self, verifier: str) -> tuple[str, str]:
        """Get access token from verifier"""
        oauth1_user_handler = tweepy.OAuth1UserHandler(
            consumer_key=self.config.twitter_api_key or "",
            consumer_secret=self.config.twitter_api_secret or "",

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 · social_media_automation/core/oauth.py (reported line 44)May include surrounding context.

python
Args:
            api_key: API key
            api_secret: API secret
            access_token: Access token
            access_secret: Access secret
        """
        self.api_key = api_key

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 · social_media_automation/platforms/x.py (reported line 19)May include surrounding context.

python
Args:
            api_key: API key
            api_secret: API secret
            access_token: Access token
            access_secret: Access secret
        """
        self.api_key = api_key

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

python
api_key: API key
            api_secret: API secret
            access_token: Access token
            access_secret: Access secret
        """
        self.api_key = api_key
        self.api_secret = api_secret

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 43)May include surrounding context.

md
def test_init_command_force(tmp_path) -> None:
    """Test the init command with force flag"""
    with runner.isolated_filesystem(temp_dir=tmp_path):
        # Create .env file
        with open(".env", "w") as f:
            f.write("TEST=value")

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
def test_init_command_force(tmp_path) -> None:
    """Test the init command with force flag"""
    with runner.isolated_filesystem(temp_dir=tmp_path):
        # Create .env file
        with open(".env", "w") as f:
            f.write("TEST=value")

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · social_media_automation/cli.py (reported line 89)May include surrounding context.

python
def test_init_command_force(tmp_path) -> None:
    """Test the init command with force flag"""
    with runner.isolated_filesystem(temp_dir=tmp_path):
        # Create .env file
        with open(".env", "w") as f:
            f.write("TEST=value")

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · social_media_automation/cli.py (reported line 96)May include surrounding context.

python
def test_init_command_force(tmp_path) -> None:
    """Test the init command with force flag"""
    with runner.isolated_filesystem(temp_dir=tmp_path):
        # Create .env file
        with open(".env", "w") as f:
            f.write("TEST=value")

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · social_media_automation/core/oauth.py (reported line 76)May include surrounding context.

python
def test_init_command_force(tmp_path) -> None:
    """Test the init command with force flag"""
    with runner.isolated_filesystem(temp_dir=tmp_path):
        # Create .env file
        with open(".env", "w") as f:
            f.write("TEST=value")

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · social_media_automation/core/oauth.py (reported line 92)May include surrounding context.

python
def test_init_command_force(tmp_path) -> None:
    """Test the init command with force flag"""
    with runner.isolated_filesystem(temp_dir=tmp_path):
        # Create .env file
        with open(".env", "w") as f:
            f.write("TEST=value")

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · social_media_automation/tests/test_cli.py (reported line 37)May include surrounding context.

python
def test_init_command_force(tmp_path) -> None:
    """Test the init command with force flag"""
    with runner.isolated_filesystem(temp_dir=tmp_path):
        # Create .env file
        with open(".env", "w") as f:
            f.write("TEST=value")

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 · social_media_automation/tests/test_config.py (reported line 14)May include surrounding context.

python
import os

    # Remove environment variables
    for key in list(os.environ.keys()):
        if key.startswith("TWITTER_") or key.startswith("BLUESKY_"):
            del os.environ[key]

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 · social_media_automation/tests/test_config.py (reported line 31)May include surrounding context.

python
import os

    # Remove environment variables
    for key in list(os.environ.keys()):
        if key.startswith("TWITTER_") or key.startswith("BLUESKY_"):
            del os.environ[key]

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file documents creating a .env file with multiple API credentials and using the tool to post and interact with social-media services, but it does not include a clear warning about protecting secrets or that content and metadata will be sent to external platforms. For a skill that affects privacy and external accounts, the README should disclose these behaviors explicitly to users.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The README includes deletion and cancellation commands such as draft deletion and schedule cancellation, plus live account actions like post, reply, retweet, and like, but does not warn users that these operations may be immediate and not easily reversible. For markdown guidance, user-facing documentation should highlight data/account impact where commands can alter persistent state or public content.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.