T05 · Unauthorized Access and Privilege Escalation
- Location
main.py:378- Finding
Unauthenticated API Permits Full Control of the Authenticated X Account
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a real X/Twitter automation server, but it exposes powerful account actions through an unauthenticated local API and stores account secrets in local files.
Review before installing. Only run this on a trusted machine, keep it bound to localhost, do not expose the port, and treat config.json and cookies.json like account passwords. Prefer adding API authentication, explicit confirmations for every account-changing action, media path restrictions, stricter secret-file permissions, and pinned dependencies before using it with a real X account.
main.py:378Unauthenticated API Permits Full Control of the Authenticated X Account
main.py:378Caller-Controlled Media Paths Permit Access to Arbitrary Local Files
rate_limiter.py:22Non-Atomic and Non-Persistent Rate Limiting Can Be Bypassed
main.py:242Long-Lived X Credentials and Session Cookies Are Stored in Plaintext Files
requirements.txt:1Unbounded Dependency Constraints Make Installations Non-Reproducible
The declared purpose understates the full action surface: the skill can send DMs, read notifications, follow/unfollow, delete tweets, schedule posts, and query trends beyond the headline description. This mismatch is dangerous because users or orchestrators may invoke the skill under a narrower trust assumption while it actually has broader, account-affecting and privacy-impacting capabilities.
The documentation claims 'Local API on localhost (no external access)' even though the service authenticates to and performs outbound operations against X/Twitter. This is misleading about network behavior and data egress, which can cause operators or users to expose credentials, messages, and account actions under false assumptions about isolation.
Package name closely resembles a popular package, suggesting possible typosquatting. Attackers publish malicious packages with similar names to trick developers into installing them.
The skill advertises network and file-related behavior but does not declare an explicit tool scope or permission boundary. In an agent environment, this can cause overbroad invocation and make sensitive actions like account operations, cookie/config access, or outbound social-media actions occur without clear authorization constraints.
The invocation text is broad enough to match many common social-media requests, which can cause the skill to activate in situations where the user did not intend real account actions. In a high-privilege account-management skill, loose activation boundaries increase the risk of unintended posting, liking, follows, DMs, or deletion operations.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl -X POST http://localhost:19816/tweet \
-H "Content-Type: application/json" \
-d '{"text": "Hello from OpenClaw!"}'
The documentation presents the skill as tweet/account management but also exposes messaging, relationship management, scheduling, and notification-reading features. Hidden or underemphasized capabilities increase the chance of misuse, accidental invocation, or approval of actions the user did not realize were in scope.
The skill exposes destructive and account-affecting operations such as delete, DM, follow/unfollow, retweet, and scheduling without prominently warning that these actions can change account state or affect third parties. In an agent setting, lack of warning materially increases the chance of accidental harmful actions and weakens informed consent.
The config sets a fixed language value of "en-US", which is a natural-language locale constraint. In this file there is no indication that users can opt into a different language or that the English-only setting is required for a region-specific or compliance reason.
This code performs outbound HTTP requests and manages session cookies, which can transmit user or system data, but the only disclosure is an internal log message about initialization. There is no confirmation prompt, user-facing print/log, or comment/docstring warning users that requests and associated cookies will be sent over the network.
The skill metadata says it should be used for tweeting, search, timeline, and account management, but the implementation also exposes direct-message sending. Undisclosed DM capability is security-relevant because it enables transmission of private content to an external platform under the user's authenticated account, which changes the trust boundary and can surprise downstream systems or users relying on the manifest.
The DM endpoint sends arbitrary text to another user over X/Twitter without any user-facing warning that private content is being transmitted to an external service. In this skill context, that is especially sensitive because DMs are perceived as private communications and may contain confidential information or be triggered by an agent on the user's behalf.
The code implements follow/unfollow actions that are not specifically disclosed in the manifest. These are account-management operations with reputational and behavioral impact, and undisclosed support for them can cause users or orchestrators to grant broader trust than intended.
The security note at L205 asserts 'No telemetry, no external callbacks,' but the entire skill's purpose is to relay actions and data to Twitter/X through a local server that wraps twikit. While this may mean no vendor telemetry beyond intended Twitter/X traffic, the statement as written contradicts the actual behavior and could mislead users about network side effects.
The client language is taken from configuration with a default of en-US, causing the skill to operate in a specific locale when the user has not explicitly chosen one. This can violate language/locale policy because the default is imposed rather than selected through user opt-in or clearly justified as region-specific.
The API supports scheduled tweeting but the manifest does not mention delayed posting. Hidden scheduling is risky because it allows actions to occur after the original interaction context has ended, increasing the chance of unintended or hard-to-audit account activity.
Notifications retrieval is implemented but omitted from the manifest. While lower impact than active posting, it still expands access to potentially sensitive account data and weakens informed consent about what the skill can read.
The dependency specification for twikit uses a lower-bound only constraint, which allows future unreviewed versions to be installed. This weakens build reproducibility and can unintentionally pull in compromised or breaking releases through the package supply chain.
twikit>=2.3.1
fastapi>=0.109.0
uvicorn>=0.27.0
pydantic>=2.0.0
The FastAPI dependency is not pinned to an exact version, so installations may resolve to different releases over time. In a network-facing API skill, this increases exposure to newly introduced bugs or vulnerable versions and makes security posture hard to verify.
twikit>=2.3.1
fastapi>=0.109.0
uvicorn>=0.27.0
pydantic>=2.0.0
FastAPI has known advisories, and because the manifest does not pin an exact version, it is impossible to verify whether the deployed package is affected. In a skill exposing a local API server, this uncertainty matters because framework vulnerabilities can affect request handling and trust boundaries.
The uvicorn dependency is specified with a minimum version only, allowing uncontrolled upgrades during installation. Because uvicorn is the HTTP server for the local API, an unexpected vulnerable or incompatible release could directly affect the service boundary.
twikit>=2.3.1
fastapi>=0.109.0
uvicorn>=0.27.0
pydantic>=2.0.0
Uvicorn has published security advisories, but the current requirement does not identify the exact installed version. This prevents reliable assessment of whether the local HTTP server may be exposed to known issues such as log or protocol handling flaws.
The pydantic dependency is unpinned, which permits different environments to install different versions. Since pydantic typically handles input validation and parsing, an unexpected version may introduce parsing flaws, denial-of-service conditions, or behavior changes.
twikit>=2.3.1
fastapi>=0.109.0
uvicorn>=0.27.0
pydantic>=2.0.0
Pydantic has known advisories, and an unpinned requirement means a vulnerable version could be installed without visibility. Because it is commonly used for request validation, a vulnerable release could enable denial of service or unsafe parsing behavior in the API stack.
No suspicious patterns detected.