Back to skill

Security audit

Headless OAuth

Security checks for vulnerabilities and agentic risk

Overview

The skill is purpose-aligned for headless OAuth, but it under-specifies safe handling of sensitive callback URLs and tells agents to relay user-supplied OAuth URLs with curl.

Install only if you are comfortable with an agent assisting OAuth login. Treat copied callback URLs as sensitive, because they may contain authorization codes. Before using the manual callback relay, verify the URL is the expected localhost callback host, port, and path from the active OAuth command, and prefer pinned installer versions over @latest.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:119
Finding
Unvalidated OAuth Callback URL Forwarded Through a Shell Command<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 119-127 **Vulnerability Type**: Command injection and unintended loopback request **Risk Level**: High ### Vulnerable Code ```markdown 4. The user sends back something like: `http://127.0.0.1:PORT/callback?code=...&state=...` 5. Forward it to the waiting server with curl: ```bash curl -s "http://127.0.0.1:PORT/callback?code=...&state=..." ``` 6. The tool receives the code, exchanges it for a token, and completes authorization. ``` ### Technical Analysis The skill instructs the agent to receive an OAuth callback URL from the user and forward it using `curl`. It does not require the agent to validate the URL against the callback endpoint generated by the active OAuth process. If the agent constructs a shell command by directly interpolating the supplied URL, shell metacharacters—particularly an embedded double quote followed by shell syntax—could terminate the quoted argument and inject another command. Quoting the complete URL is not sufficient if untrusted input can itself contain quote characters. Even where the tool invocation does not use a shell, accepting an arbitrary URL without verifying its scheme, host, port, and path could allow requests to unrelated services listening on the server's loopback interface. The instructions also do not require validation of the OAuth `state` value before relaying the callback. ### Attack Path 1. The agent starts an OAuth CLI that waits on a loopback callback endpoint. 2. The agent asks the user to return the failed redirect URL. 3. An attacker or untrusted user supplies a crafted URL containing shell syntax, or a URL targeting a different loopback service. 4. The agent substitutes the supplied string into the documented `curl` command. 5. If the command is evaluated by a shell, injected syntax can execute with the privileges of the agent process. Otherwise, `curl` may send a request to an unintended local service. 6. The injected c ...[truncated 785 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Parse the callback as a URL rather than treating it as an opaque shell string. 2. Compare it with callback data recorded from the active OAuth process: - Require the `http` scheme unless the tool explicitly uses another expected scheme. - Allow only an exact loopback hostname such as `127.0.0.1` or `localhost`. - Require the exact callback port and path printed or opened by the active CLI. - Reject embedded credentials, fragments, malformed encoding, control characters, and unexpected parameters. 3. Verify that the returned OAuth `state` exactly matches the state associated with the active authorization attempt. 4. Invoke `curl` through a structured argument array without a shell. Do not concatenate user-controlled input into a command string. 5. Prefer extracting validated `code` and `state` values and reconstructing the callback URL from trusted endpoint components. 6. Display the parsed destination to the user and require confirmation if it differs from the callback endpoint expected by the active process. 7. Add explicit instructions never to forward callbacks to arbitrary loopback ports or paths. ]]>

T08 · Insecure Dependencies

Warning
Location
README.md:50
Finding
Mutable Third-Party Package Executed During Installation<![CDATA[ ## Vulnerability Details **File Location**: `README.md`, lines 50-52 **Vulnerability Type**: Unpinned executable dependency **Risk Level**: Medium ### Vulnerable Code ```bash npx clawhub@latest install headless-oauth ``` ### Technical Analysis The documented installation command directs `npx` to resolve and execute the mutable `latest` release of the third-party `clawhub` package. The effective installer code can therefore change after this skill has been audited. Depending on local npm configuration and cache state, `npx` may retrieve the package from a remote registry and execute its package entry point. No exact version, integrity digest, lockfile, pinned source commit, or publisher verification procedure is provided. This creates a supply-chain trust boundary: compromise of the package publisher, registry account, release process, or resolved package version could cause users to execute code that was not included in this audit. ### Attack Path 1. An attacker compromises the `clawhub` package publisher, its release infrastructure, or the relevant package distribution channel. 2. The attacker publishes a malicious release and causes the `latest` tag to resolve to it. 3. A user follows the README and runs `npx clawhub@latest install headless-oauth`. 4. `npx` downloads and executes the changed package. 5. The malicious installer runs with the privileges of the invoking user and can access resources available to that account. ### Impact Assessment A malicious installer could execute arbitrary code as the user running the installation command. Depending on that user's privileges, this may expose project files, shell configuration, environment variables, credentials, SSH material, agent workspaces, and other user-accessible data. If the command is run by an administrator or in a privileged CI environment, the potential impact increases accordingly. The repository itself does not contain the remote package payload, so exploitation depends on com ...[truncated 65 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace `@latest` with an exact, reviewed package version. 2. Document the expected registry, package owner, and publisher identity. 3. Where supported, verify the package integrity digest, registry signature, or provenance attestation before execution. 4. Prefer installation through a lockfile or another mechanism that records the exact dependency version and integrity value. 5. Provide a manual installation option pinned to a specific reviewed source commit or release archive checksum. 6. Recommend running the installer as an unprivileged user and reviewing package metadata and lifecycle scripts before execution. 7. Establish a documented update process in which new installer versions are reviewed before the pinned version is changed. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (8)

Credential Access

High
Category
Privilege Escalation
Content
## Keyring Note

Some CLIs store tokens in a system keyring that requires an interactive terminal to unlock.
Check the CLI's documentation for a non-interactive option. Set any required credential
only for the duration of the auth step — do not persist it in shell configs.
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
## Keyring Note

Some CLIs store tokens in a system keyring that requires an interactive terminal to unlock.
Check the CLI's documentation for a non-interactive option. Set any required credential
only for the duration of the auth step — do not persist it in shell configs.
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
## Keyring Note

Some CLIs store tokens in a system keyring that requires an interactive terminal to unlock.
Check the CLI's documentation for a non-interactive option. Set any required credential
only for the duration of the auth step — do not persist it in shell configs.
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
## Keyring Note

Some CLIs store tokens in a system keyring that requires an interactive terminal to unlock.
Check the CLI's documentation for a non-interactive option. Set any required credential
only for the duration of the auth step — do not persist it in shell configs.
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
| Error | Fix |
|-------|-----|
| `redirect_uri_mismatch` | Use **Desktop app** OAuth client, not Web application |
| Keyring unlock fails | Check CLI docs for a non-interactive keyring option |
| `Access blocked` | Add your email as test user in Google consent screen |
| Commands fail silently | Check CLI docs for a required account identifier option |
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The manual callback relay pattern tells the user to send the full redirect URL, which can contain sensitive OAuth artifacts such as authorization codes, state values, and other query parameters. Having the user paste that full URL into the chat or agent context increases the chance of token leakage through logs, transcripts, or downstream tooling, especially in environments where conversations are retained.

Vague Triggers

Low
Confidence
81% confidence
Finding
This is a markdown file, so vague-trigger review applies. The description frames the skill as applicable to 'any OAuth CLI' and 'use when a CLI tool requires OAuth login,' which is broad and does not define clear boundaries or negative examples for when the skill should not be invoked.

Static analysis

No suspicious patterns detected.