Back to skill

Security audit

Social Media Platform

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its social-media publishing purpose, but it handles connected account credentials and public posting with too few security and consent safeguards.

Review before installing or using this skill to generate production code. Require a secrets manager or encrypted server-only token storage, never return raw credentials from connection APIs, add explicit publish confirmations and audit logs, and disclose that posts, media, metadata, and account identifiers are sent to third-party social platforms.

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

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:32
Finding
Platform Credentials Stored in a General-Purpose JSONB Column Without Specified Protection## Vulnerability Details **File Location**: `SKILL.md`, lines 32–35 and 107–108 **Vulnerability Type**: Plaintext or inadequately protected sensitive credential storage **Risk Level**: High ### Vulnerable Snippets ```markdown - `platform_connections` — id, platform, account_name, credentials (JSONB), status, scopes ``` ```markdown - **Credentials in JSONB**: Each platform stores different auth shapes (API keys vs OAuth tokens vs page tokens) in a single `credentials` JSONB column ``` ### Technical Analysis The proposed architecture places API keys, OAuth tokens, and page access tokens in a general-purpose Supabase JSONB column. The Skill does not require encryption at the application layer, envelope encryption with externally managed keys, a managed secret store, restrictive row-level security, secret redaction, or controls preventing the connection API from returning stored credentials. JSONB provides data representation and querying, not secret protection. Database administrators, compromised service credentials, permissive Supabase policies, exposed backups, logging pipelines, or an authorization defect in the proposed `GET/POST /api/social/connections` interface could consequently reveal reusable platform credentials. Sending credentials to official platform endpoints is necessary for the declared publishing functionality. Persisting their raw values in ordinary application storage without explicit safeguards is not the minimum secure privilege model. The application generally needs server-side use of narrowly scoped tokens, not broad capability to expose their values through database reads or API responses. ### Attack Path 1. A user connects a social-media account, causing an API key, OAuth token, or page token to be stored in `platform_connections.credentials`. 2. An attacker obtains read access through a permissive Supabase row-level security policy, compromised backend/service credentials, an authorization flaw in the connections endpoint, an e ...[truncated 1111 chars]
Remediation
## Remediation Suggestions 1. Store credentials in a managed secret vault and keep only opaque secret references in `platform_connections`. If direct database storage is unavoidable, use application-layer envelope encryption with keys maintained outside Supabase. 2. Ensure secret decryption is available only to the server-side publishing component. Frontend clients and ordinary application queries must never receive raw credentials. 3. Apply deny-by-default Supabase row-level security and narrowly scoped service roles. Separate credential access from general post, calendar, and analytics access. 4. Make connection API responses return only non-sensitive metadata such as platform, account name, connection state, granted scopes, and token-expiration time. Explicitly exclude credential values. 5. Request the minimum platform scopes needed for enabled features. Avoid administrative, messaging, profile-management, or unrelated read scopes. 6. Implement token expiration handling, rotation, revocation on disconnect, and rapid emergency revocation procedures. 7. Redact authorization headers, tokens, request bodies, database fields, exception details, and query parameters from logs, traces, analytics, and error responses. 8. Audit all secret reads and publishing operations. Alert on bulk credential access, unusual destinations, unexpected publication volume, and repeated authentication failures. 9. Protect backups and database exports with encryption and strict access controls, and ensure retention and deletion policies also cover revoked credentials. 10. Validate outbound destinations against fixed official platform API hosts so credentials cannot be forwarded to attacker-controlled endpoints.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (3)

Credential Access

High
Category
Privilege Escalation
Content
Platform-specific implementations:
- **Twitter**: tweepy or requests to v2 API. 280 char limit. Free tier = 100 posts/month.
- **Facebook**: Graph API v21.0. Page Access Token required. Post to `/{page_id}/feed`.
- **Instagram**: Graph API via FB Page Token. Post to `/{ig_user_id}/media` → `/{ig_user_id}/media_publish`. Image required.
- **YouTube**: google-auth + google-api-python-client. OAuth with youtube.upload scope. Upload via resumable upload API.
- **TikTok**: Content Posting API (requires app review + demo video). Use Manual mode as fallback.
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The skill explicitly recommends storing platform credentials in a generic JSONB column but provides no guidance on encryption, secret isolation, access controls, or token lifecycle handling. In a social-media management system, this creates a realistic risk of insecure secret storage, accidental exposure in logs/backups, and overly broad database access to sensitive third-party authentication material.

Missing User Warnings

Medium
Confidence
83% confidence
Finding
The skill instructs the builder to publish user-generated content to external social platforms but omits any warning that content, media, metadata, and account identifiers will be transmitted to third parties. This can lead to privacy, compliance, and consent failures, especially if users assume content remains within the application until explicitly informed otherwise.