T05 · Unauthorized Access and Privilege Escalation
- Location
social_media_automation/integration/bot_integration.py:136- Finding
Arbitrary Local File Upload Through Telegram Integration
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
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.
social_media_automation/integration/bot_integration.py:136Arbitrary Local File Upload Through Telegram Integration
social_media_automation/integration/bot_integration.py:83Unrestricted Outbound Request to Caller-Controlled Discord Webhook URL
social_media_automation/cli.py:351Twitter API Key Prefix Disclosed by Configuration Command
social_media_automation/core/oauth.py:75OAuth Tokens Stored Without Restrictive Permission and Path Controls
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.
@app.command()
def init(
force: bool = typer.Option(False, "--force", "-f", help="Overwrite existing config"),
) -> None:
"""
Initialize configuration for social media automation
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# Load environment variables
PROJECT_DIR = Path(__file__).parent.parent
ENV_FILE = PROJECT_DIR / ".env"
load_dotenv(ENV_FILE)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# Load environment variables
PROJECT_DIR = Path(__file__).parent.parent
ENV_FILE = PROJECT_DIR / ".env"
load_dotenv(ENV_FILE)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# Load environment variables
PROJECT_DIR = Path(__file__).parent.parent
ENV_FILE = PROJECT_DIR / ".env"
load_dotenv(ENV_FILE)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# Load environment variables
PROJECT_DIR = Path(__file__).parent.parent
ENV_FILE = PROJECT_DIR / ".env"
load_dotenv(ENV_FILE)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# Load environment variables
PROJECT_DIR = Path(__file__).parent.parent
ENV_FILE = PROJECT_DIR / ".env"
load_dotenv(ENV_FILE)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
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 "",
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
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 "",
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
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 "",
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
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 "",
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
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 "",
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Args:
api_key: API key
api_secret: API secret
access_token: Access token
access_secret: Access secret
"""
self.api_key = api_key
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Args:
api_key: API key
api_secret: API secret
access_token: Access token
access_secret: Access secret
"""
self.api_key = api_key
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
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
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
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")
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
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")
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
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")
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
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")
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
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")
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
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")
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
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")
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
import os
# Remove environment variables
for key in list(os.environ.keys()):
if key.startswith("TWITTER_") or key.startswith("BLUESKY_"):
del os.environ[key]
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
import os
# Remove environment variables
for key in list(os.environ.keys()):
if key.startswith("TWITTER_") or key.startswith("BLUESKY_"):
del os.environ[key]
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.
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.
No suspicious patterns detected.