Back to skill

Security audit

dataforseo-cli

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward DataForSEO CLI guide, but users should handle the API credentials and npm install step carefully.

Before installing, consider pinning the npm package version and avoid running npm with elevated privileges. Treat the DataForSEO login, password, and base64 token as secrets; avoid saving them in shell history, protect ~/.config/dataforseo-cli/config.json, and rotate credentials if they may have been exposed.

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

T08 · Insecure Dependencies

Warning
Location
SKILL.md:19
Finding

Unpinned Third-Party Package Installed Globally

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 19–23
Vulnerability Type: Unpinned global npm dependency installation
Risk Level: Medium

Vulnerable Code:

markdown
### 1. Install from npm

```bash
npm install -g dataforseo-cli
text

### Technical Analysis

The setup instructions install `dataforseo-cli` globally from the npm registry without pinning an exact version or verifying an integrity hash. Consequently, the package contents installed by a user may differ from those that existed when this skill was reviewed.

npm packages can run lifecycle scripts during installation. A malicious or compromised future package release could therefore execute code with the privileges of the user running npm. Global installation also exposes the command system-wide for that user and increases the likelihood that other workflows will invoke the installed executable.

The audited project does not contain the dependency's source code, a lockfile, a checksum, or provenance verification material. This finding identifies an unsafe supply-chain installation practice; it does not establish that the current npm package is malicious.

### Attack Path

1. An attacker compromises the npm package, its publisher account, or its release pipeline.
2. The attacker publishes a malicious release under the legitimate package name.
3. A user follows the skill instructions and runs `npm install -g dataforseo-cli`.
4. npm resolves the mutable current release because no exact version is specified.
5. Malicious installation lifecycle code or executable code runs with the installing user's privileges.
6. The globally installed command remains available and may execute again when invoked by the user or an agent.

### Impact Assessment

Successful exploitation could permit arbitrary code execution under the installing user's account. Accessible resources could include that user's files, environment variables, API credentials
...[truncated 240 chars]
Remediation
View remediation

Remediation Suggestions

  • Pin the dependency to a specifically reviewed version, such as dataforseo-cli@1.0.6, rather than resolving the latest release.
  • Prefer a project-local installation over -g to reduce exposure and isolate the package.
  • Commit and enforce a lockfile containing integrity metadata.
  • Verify npm package provenance, publisher identity, release signatures, and registry source before installation.
  • Review the package's source code and lifecycle scripts for the pinned release.
  • Where compatible with the package, install with lifecycle scripts disabled and run only reviewed entry points.
  • Avoid executing npm installation commands with administrator or root privileges.
  • Establish a controlled update process in which newer versions are reviewed before changing the pin.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:33
Finding

API Credentials Exposed Through Command-Line Arguments

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 33–39
Vulnerability Type: Sensitive credentials supplied in process arguments
Risk Level: Medium

Vulnerable Code:

markdown
If credentials are already configured, you're good to go. If not, authenticate:

```bash
# With login + password
dataforseo-cli --set-credentials login=YOUR_LOGIN password=YOUR_PASSWORD

# Or with base64 token (from DataForSEO email)
dataforseo-cli --set-credentials base64=YOUR_BASE64_TOKEN
text

### Technical Analysis

The documented authentication procedure places a password or token directly in command-line arguments. Shells commonly preserve entered commands in history files. While the process is active, command-line arguments may also be exposed through local process inspection, diagnostic tools, audit logs, terminal recording, or process telemetry.

Encoding a token with Base64 does not provide confidentiality. Anyone who obtains the Base64 value can decode or directly reuse it, depending on the API's authentication format.

The document also states that credentials are persisted in `~/.config/dataforseo-cli/config.json`, but the project does not specify or enforce restrictive permissions for that file. The external CLI implementation was not included in the audited project, so its storage protections could not be verified.

### Attack Path

1. A user replaces the placeholders with a real DataForSEO login and password or Base64 token.
2. The user executes the documented command.
3. The shell records the complete command in its history, or a concurrent local process reads the process arguments while the CLI is running.
4. A local attacker, compromised application, support bundle, telemetry collector, or later shell-history reader obtains the credential.
5. The attacker reuses the credential to authenticate to DataForSEO.
6. The attacker accesses services available to the account, submits billable API requests
...[truncated 529 chars]
Remediation
View remediation

Remediation Suggestions

  • Replace command-line credential arguments with an interactive prompt that disables terminal echo.
  • Alternatively, accept credentials through protected standard input, an operating-system secret store, or a narrowly scoped credential helper.
  • Do not recommend plaintext environment variables as the primary solution because they may also leak through process environments, diagnostics, or logs.
  • Explicitly warn users not to enter secrets directly into shell commands or store them in scripts.
  • If backward compatibility requires argument-based authentication, clearly mark it as insecure and provide a safer default workflow.
  • Create ~/.config/dataforseo-cli/config.json with owner-only permissions, such as mode 0600 on POSIX systems, and ensure its parent directory is not accessible to other users.
  • Never print passwords or complete tokens in status output, errors, debug logs, or telemetry.
  • Support credential rotation and advise affected users to revoke and replace credentials that may already have been entered through command-line arguments.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (1)

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

This markdown file includes commands for setting login/password or base64 API tokens and notes that credentials are stored in a local config file. While the behavior is described, there is no user-facing warning about the sensitivity of these credentials or the need to protect the config location, which is relevant to privacy and system safety.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.