Repository navigation
Conversation
…extraction Upstream decrypted every installed browser's cookie store whenever explicit credentials were missing, and again whenever X rejected them, silently replacing the account the user chose. Credentials now come only from TWITTER_CREDENTIALS_FILE (regular file, owned by the current user, mode 0600, no symlinks) or TWITTER_AUTH_TOKEN/TWITTER_CT0[/TWITTER_COOKIE_STRING]. A rejected cookie is an error, not a trigger to read another one. Cookie values are validated so a credential can never inject header lines. browser-cookie3 and its unique transitive deps are removed from the lock; no other locked version changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YHcAw7Ma7ujCs4gGN7PFx5
Every authenticated request already targets x.com, api.x.com or upload.twitter.com; enforce that as an invariant in _build_headers so a future change (or a crafted URL) cannot send the session cookie anywhere else. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YHcAw7Ma7ujCs4gGN7PFx5
…osing cookies twitter-safe is meant to be the only command an agent can run, via 'sudo -n -u <service-user> twitter-safe ...'. It discards the caller's environment (so no injected token, proxy or PYTHONPATH reaches twitter-cli), reads credentials only from the service account's 0600 credentials file, runs from the service account's home, and uses click's own parser to refuse any option that selects a local path (--output, --input, --image, and any future *_file/*_path option), so the tool cannot be turned into a reader or writer of its own credentials file. An optional proxy/lang comes only from a root-owned site config. twitter-safe-setup stores or removes credentials; it only accepts input from an interactive terminal and never echoes values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YHcAw7Ma7ujCs4gGN7PFx5
… sudoers rule install.sh (Linux and macOS) refuses to run unless its own checkout, the base Python and its stdlib are root-owned and not writable by others, so nothing the agent's account can modify is ever executed as root. It builds the project offline, installs dependencies only as hash-locked wheels, creates the service account with a 0700 home, writes the tw launcher and a visudo-validated sudoers rule that lets the agent user run only twitter-safe as the service user (with timestamp_timeout=0 so a cached sudo password cannot be reused by the agent), then self-tests the whole path. Lock files are generated from uv.lock; tests keep them hashed and in sync. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YHcAw7Ma7ujCs4gGN7PFx5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YHcAw7Ma7ujCs4gGN7PFx5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YHcAw7Ma7ujCs4gGN7PFx5
FORK.md (Chinese) records the upstream base commit, every change, the threat model, install/setup/maintenance/revocation steps, and what was and was not verified. SKILL.md now tells agents to call only /opt/twitter-safe/bin/tw, never to ask for or touch credentials, never to install or upgrade, and to treat fetched content as untrusted. README drops the browser-extraction and 'uv tool install twitter-cli' instructions, which would install upstream from PyPI. AGENTS.md lists the invariants the tests enforce. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YHcAw7Ma7ujCs4gGN7PFx5
…ers: !requiretty A file option that writes somewhere by default would bypass a source-only check, so refuse any file-like parameter that ends up with a value. Agents run without a terminal, so the sudoers rule disables requiretty for twitter-safe (RHEL-family sudo enables it by default). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YHcAw7Ma7ujCs4gGN7PFx5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YHcAw7Ma7ujCs4gGN7PFx5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.