T09 · Insecure Skill Coding Practices
- Location
scripts/twitter_oauth_client.py:338- Finding
API Key Disclosed in Command Output
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill does what it claims for Twitter/X reading and posting, but it exposes the AIsa API key in command output and can send that key to an arbitrary configured relay endpoint.
Review this carefully before installing. Use it only with a scoped, disposable AIsa key, avoid custom TWITTER_RELAY_BASE_URL values, rotate the key if command output has been logged, and require explicit approval of exact post text/media before letting an agent publish to a real Twitter/X account.
scripts/twitter_oauth_client.py:338API Key Disclosed in Command Output
scripts/twitter_oauth_client.py:43Arbitrary Plaintext Relay Endpoint Can Receive API Credentials and User Data
scripts/twitter_oauth_client.py:466Unvalidated Relay-Supplied Authorization URL Is Opened in the Browser
The code substantially matches the declared read/search portions: it supports user profiles/about info, timelines, mentions, followers/followings, tweet search, trends, lists, communities, and Spaces. However, the description also claims the skill can publish posts after the user completes OAuth in the browser. In the supplied code, there is no posting endpoint, no write operation, no OAuth flow, and no browser-based authentication despite importing webbrowser. Authentication is only via an AISA_API_KEY bearer token. Therefore the description overstates important write/auth capabilities that are not present in this code chunk.
The description says this skill both reads/searches extensive Twitter/X data and publishes posts after OAuth. The supplied code only supports three commands: authorize, post, and status. The network endpoints used are /twitter/auth_twitter and /twitter/post_twitter; there are no endpoints or functions for fetching profiles, timelines, mentions, followers, searches, trends, lists, communities, or Spaces. The posting functionality is indeed present, including browser OAuth initiation, media uploads, quote/reply posting, and automatic splitting into threaded chunks. However, the major declared read/search functionality is not represented in this code chunk, making the description materially broader than the actual behavior.
The README promotes the ability to write and post to Twitter/X, including media and threads, but does not clearly warn that these actions can publish publicly under the user's own account once OAuth is completed. In an autonomous agent context, this omission is risky because users may not fully appreciate that a natural-language request can trigger irreversible public actions, increasing the chance of accidental or unwanted posting.
The skill requires environment access to AISA_API_KEY and makes outbound network requests, but it does not declare an explicit tool scope such as permissions or allowed-tools. That omission weakens policy enforcement and makes it harder for a host to constrain what the skill is allowed to access, increasing the chance of unintended secret use or network egress.
Conflicting statements about whether the skill can post to Twitter/X create ambiguity around real-world side effects. In agent contexts, ambiguity about write actions is dangerous because users and orchestrators may treat the skill as informational while it can initiate publishing workflows through referenced materials.
The manifest markets the skill as 'Search + Post,' but the body explicitly states that publishing logic is not defined in this file and is handled elsewhere. This split can conceal where account-affecting actions occur, reducing reviewability and increasing the risk that users or hosts enable a skill with write capabilities they have not fully audited.
The skill description mentions publishing to a real Twitter/X account after OAuth but does not provide an explicit warning about account-affecting actions. In an autonomous-agent setting, omission of a clear warning increases the chance of unintended posts, replies, or reputation damage if the skill is invoked without strong user awareness.
This endpoint sends requests and the bearer API key to an external third-party service. External transmission is expected for this skill's purpose, but it still creates a real data-exposure surface because user queries, targeted account data, and credentials are sent off-platform.
# Get user info
curl "https://api.aisa.one/apis/v1/twitter/user/info?userName=elonmusk" \
-H "Authorization: Bearer $AISA_API_KEY"
# Get user profile about (account country, verification, username changes)
This example transmits requests plus the Authorization: Bearer $AISA_API_KEY header to an external API. While functionally necessary, such transmission is security-relevant because misuse, overbroad permissions, or accidental logging could expose the secret or sensitive user activity.
-H "Authorization: Bearer $AISA_API_KEY"
# Get user profile about (account country, verification, username changes)
curl "https://api.aisa.one/apis/v1/twitter/user_about?userName=elonmusk" \
-H "Authorization: Bearer $AISA_API_KEY"
# Batch get user info by IDs
The skill documents sending account identifiers and an authorization token to a third-party endpoint. Because the skill is intended for social intelligence, this transmission may include sensitive relationship or monitoring targets, making third-party handling and retention a meaningful risk.
-H "Authorization: Bearer $AISA_API_KEY"
# Batch get user info by IDs
curl "https://api.aisa.one/apis/v1/twitter/user/batch_info_by_ids?userIds=44196397,123456" \
-H "Authorization: Bearer $AISA_API_KEY"
# Get user's latest tweets
This call externally transmits the requested username and bearer credential. Even for public Twitter data, the query itself can reveal user interests, monitoring targets, or business intelligence activity, so the network egress is a true exposure point.
-H "Authorization: Bearer $AISA_API_KEY"
# Get user's latest tweets
curl "https://api.aisa.one/apis/v1/twitter/user/last_tweets?userName=elonmusk" \
-H "Authorization: Bearer $AISA_API_KEY"
# Get user mentions
The documented API usage sends monitoring requests and credentials to an external service. This is inherent to the skill design, but still expands the trust boundary and could expose sensitive watchlists or operator intent if the service or logs are compromised.
-H "Authorization: Bearer $AISA_API_KEY"
# Get user mentions
curl "https://api.aisa.one/apis/v1/twitter/user/mentions?userName=elonmusk" \
-H "Authorization: Bearer $AISA_API_KEY"
# Get user followers
Requests for followers data are sent to a third-party API along with the API key. That creates a moderate confidentiality risk because relationship analysis and tracked accounts may be sensitive in enterprise or investigative contexts.
-H "Authorization: Bearer $AISA_API_KEY"
# Get user followers
curl "https://api.aisa.one/apis/v1/twitter/user/followers?userName=elonmusk" \
-H "Authorization: Bearer $AISA_API_KEY"
# Get user followings
This endpoint call similarly exports query parameters and authorization material to AIsa. The skill context makes this expected, but not harmless: an agent using it may disclose business-sensitive research patterns to the external provider.
-H "Authorization: Bearer $AISA_API_KEY"
# Get user followings
curl "https://api.aisa.one/apis/v1/twitter/user/followings?userName=elonmusk" \
-H "Authorization: Bearer $AISA_API_KEY"
# Get user verified followers (requires user_id, not userName)
Verified-follower lookups transmit user IDs and API credentials off-platform. The behavior is consistent with the skill's purpose, yet it still constitutes a real external transmission risk because the service can observe who is being analyzed and when.
-H "Authorization: Bearer $AISA_API_KEY"
# Get user verified followers (requires user_id, not userName)
curl "https://api.aisa.one/apis/v1/twitter/user/verifiedFollowers?user_id=44196397" \
-H "Authorization: Bearer $AISA_API_KEY"
# Check follow relationship between two users
Checking follow relationships sends both source and target usernames plus the bearer token to the external API. Those relationship queries can be sensitive intelligence in some contexts, so this is a valid data egress concern rather than a false positive.
-H "Authorization: Bearer $AISA_API_KEY"
# Check follow relationship between two users
curl "https://api.aisa.one/apis/v1/twitter/user/check_follow_relationship?source_user_name=elonmusk&target_user_name=BillGates" \
-H "Authorization: Bearer $AISA_API_KEY"
# Search users by keyword
User-search requests transmit search terms and the API key to a third-party service. Search terms may encode confidential topics, making the external transmission moderately risky despite being necessary for function.
-H "Authorization: Bearer $AISA_API_KEY"
curl "https://api.aisa.one/apis/v1/twitter/user/search?query=AI+researcher"
-H "Authorization: Bearer $AISA_API_KEY"
Advanced tweet-search requests send potentially sensitive search queries and credentials externally. In a social-listening use case, those queries can reveal product strategy, investigations, or reputational concerns, so the egress is security-relevant.
# Advanced tweet search (queryType is required: Latest or Top)
curl "https://api.aisa.one/apis/v1/twitter/tweet/advanced_search?query=AI+agents&queryType=Latest" \
-H "Authorization: Bearer $AISA_API_KEY"
# Search top tweets
Top-search requests have the same exposure pattern: query terms and a bearer token are transmitted to a third-party service. The skill context makes this common, but it still increases confidentiality risk for the operator's research intent.
-H "Authorization: Bearer $AISA_API_KEY"
# Search top tweets
curl "https://api.aisa.one/apis/v1/twitter/tweet/advanced_search?query=AI+agents&queryType=Top" \
-H "Authorization: Bearer $AISA_API_KEY"
# Get tweets by IDs (comma-separated)
Tweet-ID lookups send identifiers and credentials to an external API. Even if tweet content is public, the set of IDs queried can expose what content the operator is investigating or tracking.
-H "Authorization: Bearer $AISA_API_KEY"
# Get tweets by IDs (comma-separated)
curl "https://api.aisa.one/apis/v1/twitter/tweets?tweet_ids=1895096451033985024" \
-H "Authorization: Bearer $AISA_API_KEY"
# Get tweet replies
Reply-thread requests transmit the target tweet ID and authorization token to the third-party provider. This is expected functionality, but still represents a real trust-boundary crossing with potential exposure of analyst interests and secret material.
-H "Authorization: Bearer $AISA_API_KEY"
# Get tweet replies
curl "https://api.aisa.one/apis/v1/twitter/tweet/replies?tweetId=1895096451033985024" \
-H "Authorization: Bearer $AISA_API_KEY"
# Get tweet quotes
Quote-tweet lookups send request metadata and a bearer secret to an external provider. Because the skill is aimed at monitoring and intelligence gathering, these lookups may reveal sensitive internal priorities or investigations.
-H "Authorization: Bearer $AISA_API_KEY"
# Get tweet quotes
curl "https://api.aisa.one/apis/v1/twitter/tweet/quotes?tweetId=1895096451033985024" \
-H "Authorization: Bearer $AISA_API_KEY"
# Get tweet retweeters
Retweeter lookups similarly involve external transmission of identifiers and credentials. The data requested may be public, but the analysis targets and frequency of access can still be sensitive operational metadata.
-H "Authorization: Bearer $AISA_API_KEY"
# Get tweet retweeters
curl "https://api.aisa.one/apis/v1/twitter/tweet/retweeters?tweetId=1895096451033985024" \
-H "Authorization: Bearer $AISA_API_KEY"
# Get tweet thread context (full conversation thread)
Thread-context retrieval sends tweet identifiers and credentials outside the local environment. This widens the trust boundary and can leak what conversations an analyst is examining, which matters in enterprise or investigative settings.
-H "Authorization: Bearer $AISA_API_KEY"
# Get tweet thread context (full conversation thread)
curl "https://api.aisa.one/apis/v1/twitter/tweet/thread_context?tweetId=1895096451033985024" \
-H "Authorization: Bearer $AISA_API_KEY"
# Get article by tweet ID
Article-by-tweet lookups require third-party egress with the bearer token. That is operationally normal here, but it remains a moderate risk because external providers can observe access patterns and any mishandling of secrets would compromise the integration.
-H "Authorization: Bearer $AISA_API_KEY"
curl "https://api.aisa.one/apis/v1/twitter/article?tweet_id=1895096451033985024"
-H "Authorization: Bearer $AISA_API_KEY"