Back to skill

Security audit

tracking-google-serp-rankings

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a coherent Apify-based Google SERP ranking helper, but it documents unsafe token handling and an unscoped JavaScript transformation hook that users should review before installing.

Install only if you are comfortable giving the agent access to an Apify token and sending search terms to Apify. Prefer MCP or a helper that uses Authorization headers, avoid the documented token-in-URL curl fallback, use a least-privilege Apify token, and do not pass customMapFunction code unless you fully trust and understand it.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:101
Finding

Apify API Token Exposed in Request URL

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 101–105
Vulnerability Type: Credential exposure through URL query parameters
Risk Level: Medium

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~google-search-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json"

Technical Analysis

The documented REST fallback passes APIFY_TOKEN through the request URL's query string. When the shell expands the environment variable, the resulting secret becomes part of curl's command-line arguments and the complete request URL.

Although HTTPS encrypts the request while it is in transit, it does not prevent exposure through local process inspection or URL recording by the API provider, reverse proxies, gateways, monitoring systems, and diagnostic logs. Authentication is necessary for the Skill's declared functionality, but placing the credential in a URL exceeds what is required; Apify authentication can instead be supplied through an HTTP authorization header.

Attack Path

  1. A user configures APIFY_TOKEN and executes the documented REST fallback.
  2. The shell expands $APIFY_TOKEN directly into the curl request URL.
  3. A local user capable of inspecting process arguments, or an infrastructure component that records request URLs, captures the expanded URL.
  4. The observer extracts the token from the token query parameter.
  5. The exposed token is reused against Apify APIs within the permissions assigned to that token.

Impact Assessment

An attacker who obtains the token may perform unauthorized Apify API operations permitted by its scope. This could consume account credits, initiate actor runs, or expose run and dataset information accessible to the token. The precise impact is limited by the token's configured permissions and the affected Apify account's resources; the finding does not establish broader local-system compromise.

Remediation
View remediation

Remediation Suggestions

Remove the token from the URL and transmit it through an HTTP authorization header:

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~google-search-scraper/runs" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "queries": ["[keyword1]", "[keyword2]"],
    "maxPagesPerQuery": 2,
    "countryCode": "US",
    "languageCode": "en"
  }'

In addition:

  1. Use an Apify token restricted to the minimum permissions required to run the designated actor and retrieve its results.
  2. Avoid printing, logging, or persisting the token in command output, generated reports, shell tracing, or debug logs.
  3. Review URL, proxy, gateway, and API access logs for prior token exposure if the documented command has already been used.
  4. Revoke and rotate any token that may have been recorded.
  5. Ensure any helper implementation, including the referenced but absent scripts/run_actor.js, uses header-based authentication and does not expose secrets in command-line arguments or output files.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill exposes a customMapFunction parameter that allows arbitrary JavaScript execution as part of processing scraper output, which exceeds the stated need of returning rankings, URLs, titles, snippets, and SERP feature types. If a user or downstream agent passes attacker-controlled code into this field, it could lead to code execution in the actor environment, data exfiltration, or abuse of available credentials and network access.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

REST API fallback:

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~google-search-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

REST API fallback:

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~google-search-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "queries": ["[keyword1]", "[keyword2]"],

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The markdown tells users to set APIFY_TOKEN and later use it in API calls, but it does not include any warning to keep the token secret or avoid exposing it in shared shells, logs, or saved command history. Because this skill involves credential use and outbound API requests, a brief user-facing warning would improve safety.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The manifest says the skill returns ranking position, URL, title, snippet, and SERP feature type per result from Google SERPs. Line L155 adds a difficulty assessment 'based on DR of top results if available', which goes beyond the described data returned by the scraper and implies enrichment from external authority metrics not otherwise supported in the file.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.