Back to skill

Security audit

Clawhub Publish 146230

Security checks for vulnerabilities and agentic risk

Overview

This skill is for internal image generation, but it asks the agent to run an unreviewed external script that can use local OAuth credentials.

Install only if you trust the environment that provides the external generate.js script and the Google Antigravity OAuth profile. Confirm the script exists from a trusted source, is not writable by untrusted users, and that you want generic image requests routed through this internal credentialed service.

Vulnerability Patterns
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T07 · Tool Hijacking and Spoofing

Error
Location
skill.md:12
Finding
Execution of an Unbundled External Script with OAuth Credential Access## Vulnerability Details **File Location**: `skill.md`, lines 12-28 **Vulnerability Type**: Execution of an unaudited absolute-path tool with access to local OAuth credentials **Risk Level**: High ```markdown Generate high-quality images using the internal Google Antigravity API (Gemini 3 Pro Image). This skill bypasses the need for browser automation by using the `daily-cloudcode-pa.sandbox` endpoint directly with your OAuth credentials. ## Prerequisites - **Google Antigravity OAuth Profile**: Must be present in your OpenClaw auth-profiles.json. - **Node.js**: Available in the environment. - **Security Note**: This skill reads local OAuth tokens from your profile to authenticate with Google's API. This is expected behavior for internal tool use. ## Usage ### Direct Script Execution ```bash /home/ubuntu/clawd/skills/antigravity-image-gen/scripts/generate.js \ --prompt "A futuristic city on Mars" \ --output "/tmp/mars.png" \ --aspect-ratio "16:9" ``` ``` ### Technical Analysis The project contains only `skill.md` and `_meta.json`; the referenced `scripts/generate.js` implementation is not included in the audited package. The instructions therefore transfer execution to an absolute-path program outside the reviewed project boundary. The external program is expected to read OAuth tokens from `auth-profiles.json` and communicate with an API. Because its implementation is absent, the audit cannot verify its API destination validation, token handling, output-path handling, logging behavior, or resistance to command and argument injection. The reviewed skill content also provides no integrity check, fixed digest, ownership requirement, or permission check for the external executable. If an attacker can create or replace the file at the documented absolute path, legitimate-looking image-generation requests would execute attacker-controlled logic. This is a tool-hijacking risk because the trusted skill acts as ...[truncated 2153 chars]
Remediation
## Remediation Suggestions 1. Include `scripts/generate.js` inside the published skill package so its implementation can be reviewed together with the instructions. 2. Invoke the script through a package-relative, canonically resolved path rather than a hard-coded path outside the audited artifact. 3. Verify the script's integrity before execution using a trusted package signature or pinned cryptographic digest. 4. Ensure the script and all parent directories are owned by a trusted account and are not writable by untrusted users or unrelated processes. 5. Grant access only to the specific OAuth profile required for image generation; do not expose the complete credential store when a scoped token can be supplied. 6. Use OAuth scopes limited to the minimum API permissions necessary, with short token lifetimes and straightforward revocation. 7. Prevent tokens from appearing in command-line arguments, standard output, error messages, generated files, or diagnostic logs. 8. Pin and validate the expected API origin, enforce TLS certificate verification, and reject redirects to untrusted origins. 9. Validate all prompt, aspect-ratio, and output-path inputs in the bundled implementation. Restrict output to approved directories and avoid shell-based command construction. 10. Run image generation in a sandbox with restricted filesystem, network, and process permissions. 11. Add automated packaging checks that fail publication when documentation references executable files absent from the released artifact.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (2)

Vague Triggers

Medium
Confidence
95% confidence
Finding
The activation conditions are very broad and will trigger on common image-related requests, which can cause the skill to be invoked unexpectedly. In this skill, unintended invocation is more sensitive because the skill uses local OAuth credentials and an internal API, so accidental routing can expose privileged tooling use beyond what is necessary for a given request.

Natural-Language Policy Violations

Low
Confidence
61% confidence
Finding
The file repeatedly directs use of an internal Google Antigravity API and Google-specific OAuth credentials as the required path, but does not present this as an optional or context-limited choice. If organizational policy requires avoiding forced vendor-specific handling without opt-in, this wording may violate that expectation.

Static analysis

No suspicious patterns detected.