Back to skill

Security audit

GA4 Connector

Security checks for vulnerabilities and agentic risk

Overview

This GA4 connector mostly matches its purpose, but its installer has a real command-execution flaw and stores OAuth credentials persistently without permission hardening.

Review before installing. Only run the installer with a numeric GA4 property ID you control, inspect or patch the heredoc bug first, and store ~/.config/openclaw/ga4-client.json and ga4-token.json with restrictive permissions. Prefer a virtual environment or pinned dependencies, and avoid running this on shared machines until the installer is hardened.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/install_ga4_openclaw.sh:27
Finding

Arbitrary Code Execution Through Property ID Injection

Content
View full analysis
" client.json ``` 3. The installer interpolates the malicious value into the Python heredoc. 4. The value terminates the intended Python string and inserts an attacker-controlled Python statement. 5. Python executes the injected comm ...[truncated 698 chars]
Remediation
View remediation
&2 exit 1 fi ``` 2. Use a quoted heredoc so that Bash does not expand its contents. 3. Pass values to Python through environment variables or command-line arguments instead of constructing Python source dynamically: ```bash PROPERTY_ID="$PROPERTY_ID" SHELL_RC="$SHELL_RC" python3 - <<'PY' import os import re from pathlib import Path property_id = os.environ["PROPERTY_ID"] rc = Path(os.environ["SHELL_RC"]) text = rc.read_text() if rc.exists() else "" text = re.sub(r"^export GA4_PROPERTY_ID=.*\n?", "", text, flags=re.M) if text and not text.endswith("\n"): text += "\n" text += f'export GA4_PROPERTY_ID="{property_id}"\n' rc.write_text(text) print(f"Updated {rc}") PY ``` 4. Add automated tests using values containing quotes, newlines, semicolons, command substitutions, and Python expressions to verify that malformed identifiers are rejected. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/ga4_query.py:43
Finding

OAuth Credential Files Are Created Without Enforced Restrictive Permissions

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/install_ga4_openclaw.sh:18
Finding

Runtime Installation of Unpinned Dependencies From the Active Package Index

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (7)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill describes actions that require filesystem access, environment modification, and networked OAuth/API usage, but it does not declare any explicit tool scope or allowed-tools boundaries. That mismatch can cause an agent to operate with broader-than-expected capabilities, reducing policy enforcement and making accidental credential handling or unsafe command execution more likely in a security-sensitive OAuth setup flow.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill instructs users to copy an OAuth client secret into a local config path and create a persistent token file, but it does not warn that these files are sensitive authentication material or advise on permissions, storage hygiene, and rotation. If those files are left world-readable, synced to shared storage, or committed to source control, an attacker or other local user could reuse them to access GA4 data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script persists OAuth credentials to a local token cache file without any disclosure, consent prompt, or file-permission hardening. Cached GA4 OAuth tokens can grant continued access to analytics data, so if the host is shared, backed up broadly, or the config directory is readable by other users/processes, the token may be reused to access internal analytics data without re-authentication.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/install_ga4_openclaw.sh (reported line 12)May include surrounding context.

sh
PROPERTY_ID="$1"
CLIENT_JSON="$2"
CONFIG_DIR="$HOME/.config/openclaw"
mkdir -p "$CONFIG_DIR"

if [[ ! -f "$CLIENT_JSON" ]]; then
  echo "Client secret JSON not found: $CLIENT_JSON"

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The installer performs persistent system changes beyond transient GA4 querying: it copies OAuth client material into a config directory and edits the user's shell startup file. While this is likely for convenience rather than abuse, persistence of credentials and environment changes increases the attack surface and can surprise users, especially in an agent skill context where install scripts may be run with limited review.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script copies the client secret JSON into a persistent user config directory without warning, consent, or permission hardening. Even if this is standard for OAuth setup, storing credential material on disk can expose sensitive client configuration to other local processes, backups, or accidental disclosure if file permissions are too broad.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The installer silently edits the user's shell startup file to persist an environment variable. Although the value is only a GA4 property ID and not a secret, modifying login shell configuration without confirmation is risky because it creates hidden persistence, may break user environments, and establishes a pattern of unexpected profile modification in a skill installer.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.