Back to skill

Security audit

Google-analytics-GA4

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Google Analytics reporting skill, with ordinary credential and data-sharing precautions needed.

Install only if you are comfortable granting this skill read access to the selected GA4 property. Use a dedicated service account with the minimum Viewer role, keep the JSON key out of shared folders and repositories, rotate it if exposed, and set DingTalk webhook variables only for channels approved to receive analytics reports.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (8)

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The quick reference instructs users to save a Google Analytics service-account JSON key locally as `ga-credentials.json` but provides no warning that this file is a long-lived secret that must be protected and excluded from source control. In a skill/repository context, users often copy setup steps verbatim, so omission of handling guidance increases the chance of credential leakage through commits, shared folders, or insecure local storage.

Missing User Warnings

Low
Confidence
88% confidence
Finding
The script prints the full credential file path to stdout, which can disclose sensitive local filesystem layout in logs, CI output, or shared terminals. While this does not expose the credential contents, path disclosure can aid follow-on attacks and unnecessarily reveals where secrets are stored.

Missing User Warnings

Medium
Confidence
84% confidence
Finding
The script can send a full analytics report, including traffic-source performance data, to an external DingTalk webhook without an explicit interactive warning or consent at send time. In an agent-skill context, silent external transmission of business analytics increases the chance of unintended data disclosure through misconfiguration or operator misunderstanding.

Credential Access

High
Category
Privilege Escalation
Content
if credentials:
        cmd.extend(["--credentials", credentials])
    else:
        default_creds = os.path.join(SCRIPT_DIR, "ga-credentials.json")
        if os.path.exists(default_creds):
            cmd.extend(["--credentials", default_creds])
Confidence
88% confidence
Finding
The wrapper automatically uses a default credential file from the script directory if one exists. In an agent-skill context, bundling or implicitly loading service account credentials can expose privileged access to Google Analytics data without explicit operator intent, and it increases the chance that secrets are stored insecurely alongside code.

Credential Access

High
Category
Privilege Escalation
Content
if os.path.exists(local_creds):
        print(f"Local key found: {local_creds}")
    else:
        print(f"No local ga-credentials.json at {local_creds}")

    if not env_creds and not os.path.exists(local_creds):
        print("\nNo credentials found.")
Confidence
82% confidence
Finding
The script prints the exact local path where a credential file is absent or present, disclosing secret storage conventions and filesystem structure. In shared logs or multi-user environments, this can provide reconnaissance value even though it does not expose the credential material itself.

Unpinned Dependencies

Low
Category
Supply Chain
Content
# Google Analytics Data API
google-analytics-data>=0.19.0

# Google Auth (pulled in transitively)
google-auth>=2.0.0
Confidence
91% confidence
Finding
The dependency is specified with only a lower bound, which allows future major or minor releases to be installed without review. This creates supply-chain and stability risk because a later release could introduce breaking changes or a vulnerable version into the environment.

Unpinned Dependencies

Low
Category
Supply Chain
Content
google-analytics-data>=0.19.0

# Google Auth (pulled in transitively)
google-auth>=2.0.0

# Optional: DingTalk outbound webhook in traffic_source_report.py
requests>=2.28.0
Confidence
89% confidence
Finding
`google-auth` is also unpinned, so builds are not reproducible and may silently consume newer releases that have not been security reviewed in this skill. While not an immediate exploit by itself, it increases supply-chain exposure and complicates incident response.

Unpinned Dependencies

Low
Category
Supply Chain
Content
google-auth>=2.0.0

# Optional: DingTalk outbound webhook in traffic_source_report.py
requests>=2.28.0
Confidence
95% confidence
Finding
The `requests` dependency is unpinned, which is more concerning here because it is used for outbound webhook functionality. An unconstrained install may resolve to versions with known security issues or unexpected behavior, increasing both supply-chain and runtime risk.

Static analysis

No suspicious patterns detected.