Back to skill

Security audit

Baidu Search Node

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent Baidu search scraper, but its own integration example can turn a search query into local shell command execution.

Review before installing. Do not copy the execSync example as written; use spawn/execFile with argument arrays and validate result counts. Avoid searching secrets or sensitive personal data because queries go to Baidu. Prefer regenerating the lockfile from the canonical npm registry and updating or reviewing dependencies before use.

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)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:78
Finding

Shell Command Injection in Documented Search Integration

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 78-83
Vulnerability Type: OS command injection through unsafe shell command construction
Risk Level: High

Vulnerable Code:

javascript
const { execSync } = require('child_process');

function baiduSearch(query, count = 5) {
  const scriptPath = '/Users/mac/.openclaw/workspace/skills/baidu-search/baidusearch.js';
  const cmd = `node "${scriptPath}" "${query}" -n ${count}`;
  const output = execSync(cmd, { encoding: 'utf-8' });

Technical Analysis

The documented integration places query and count directly into a command string passed to execSync. By default, execSync executes the string through a system shell. Quotation marks around query do not provide adequate protection because an attacker can include another quotation mark followed by shell metacharacters.

For example, a query such as:

text
"; id; #

can terminate the intended quoted argument and append another command. The resulting command would be structurally similar to:

sh
node "/path/to/baidusearch.js" ""; id; #" -n 5

The count argument is also interpolated without validation and can become another injection vector if an attacker can control it.

The directly executable baidusearch.js implementation does not contain this flaw because Commander reads arguments from process.argv. The vulnerability is specifically present in the integration pattern recommended by SKILL.md.

Attack Path

  1. An application or Agent adopts the documented baiduSearch wrapper.
  2. The attacker submits a crafted search query, or an untrusted value reaches the count parameter.
  3. The wrapper interpolates that value into cmd without shell escaping or strict validation.
  4. execSync passes the constructed string to the operating-system shell.
  5. The shell interprets the injected metacharacters and executes attacker-supplied commands.
  6. The inj ...[truncated 717 chars]
Remediation
View remediation

Remediation Suggestions

Do not construct a shell command from user-controlled values. Invoke Node.js directly with an argument array by using execFileSync, spawn, or spawnSync with shell execution disabled:

javascript
const { execFileSync } = require('child_process');

function baiduSearch(query, count = 5) {
  const scriptPath = '/Users/mac/.openclaw/workspace/skills/baidu-search/baidusearch.js';

  if (typeof query !== 'string' || query.length === 0 || query.length > 500) {
    throw new TypeError('query must be a non-empty string of at most 500 characters');
  }

  if (!Number.isInteger(count) || count < 1 || count > 100) {
    throw new RangeError('count must be an integer between 1 and 100');
  }

  return execFileSync(
    process.execPath,
    [scriptPath, query, '-n', String(count)],
    {
      encoding: 'utf8',
      timeout: 30000,
      shell: false
    }
  );
}

Additional hardening should include:

  • Apply strict type, length, and range validation to all arguments.
  • Set a finite execution timeout and output-size limit.
  • Run the integration under a least-privileged operating-system account.
  • Avoid attempting to solve the issue with custom shell escaping when argument-array APIs are available.
  • Add automated tests containing quotation marks, semicolons, command substitutions, newlines, and other shell metacharacters.

T08 · Insecure Dependencies

Warning
Location
package-lock.json:25
Finding

Dependency Lockfile Uses Third-Party Package Registry Mirrors

Content
View full analysis

Vulnerability Details

File Location: package-lock.json, lines 25-26; the same pattern appears in other dependency entries
Vulnerability Type: Unsafe third-party dependency source and supply-chain provenance
Risk Level: Medium

Vulnerable Code:

json
"resolved": "https://r.cnpmjs.org/axios/-/axios-1.13.5.tgz",
"integrity": "sha512-cz4ur7Vb0xS4/KUN0tPWe44eqxrIu31me+fbang3ijiNscE129POzipJJA6zniq2C/Z6sJCjMimjS8Lc/GAs8Q==",

Other reviewed lockfile entries similarly resolve packages through r.cnpmjs.org or r2.cnpmjs.org, including Cheerio and Commander.

Technical Analysis

The committed lockfile directs npm to download dependency archives from third-party CNPM mirrors instead of the canonical npm registry. This introduces an additional supply-chain trust boundary: installations depend on the availability, security, and package provenance practices of the mirror operator.

The included SHA-512 integrity values provide meaningful protection against an archive being silently changed after the lockfile was generated. However, integrity verification only confirms that the downloaded bytes match the bytes selected when the lockfile was created. It does not independently establish that those original bytes came from the expected canonical publisher or registry.

No malicious package, lifecycle script, or dependency payload was identified in the reviewed project. The finding concerns dependency provenance and avoidable exposure to third-party package-delivery infrastructure.

Attack Path

  1. A user follows the installation instructions or runs npm install or npm ci.
  2. npm reads the committed resolved URLs from package-lock.json.
  3. Dependency archives are requested from r.cnpmjs.org or r2.cnpmjs.org.
  4. Installation therefore relies on those third-party services to deliver the dependency archives.
  5. If the mirror, the lockfile-generation environment, or the initially selected mirrored ...[truncated 957 chars]
Remediation
View remediation

Remediation Suggestions

Regenerate the lockfile using the canonical npm registry in a trusted environment:

sh
npm config set registry https://registry.npmjs.org/
rm -rf node_modules package-lock.json
npm install
npm config get registry

Review the regenerated lockfile and confirm that package resolved fields use https://registry.npmjs.org/. Commit that lockfile and use reproducible installation commands:

sh
npm ci --ignore-scripts

Use --ignore-scripts where dependency lifecycle scripts are not required. If lifecycle scripts are necessary, review them before enabling execution.

Additional hardening should include:

  • Pin and review dependency versions through the lockfile.
  • Retain and verify package integrity hashes.
  • Run dependency vulnerability and provenance checks in CI.
  • Reject unexpected registry hosts during code review or CI validation.
  • Configure the registry at the repository or CI level rather than relying on developer-specific global settings.
  • Periodically review transitive dependencies and remove unnecessary packages.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (11)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
使用 `baidusearch.js` 脚本,位于 `/Users/mac/.openclaw/workspace/skills/baidu-search/baidusearch.js`

Known Vulnerable Dependency: axios==1.13.5 — 16 advisory(ies): CVE-2026-44494 (axios Vulnerable to Full Man-in-the-Middle via Prototype Pollution Gadget in `co); CVE-2026-44495 (axios Vulnerable to Credential Theft and Response Hijacking via Prototype Pollut); CVE-2025-62718 (Axios has a NO_PROXY Hostname Normalization Bypass that Leads to SSRF) +13 more

High
Category
Supply Chain
Confidence
98% confidence
Finding

The lockfile pins axios 1.13.5, and the supplied advisories include high-risk issues such as SSRF-related proxy bypass and prototype-pollution-assisted request/response manipulation. In a search/scraping skill that performs outbound HTTP requests, a vulnerable HTTP client is directly in the execution path, making these issues relevant rather than theoretical.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: form-data==4.0.5 — 1 advisory(ies): CVE-2026-12143 (form-data: CRLF injection in form-data via unescaped multipart field names and f)

High
Category
Supply Chain
Confidence
88% confidence
Finding

form-data 4.0.5 is reported vulnerable to CRLF injection via unescaped multipart field names and filenames. Even though this package is transitive under axios and may not be exercised by all code paths, it becomes dangerous if the skill ever builds multipart uploads from user-controlled input, potentially enabling header/body injection or request tampering.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: undici==7.22.0 — 16 advisory(ies): CVE-2026-1525 (Undici has an HTTP Request/Response Smuggling issue); CVE-2026-6733 (undici vulnerable to HTTP response queue poisoning via keep-alive socket reuse); CVE-2026-1527 (Undici has CRLF Injection in undici via `upgrade` option) +13 more

High
Category
Supply Chain
Confidence
93% confidence
Finding

undici 7.22.0 is flagged for multiple high-severity HTTP parsing and message-handling issues, including request/response smuggling and queue poisoning. In a search/parsing tool, an HTTP stack vulnerability can expose the skill to cache poisoning, response confusion, or security-boundary bypass when interacting with malicious or unexpected upstream servers.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: axios==1.13.5 — 16 advisory(ies): CVE-2026-44494 (axios Vulnerable to Full Man-in-the-Middle via Prototype Pollution Gadget in `co); CVE-2026-44495 (axios Vulnerable to Credential Theft and Response Hijacking via Prototype Pollut); CVE-2025-62718 (Axios has a NO_PROXY Hostname Normalization Bypass that Leads to SSRF) +13 more

High
Category
Supply Chain
Confidence
99% confidence
Finding

The package explicitly depends on axios 1.13.5, which the finding reports as having multiple known advisories, including SSRF-related and man-in-the-middle/prototype-pollution-related issues. If this skill uses axios for outbound requests, an exploitable HTTP client flaw could enable request forgery, credential leakage, response tampering, or broader compromise depending on how network responses are trusted.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly describes a Baidu search tool that performs live scraping via a Node.js script, but it does not clearly warn that user queries are transmitted to an external third-party service. This creates a privacy and data-handling risk because users may submit sensitive prompts assuming the tool is local or passive documentation rather than network-active behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill notes that safe search is unsupported, but it fails to warn that returned results may include adult, unsafe, or otherwise harmful content. In a search skill, this omission matters because users may rely on the tool in general-purpose contexts, including environments where unfiltered results are inappropriate or risky.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: follow-redirects==1.15.11 — 1 advisory(ies): CVE-2026-40895 (follow-redirects leaks Custom Authentication Headers to Cross-Domain Redirect Ta)

Low
Category
Supply Chain
Confidence
84% confidence
Finding

follow-redirects 1.15.11 is flagged for leaking custom authentication headers across cross-domain redirects. Because this project uses axios, which depends on follow-redirects, the issue can matter if the skill ever sends authenticated requests or bearer tokens and follows attacker-controlled redirects.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The dependency is specified with a caret range (^1.13.5), which permits installation of newer compatible releases rather than a fully fixed version. This weakens build reproducibility and can unintentionally pull in a newly published compromised or breaking package version through the supply chain.

Content

Scanner excerpt · package.json (reported line 13)May include surrounding context.

json
"author": "",
  "license": "ISC",
  "dependencies": {
    "axios": "^1.13.5",
    "cheerio": "^1.2.0",
    "commander": "^14.0.3"
  }

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The dependency is declared with a caret range (^1.2.0), allowing automatic resolution to later minor/patch releases. This creates supply-chain risk and reduces reproducibility because different installations may resolve to different package contents over time.

Content

Scanner excerpt · package.json (reported line 14)May include surrounding context.

json
"license": "ISC",
  "dependencies": {
    "axios": "^1.13.5",
    "cheerio": "^1.2.0",
    "commander": "^14.0.3"
  }
}

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

Using a caret version (^14.0.3) allows the resolved commander package version to drift across environments and over time. That increases exposure to accidental or malicious upstream changes and makes security review and rollback harder.

Content

Scanner excerpt · package.json (reported line 15)May include surrounding context.

json
"dependencies": {
    "axios": "^1.13.5",
    "cheerio": "^1.2.0",
    "commander": "^14.0.3"
  }
}

Static analysis

No suspicious patterns detected.