T09 · Insecure Skill Coding Practices
- Location
scripts/research.py:151- Finding
X Session Credentials Exposed Through Process Arguments
- Content
View full analysis
Vulnerability Details
File Location:
scripts/research.py, lines 21–22 and 151–156
Vulnerability Type: Sensitive credentials exposed through command-line arguments
Risk Level: MediumVulnerable Code:
python AUTH_TOKEN = os.environ.get("AUTH_TOKEN", "") CT0 = os.environ.get("CT0", "")python cmd = [ "bird", "search", f"{topic}", "-n", str(limit), "--auth-token", AUTH_TOKEN, "--ct0", CT0, "--plain" ]Technical Analysis
The Skill reads the X authentication cookies
AUTH_TOKENandCT0from environment variables, then embeds their values directly into the argument vector used to launch thebirdsubprocess.Although
subprocess.run()is invoked without a shell and therefore does not create a command-injection issue here, placing secrets in process arguments creates a separate credential-disclosure risk. Depending on the host operating system, process isolation, and observability configuration, command arguments may be exposed through process inspection interfaces, privileged monitoring agents, audit records, diagnostic tooling, exception reports, or application telemetry.These values represent authenticated X session credentials rather than low-sensitivity configuration. Their disclosure may allow an attacker to impersonate the affected user within the permissions and lifetime of that session.
The use of X credentials is relevant to the declared X search functionality, but exposing them through process arguments exceeds the minimum disclosure necessary to perform that function.
Attack Path
- A user configures valid
AUTH_TOKENandCT0environment variables to enable X search. - The Skill invokes
bird searchand places both credential values in its subprocess arguments. - A local user, privileged process monitor, audit collector, or diagnostic service observes or records the child process command line while it executes.
- The observer ...[truncated 903 chars]
- A user configures valid
- Remediation
View remediation
Remediation Suggestions
- Do not place authentication tokens, cookies, API keys, or other secrets in subprocess command-line arguments.
- Use a credential-input mechanism supported by
bird, such as protected standard input, a dedicated inherited file descriptor, or integration with an operating-system credential store. - If
birdonly supports environment-based authentication, pass a minimal child-specific environment and document that environment variables may still be observable by sufficiently privileged local processes. - If a configuration file is unavoidable, create it with owner-only permissions, avoid shared temporary directories, pass only its path to the subprocess, and securely remove it immediately after execution.
- Ensure command arguments and environments are excluded from telemetry, debug logs, crash reports, and audit output where operationally possible.
- Minimize session scope and lifetime, rotate potentially exposed cookies, and advise users to revoke X sessions if process arguments may have been captured.
- Prefer delegated, narrowly scoped authentication over reusable browser session cookies when the external service and client support it.
