T09 · Insecure Skill Coding Practices
- Location
scripts/twitter_oauth_client.py:334- Finding
AISA API Key Exposed in Command Output
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill’s Twitter/X posting and engagement purpose is mostly disclosed, but it exposes the AIsa API key in command output and allows media uploads from arbitrary readable local paths.
Install only if you are comfortable giving this skill an AIsa API key that can drive Twitter/X account actions. Avoid using it in environments where command output is logged until the raw API-key output is fixed, and only pass media files you intentionally selected from a safe workspace path.
scripts/twitter_oauth_client.py:334AISA API Key Exposed in Command Output
scripts/twitter_oauth_client.py:78API Key Redundantly Transmitted in Both Authorization Headers and Request Bodies
scripts/twitter_oauth_client.py:412Media Upload Can Read Arbitrary Local Paths Without Workspace or Size Restrictions
If the implementation performs media upload and threaded posting while the skill description emphasizes reads, likes, follows, replies, and approved posting, the mismatch can conceal higher-risk content transmission and publication behavior. In a social-media skill, undocumented posting or upload features are materially more dangerous because they can expose local files or publish content under the user's identity.
If the implementation performs media upload and threaded posting while the skill description emphasizes reads, likes, follows, replies, and approved posting, the mismatch can conceal higher-risk content transmission and publication behavior. In a social-media skill, undocumented posting or upload features are materially more dangerous because they can expose local files or publish content under the user's identity.
If the implementation performs media upload and threaded posting while the skill description emphasizes reads, likes, follows, replies, and approved posting, the mismatch can conceal higher-risk content transmission and publication behavior. In a social-media skill, undocumented posting or upload features are materially more dangerous because they can expose local files or publish content under the user's identity.
The script prints the raw AIsa API key in multiple command outputs, including status, authorize, and publish results. This unnecessarily exposes a bearer credential to terminals, logs, shell history capture, CI output, or calling tools, enabling unauthorized use of the AIsa account if observed or collected.
The README advertises likes, follows, replies, and OAuth-gated posting but does not warn that the skill can perform account-affecting actions or transmit user-authorized data to an external platform. In an agent setting, missing disclosure increases the risk of unintended social actions, reputation damage, or accidental use of privileged credentials because operators may treat the skill as informational rather than action-capable.
The skill declares access to an API key and directs use of network-capable scripts, but it does not define an explicit tool scope such as allowed-tools or permissions. In an agent environment, that omission weakens least-privilege controls and can allow broader-than-expected execution or data egress paths during use of the skill.
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
When the user asks to like, unlike, follow, or unfollow on X/Twitter:
1. Do not ask the user to manually paste tweet links or IDs.
2. If the user first asked to query tweets, keep the returned `tweets[]` structure in the current agent context.
3. Map ordinal follow-up requests to remembered tweet or author context.
4. If multiple user candidates match a natural-language name, stop and ask the user to confirm the account.
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
When the user asks to like, unlike, follow, or unfollow on X/Twitter:
1. Do not ask the user to manually paste tweet links or IDs.
2. If the user first asked to query tweets, keep the returned `tweets[]` structure in the current agent context.
3. Map ordinal follow-up requests to remembered tweet or author context.
4. If multiple user candidates match a natural-language name, stop and ask the user to confirm the account.
The module docstring and CLI both present this file as supporting only read APIs, and every exposed command maps to GET-based retrieval endpoints. That behavior falls short of the manifest's claimed scope of engagement actions and OAuth-gated posting, creating a semantic mismatch between the skill's stated behavior and the actual code in this file.
The CLI directly performs state-changing social actions (follow/unfollow/like/unlike) as soon as the corresponding command is invoked, with no explicit confirmation gate, dry-run mode, or user re-authorization step in this file. In an agentic context, that increases the risk of unintended or prompt-manipulated actions being executed against the wrong account or tweet, especially because the skill is specifically designed to operationalize engagement workflows.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
DEFAULT_TIMEOUT = 30
DEFAULT_BASE_URL = "https://api.aisa.one/apis/v1"
DEFAULT_CHROME_USER_AGENT = (
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
"AppleWebKit/537.36 (KHTML, like Gecko) "
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
DEFAULT_TIMEOUT = 30
DEFAULT_BASE_URL = "https://api.aisa.one/apis/v1"
DEFAULT_CHROME_USER_AGENT = (
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
"AppleWebKit/537.36 (KHTML, like Gecko) "
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
DEFAULT_TIMEOUT = 30
DEFAULT_BASE_URL = "https://api.aisa.one/apis/v1"
DEFAULT_CHROME_USER_AGENT = (
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
"AppleWebKit/537.36 (KHTML, like Gecko) "
The manifest describes read context, engagement actions, and approved posting through AIsa, but does not mention local filesystem access. This file implements arbitrary path resolution and file reading for --media-file, which adds a local data access capability not clearly justified by the declared purpose as written.
The post command sends tweet text, media IDs, and uploaded media files to the remote AIsa service via HTTP requests, but the execution path only prints results after submission and does not provide a confirmation prompt or explicit runtime disclosure before transmitting user data. Although the CLI help says it publishes through the AIsa service, this code path lacks a direct user warning at the point of action for potentially privacy-impacting network transfer.
The inline documentation actively characterizes the client as read-only, while the broader skill description says it performs likes, follows, replies, and OAuth-gated posting. This is not just incomplete documentation in this file; it directly frames the implementation as read-only, contradicting the advertised engagement intent for the skill.
This code sends usernames, tweet IDs, search queries, and similar inputs to https://api.aisa.one via network requests, but the CLI provides no runtime notice that user-provided data is being transmitted to a third-party service. Although the module docstring mentions read APIs and bearer authentication, it does not clearly warn users about external data transmission or privacy implications when invoking commands.
The module docstring advertises authorize [--callback-url <url>] [--open-browser], implying a browser-assisted local authorization flow. In implementation, --callback-url does not exist at all, and --open-browser only prints that browser auto-open is disabled rather than opening anything, which directly contradicts the documented behavior.
The configuration loader requires AISA_API_KEY from the environment, and later request builders place it into the Authorization header and request payload. There is no user-facing disclosure in the code flow that the script will consume this credential and send it to the configured remote service.