T09 · Insecure Skill Coding Practices
- Location
.env:7- Finding
Live-Looking API and Facebook Credentials Distributed in the Project
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill's main purpose is clear, but it ships live-looking credentials and can automatically publish AI-generated content to a Facebook Page without a required approval step.
Review before installing. Remove the bundled .env, rotate every exposed credential, replace it with a placeholder .env.example, pin dependencies, require dry-run or explicit approval before every Facebook publish action, limit Facebook token scopes, and run the crawler in an environment that cannot reach private/internal services.
.env:7Live-Looking API and Facebook Credentials Distributed in the Project
agents/fb_token_helper.py:90Long-Lived Facebook Tokens Are Printed and Persisted in Plaintext
utils.py:19Unrestricted URL Fetching Enables Server-Side Request Forgery
agents/writer_agent.py:68Untrusted Scraped Instructions Can Influence Automatically Published Content
requirements.txt:1Open-Ended Dependency Constraints Make Builds Non-Reproducible
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
FB_CLIENT_TOKEN=5eab434a4237521a17f16967244c0547
# --- Facebook Page ---
# TODO: điền sau khi chạy token_helper.py để lấy Page Access Token
FB_PAGE_ID=450928874763140
FB_PAGE_ACCESS_TOKEN=EAANKzZCeedAQBQxLjrW3TCBon8vAB42Xeth6DuZBnSgOGLUqUvMKZASZCM91UJNmLsIfCLZBSy4ZCfZBR03r9ZAVRgXmCaFCIGhpir75ZBLkFmSJR1TaVKZChZAYUVoV1BPvPaCfq23KmTQa9jNcKm1SNyXRKKltgSreLGFOwfsPYnX8ideU5xZBZA8OYB7G2Q9kuHAve75EYaTua9OBW9PmKQeZBScxwhM6LE4MMhlX5c2zllYu8ZD
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
.env
__pycache__/
*.pyc
*.pyo
The credential-related setup step explicitly directs users to open a .env that allegedly already contains app IDs and API keys. In context, this is not a generic mention of secrets management; it indicates bundled or shared credentials, which materially increases the risk of unauthorized access and credential reuse.
pip install -r requirements.txt
### Bước 2: Điền .env
Mở file `.env` — đã có sẵn App ID, API keys. Chỉ cần điền:
```env
FB_USER_ACCESS_TOKEN= ← lấy từ bước 3
The README instructs users to obtain a Page Access Token and copy it into .env for an automated publisher. In this skill context, access tokens grant direct control over posting to a Facebook page, so poor handling or sharing of such tokens can enable account misuse, unauthorized publication, and persistent abuse until rotated.
python agents/fb_token_helper.py
Làm theo hướng dẫn → copy Page Access Token vào .env.
The README publishes live-looking service credentials and identifiers, including what appears to be an OpenAI key prefix and Apify token, and states that keys already exist in the .env. Even if partially redacted, distributing credential material in documentation encourages secret sharing and may expose real or reusable access, enabling unauthorized API use, account abuse, or further credential harvesting.
Testing app credentials, validating page tokens, and reading page metadata are Facebook account interactions that should be disclosed, especially when the skill is marketed primarily as content crawling and rewriting. Even read-only credential validation expands exposure of sensitive integrations and may normalize collection of powerful secrets without sufficient warning.
Testing app credentials, validating page tokens, and reading page metadata are Facebook account interactions that should be disclosed, especially when the skill is marketed primarily as content crawling and rewriting. Even read-only credential validation expands exposure of sensitive integrations and may normalize collection of powerful secrets without sufficient warning.
Testing app credentials, validating page tokens, and reading page metadata are Facebook account interactions that should be disclosed, especially when the skill is marketed primarily as content crawling and rewriting. Even read-only credential validation expands exposure of sensitive integrations and may normalize collection of powerful secrets without sufficient warning.
Testing app credentials, validating page tokens, and reading page metadata are Facebook account interactions that should be disclosed, especially when the skill is marketed primarily as content crawling and rewriting. Even read-only credential validation expands exposure of sensitive integrations and may normalize collection of powerful secrets without sufficient warning.
Testing app credentials, validating page tokens, and reading page metadata are Facebook account interactions that should be disclosed, especially when the skill is marketed primarily as content crawling and rewriting. Even read-only credential validation expands exposure of sensitive integrations and may normalize collection of powerful secrets without sufficient warning.
Testing app credentials, validating page tokens, and reading page metadata are Facebook account interactions that should be disclosed, especially when the skill is marketed primarily as content crawling and rewriting. Even read-only credential validation expands exposure of sensitive integrations and may normalize collection of powerful secrets without sufficient warning.
Testing app credentials, validating page tokens, and reading page metadata are Facebook account interactions that should be disclosed, especially when the skill is marketed primarily as content crawling and rewriting. Even read-only credential validation expands exposure of sensitive integrations and may normalize collection of powerful secrets without sufficient warning.
Testing app credentials, validating page tokens, and reading page metadata are Facebook account interactions that should be disclosed, especially when the skill is marketed primarily as content crawling and rewriting. Even read-only credential validation expands exposure of sensitive integrations and may normalize collection of powerful secrets without sufficient warning.
Testing app credentials, validating page tokens, and reading page metadata are Facebook account interactions that should be disclosed, especially when the skill is marketed primarily as content crawling and rewriting. Even read-only credential validation expands exposure of sensitive integrations and may normalize collection of powerful secrets without sufficient warning.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"""
agents/fb_token_helper.py
──────────────────────────
Tiện ích lấy và exchange Facebook Access Token.
Chạy trực tiếp:
python agents/fb_token_helper.py
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"""
agents/fb_token_helper.py
──────────────────────────
Tiện ích lấy và exchange Facebook Access Token.
Chạy trực tiếp:
python agents/fb_token_helper.py
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"""
agents/fb_token_helper.py
──────────────────────────
Tiện ích lấy và exchange Facebook Access Token.
Chạy trực tiếp:
python agents/fb_token_helper.py
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"""
agents/fb_token_helper.py
──────────────────────────
Tiện ích lấy và exchange Facebook Access Token.
Chạy trực tiếp:
python agents/fb_token_helper.py
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"""
agents/fb_token_helper.py
──────────────────────────
Tiện ích lấy và exchange Facebook Access Token.
Chạy trực tiếp:
python agents/fb_token_helper.py
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"""
agents/fb_token_helper.py
──────────────────────────
Tiện ích lấy và exchange Facebook Access Token.
Chạy trực tiếp:
python agents/fb_token_helper.py
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def get_page_tokens(long_lived_user_token: str) -> list[dict]:
"""
Lấy danh sách Pages + Page Access Tokens từ long-lived user token.
"""
url = f"{config.FB_BASE_URL}/me/accounts"
params = {"access_token": long_lived_user_token}
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def get_page_tokens(long_lived_user_token: str) -> list[dict]:
"""
Lấy danh sách Pages + Page Access Tokens từ long-lived user token.
"""
url = f"{config.FB_BASE_URL}/me/accounts"
params = {"access_token": long_lived_user_token}
The script prints the long-lived user token and page access tokens directly to the console as .env entries. Console output is often captured in terminal history, logs, screen recordings, remote shells, or shared sessions, which can expose reusable Facebook credentials.
)
console.print(table)
# Save to .env hint
console.print("\n[bold green]✅ XONG! Cập nhật .env:[/bold green]")
for page in pages:
console.print(f"\nPage: [bold]{page.get('name')}[/bold] (ID: {page.get('id')})")
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"""
config.py — Centralized configuration loaded from .env
"""
import os
from dotenv import load_dotenv
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"""
config.py — Centralized configuration loaded from .env
"""
import os
from dotenv import load_dotenv
No suspicious patterns detected.