T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:26- Finding
Undeclared Access to a User-Level OAuth Credential Store
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 26-39
Vulnerability Type: Credential access beyond the declared environment-based authorization boundary
Risk Level: MediumVulnerable Code Snippet
markdown This script uses the `redditech` OAuth2 credentials from `~/.xurl` to: 1. Post tweet [1/N] — get back the tweet ID 2. Post tweet [2/N] as `reply: { in_reply_to_tweet_id: <id> }` — get tweet 2's ID 3. Continue through the queue until all N tweets are posted 4. Log all tweet IDs + URLs to `memory/thread-log.jsonl` **This is the ONLY way to schedule real X threads.** Always use this script over Buffer for multi-tweet content. --- ## Scriptscripts/tweet_thread_scheduler.py
text Auth: `~/.xurl` → `apps.redditech.users.redditech.access_token` (auto-refreshes on 401)The skill metadata separately declares
TWITTER_ACCESS_TOKENas its required credential:yaml primaryEnv: TWITTER_ACCESS_TOKEN requires: bins: - python3 env: - TWITTER_ACCESS_TOKENTechnical Analysis
The declared authorization model requires the
TWITTER_ACCESS_TOKENenvironment variable, but the operational instructions direct the agent to read~/.xurland extractapps.redditech.users.redditech.access_token. This user-level file may contain credentials belonging to an existing account and is outside the credential source declared in the skill metadata.Accessing an ambient credential store violates least privilege because installing or invoking the skill could grant it access to credentials that the user did not explicitly provide for that invocation. The documented automatic token refresh on HTTP 401 may also require access to additional OAuth material or authorization capabilities, although the exact behavior cannot be verified because
scripts/tweet_thread_scheduler.pyis absent from the audited project.The finding is limited to the documented credential-acce ...[truncated 1611 chars]
- Remediation
View remediation
Remediation Suggestions
- Make
TWITTER_ACCESS_TOKENthe exclusive default credential source and remove implicit access to~/.xurl. - If file-based authentication is required, declare the exact file access in the skill metadata and require explicit, informed user consent before reading it.
- Avoid hardcoding an account-specific path such as
apps.redditech.users.redditech.access_token; require the user to select and confirm the intended account. - Validate the authenticated account identity before posting and display that identity in the final confirmation prompt.
- Implement token refresh only when explicitly enabled. Document which refresh credentials are read, where renewed tokens are stored, and what file permissions are required.
- Enforce restrictive credential-file permissions and never write tokens to queue files, logs, command output, or error messages.
- Include
scripts/tweet_thread_scheduler.pyin the reviewable package so its credential handling, refresh logic, API destinations, logging, and error paths can be audited. - Fail closed when
TWITTER_ACCESS_TOKENis absent rather than silently falling back to ambient credentials.
- Make
