Back to skill

Security audit

google analytics and search improve

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly a coherent website analytics and audit helper, but its site-audit scripts can be steered into requesting internal network URLs through user-supplied URLs, sitemaps, or redirects.

Install only if you are comfortable with a review-level risk: use it on sites you control or trust, avoid auditing untrusted sitemaps, keep analytics credentials read-only, restrict permissions on .skills-data, and remove or rotate keys when finished. The skill should add URL validation before it is used in environments with access to private networks or cloud metadata services.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
.
Finding

Unrestricted Website Audit Requests Enable Server-Side Request Forgery

Content
View full analysis
requests.Response: return requests.get( url, headers={"User-Agent": USER_AGENT, "Accept-Encoding": "gzip, br"}, timeout=REQUEST_TIMEOUT, allow_redirects=True, ) def safe_fetch(url: str) -> requests.Response | None: try: return fetch(url) except Exception as exc: print(f" ⚠️ Failed to fetch {url}: {exc}", file=sys.stderr) return None def extract_sitemap_urls(sitemap_url: str) -> list[str]: resp = safe_fetch(sitemap_url) if not resp or resp.status_code != 200: return [] content = resp.text urls = [] if "\s*(.*?)\s*', content) for sub_url in sub_sitemaps: sub_resp = safe_fetch(sub_url) if sub_resp and sub_resp.status_code == 200: urls.extend(re.findall(r'\s*(.*?)\s*', sub_resp.text)) else: urls = re.findall(r'\s*(.*?)\s*', content) return urls ``` #### `scripts/seo_audit.py:52-59` ```python def fetch(url: str, *, follow_redirects: bool = True) -> requests.Response: """Fetch a URL with standard headers.""" return requests.get( url, headers={"User-Agent": USER_AGENT, "Accept-Encoding": "gzip, br"}, timeout=REQUEST_TIMEOUT, allow_redirects=follow_redirects, ) ``` #### `scripts/seo_audit.py:215- ...[truncated 6593 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (47)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The description promises a higher-level website analysis and optimization workflow centered on GA4/GSC and live-site auditing. The actual code only performs data extraction from Bing Webmaster Tools via specific API endpoints (query stats, page stats, rank/traffic, keyword, links, crawl stats/issues). It contains no logic for goal discovery, journey analysis, behavioral validation, site auditing, diagnosis, or roadmap generation. This is a material mismatch in both primary purpose and accessed resources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The description promises a comprehensive analysis workflow spanning website goals, user journeys, GA4 and GSC data analysis, live-site auditing, validation of intended behavior, and generation of improvement recommendations. The code does not implement any of that broader workflow. It only authenticates to Google Analytics, constructs a funnel definition from CLI arguments or JSON config, calls run_funnel_report on the GA4 Data API alpha client, parses the response, and writes structured JSON output. This is materially narrower than the declared purpose and omits several central claimed capabilities, especially Search Console support, live site auditing, and recommendation generation. There is no clearly dangerous undeclared behavior, but there is a significant description/behavior mismatch in primary scope and functionality.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The description promises an end-to-end website analysis capability combining goal discovery, user journey validation, GA4/GSC analysis, live site auditing, and actionable recommendations. The actual code only queries GA4 Data API reports using presets or user-specified dimensions/metrics and serializes the results. While GA4 analysis is one component of the declared purpose, the code lacks the broader behaviors that define the skill’s stated function. Therefore the description materially overstates and misrepresents what this code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description promises a strategy-and-analytics workflow: understand business goals and user journeys, analyze GSC/GA4 data, validate real user behavior against intended journeys, and produce goal-aligned improvement plans. The code does none of that. It is a standalone GEO audit script focused on AI discoverability and content structure. It fetches robots.txt, llms.txt, llms-full.txt, sitemap.xml, and page HTML; evaluates AI crawler blocking, explicit allow rules, content depth, intro summaries, FAQ/HowTo signals, question headings, and schema presence; and emits a report. While this is loosely related to search optimization, it is materially different from the declared primary purpose and omits the central promised capabilities around GA4/GSC and user behavior analysis. Therefore this is a clear mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

This code chunk’s primary purpose is significantly narrower than the declared description. It only reads data from Google Search Console APIs (search analytics, sitemaps, URL inspection) and serializes results. The declared description promises a higher-level workflow involving understanding business goals and user journeys, analyzing both GSC and GA4, auditing the live site, validating behavioral intent, and producing optimization plans. None of that analytical or planning behavior appears in the code. Additionally, the code includes concrete GSC operations like sitemap listing and URL inspection that are not reflected in the description. While GSC access is directionally related to SEO diagnosis, the actual behavior is materially just data retrieval rather than the described end-to-end diagnostic and recommendation capability.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description suggests a broad diagnostic skill centered on business goals, user journeys, and behavioral analytics from GA4/GSC, with live-site validation against intended user behavior. The supplied code does none of that. Instead, it performs a technical HTTP performance/security audit of webpages: requests pages, optionally via sitemap, measures response/load times, HTML size, compression, HSTS, CSP, X-Frame-Options, X-Content-Type-Options, HTTPS/TLS version, redirects, cache headers, and inferred CDN provider. While 'audit website performance' appears in the description, that is only one small part of the declared overall purpose, and the code's primary behavior is much narrower and materially different from the stated analytics- and journey-focused workflow. Therefore this is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

There is a material mismatch between the declared purpose and the supplied code. The description promises a high-level analytics and strategy workflow centered on goals, user journeys, GA4/GSC analysis, and diagnosing gaps between intended and actual user behavior. The code only performs live-site technical SEO auditing via HTTP requests and HTML parsing. While this partially overlaps with 'audit the live site' and SEO improvement use cases, the primary declared capabilities around analytics platforms, behavioral validation, and goal-aligned planning are absent. The code also reads SITE_URL from environment and accesses public site resources (pages, sitemap.xml, robots.txt), which is consistent with site auditing, but not with the much broader declared analytics/strategy functionality. Therefore the description overstates and misrepresents the actual behavior.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

The skill design explicitly relies on a local .env and service-account configuration for authentication, which is a credential-access pattern. In this context, the risk is amplified because scripts auto-load these secrets and then perform shell and network operations, creating opportunities for accidental exposure, misuse, or leakage via logs and generated artifacts.

Content

Scanner excerpt · SKILL.md (reported line 16)May include surrounding context.

text
<project_root>/.skills-data/google-analytics-and-search-improve/
  .env        # Configuration (auth, URLs, etc.), auto-loaded by scripts
  data/       # Raw data only: API responses, user-uploaded CSVs (GSC/GA4/PSI JSON/CSV)
  analysis/   # Analysis outputs: reports, audit results, website profile, funnel analysis
  charts/     # Generated chart images (PNG) for embedding in analysis reports

Credential Access

High
Category
Privilege Escalation
Confidence
99% confidence
Finding

The instruction set -a; source "$DATA_DIR/.env"; set +a imports every variable from a local secrets file into the shell environment for subsequent script execution. This broad export pattern increases the risk that secrets are inherited by child processes, exposed in debugging output, or accessed by scripts that do not actually need them.

Content

Scanner excerpt · SKILL.md (reported line 251)May include surrounding context.

bash
source "$DATA_DIR/venv/bin/activate"
set -a; source "$DATA_DIR/.env"; set +a
python scripts/seo_audit.py --url "$SITE_URL" --sitemap -o "$DATA_DIR/analysis/seo_audit.json"
python scripts/geo_audit.py --url "$SITE_URL" --sitemap -o "$DATA_DIR/analysis/geo_audit.json"
python scripts/perf_audit.py --url "$SITE_URL" --sitemap -o "$DATA_DIR/analysis/perf_audit.json"

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

The reference documentation explicitly covers auth setup and .env-based configuration for multiple external services, confirming that the skill's workflow includes credential acquisition and use. In combination with auto-loading, local storage, and broad shell/network operations, this creates a meaningful credential-handling risk surface.

Content

Scanner excerpt · SKILL.md (reported line 313)May include surrounding context.

md
| Document | Contents |
|----------|----------|
| [references/data-collection-reference.md](references/data-collection-reference.md) | Auth setup (GSC/GA4/Bing), .env configuration, collection commands, script usage (gsc_query.py, ga4_query.py, ga4_funnel.py, bing_query.py), dimensions & metrics, CSV export instructions, custom queries, PSI collection |
| [references/metrics-glossary.md](references/metrics-glossary.md) | Six analysis dimensions: thresholds, diagnostics, priority matrix |
| [references/SEO-GEO-Optimization-Checklist.md](references/SEO-GEO-Optimization-Checklist.md) | SEO & GEO optimization checklist: structured data, AI readability, content depth, performance |
| [references/data-visualization-guide.md](references/data-visualization-guide.md) | Chart generation patterns, type selection, per-phase chart requirements, CJK font support |

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Writing credentials into $DATA_DIR/.env creates a plaintext secret store on disk, which can be read by other local users, backup systems, logs, or accidentally committed to repositories. In this skill, the risk is amplified because the file is later sourced into the shell, making secret handling part of routine execution without any warning or safeguards.

Content

Scanner excerpt · references/data-collection-reference.md (reported line 70)May include surrounding context.

  1. In the Google Analytics Admin page, click "Property Settings" (or "Property Details") under "Property"
  2. The "Property ID" is displayed in the top-right — a numeric string (e.g., 123456789, no "UA-" prefix)

Step 8: Write to .env

bash
cat > "$DATA_DIR/.env" <<EOF

Credential Access

High
Category
Privilege Escalation
Confidence
88% confidence
Finding

The instructions tell users to source $DATA_DIR/.env directly into the shell, which imports any secrets in plaintext and trusts the file contents as executable shell syntax. If the .env file is modified maliciously or contains unexpected shell constructs, sourcing it can expose credentials or trigger unintended command execution in addition to leaking secrets into the process environment.

Content

Scanner excerpt · references/data-collection-reference.md (reported line 128)May include surrounding context.

bash
source "$DATA_DIR/venv/bin/activate"
set -a; source "$DATA_DIR/.env"; set +a

# GSC data
python scripts/gsc_query.py --dimensions query --limit 500 -o "$DATA_DIR/data/gsc_queries.json"

Credential Access

High
Category
Privilege Escalation
Confidence
71% confidence
Finding

Importing utils specifically to trigger .env loading and warning suppression causes the script to automatically ingest environment-sourced values from a local .env file without explicit user consent at runtime. In an agent-skill context, implicit loading of all environment configuration can unnecessarily expose secrets to process memory and to any code in utils, increasing the blast radius if that helper is modified or compromised.

Content

Scanner excerpt · scripts/perf_audit.py (reported line 36)May include surrounding context.

python
from pathlib import Path
from urllib.parse import urljoin, urlparse

import utils  # noqa: F401  — triggers .env loading & warning suppression

try:
    import requests

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/bing_query.py (reported line 14)May include surrounding context.

python
Centralizes:
- Data directory discovery (.skills-data/google-analytics-and-search-improve/)
- .env loading
- Google Service Account credential auto-discovery
- Warning suppression for clean output
"""

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/bing_query.py (reported line 24)May include surrounding context.

python
Centralizes:
- Data directory discovery (.skills-data/google-analytics-and-search-improve/)
- .env loading
- Google Service Account credential auto-discovery
- Warning suppression for clean output
"""

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/ga4_funnel.py (reported line 31)May include surrounding context.

python
Centralizes:
- Data directory discovery (.skills-data/google-analytics-and-search-improve/)
- .env loading
- Google Service Account credential auto-discovery
- Warning suppression for clean output
"""

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/ga4_query.py (reported line 16)May include surrounding context.

python
Centralizes:
- Data directory discovery (.skills-data/google-analytics-and-search-improve/)
- .env loading
- Google Service Account credential auto-discovery
- Warning suppression for clean output
"""

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/geo_audit.py (reported line 22)May include surrounding context.

python
Centralizes:
- Data directory discovery (.skills-data/google-analytics-and-search-improve/)
- .env loading
- Google Service Account credential auto-discovery
- Warning suppression for clean output
"""

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/geo_audit.py (reported line 35)May include surrounding context.

python
Centralizes:
- Data directory discovery (.skills-data/google-analytics-and-search-improve/)
- .env loading
- Google Service Account credential auto-discovery
- Warning suppression for clean output
"""

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/gsc_query.py (reported line 13)May include surrounding context.

python
Centralizes:
- Data directory discovery (.skills-data/google-analytics-and-search-improve/)
- .env loading
- Google Service Account credential auto-discovery
- Warning suppression for clean output
"""

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/perf_audit.py (reported line 22)May include surrounding context.

python
Centralizes:
- Data directory discovery (.skills-data/google-analytics-and-search-improve/)
- .env loading
- Google Service Account credential auto-discovery
- Warning suppression for clean output
"""

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/seo_audit.py (reported line 19)May include surrounding context.

python
Centralizes:
- Data directory discovery (.skills-data/google-analytics-and-search-improve/)
- .env loading
- Google Service Account credential auto-discovery
- Warning suppression for clean output
"""

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/seo_audit.py (reported line 33)May include surrounding context.

python
Centralizes:
- Data directory discovery (.skills-data/google-analytics-and-search-improve/)
- .env loading
- Google Service Account credential auto-discovery
- Warning suppression for clean output
"""

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/utils.py (reported line 5)May include surrounding context.

python
Centralizes:
- Data directory discovery (.skills-data/google-analytics-and-search-improve/)
- .env loading
- Google Service Account credential auto-discovery
- Warning suppression for clean output
"""

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/utils.py (reported line 52)May include surrounding context.

python
Centralizes:
- Data directory discovery (.skills-data/google-analytics-and-search-improve/)
- .env loading
- Google Service Account credential auto-discovery
- Warning suppression for clean output
"""

Static analysis

No suspicious patterns detected.