Back to skill

Security audit

JishuDB Knowledge Search / JishuDB知识库检索助手

Security checks for vulnerabilities and agentic risk

Overview

This skill is a read-only JishuDB knowledge-base search helper with disclosed credential and network use, though users should avoid sending bearer tokens over plain HTTP.

Install only where the JishuDB endpoint is trusted and authorized. Prefer an HTTPS JISHUDB_URL when JISHUDB_TOKEN is set, and treat results as limited to the configured KB and available host tools rather than a complete document audit unless the host inventory/read/status tools are present.

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
kb-search.sh:21
Finding

Bearer Token Transmitted Over Plaintext HTTP

Content
View full analysis

Vulnerability Details

File Location: kb-search.sh, lines 21–24, 34, and 62–63
Vulnerability Type: Plaintext transmission of authentication credentials
Risk Level: Medium

Technical Analysis

The helper defaults to an unencrypted HTTP endpoint and adds JISHUDB_TOKEN as a bearer token without enforcing HTTPS:

bash
#   JISHUDB_URL         base URL of the KB service   (default http://host.docker.internal:18089)
#   JISHUDB_DEFAULT_KB  kb id used when none is given (optional)
#   JISHUDB_TOKEN       bearer token if the KB has auth enabled (optional)
set -uo pipefail

BASE="${JISHUDB_URL:-http://host.docker.internal:18089}"; BASE="${BASE%/}"
AUTH=(); [ -n "${JISHUDB_TOKEN:-}" ] && AUTH=(-H "authorization: Bearer ${JISHUDB_TOKEN}")

The token-bearing header is then supplied to both supported API operations:

bash
resp=$(curl -sS --max-time 15 "${AUTH[@]}" "$BASE/api/kb") \
  || die "cannot reach KB at $BASE — is the 知识库 (JishuDB) app running in the panel?"
bash
resp=$(curl -sS --max-time 40 "${AUTH[@]}" -H 'content-type: application/json' \
  -X POST "$BASE/api/kb/$KB/search" -d "$payload") \
  || die "cannot reach KB at $BASE — is the 知识库 app running?"

When JISHUDB_TOKEN is configured while the default endpoint—or any other plaintext HTTP endpoint—is used, the bearer credential crosses the process/container network boundary without transport encryption. The script performs no URL-scheme validation and does not reject this combination.

Attack Path

  1. The environment supplies a valid JISHUDB_TOKEN.
  2. JISHUDB_URL is unset, causing the helper to use http://host.docker.internal:18089, or it is explicitly set to another HTTP endpoint.
  3. The agent invokes either the list or search operation.
  4. curl sends the bearer token in the plaintext Authorization header.
  5. An attacker capable of observing or manipulating the relevant container-to-host or n ...[truncated 919 chars]
Remediation
View remediation

Remediation Suggestions

  • Require an https:// endpoint whenever JISHUDB_TOKEN is present, and terminate execution if a token would be transmitted over plaintext HTTP.
  • Validate the normalized JISHUDB_URL scheme before constructing or sending authentication headers.
  • Replace the authenticated plaintext default with a trusted HTTPS endpoint.
  • If local plaintext communication is operationally unavoidable, use a protected Unix-domain socket or another authenticated and encrypted local transport rather than ordinary HTTP.
  • Configure curl to verify TLS certificates using the deployment's trusted CA material; do not disable certificate validation.
  • Keep any explicit plaintext mode restricted to unauthenticated loopback-only deployments and clearly warn that bearer credentials must not be used in that mode.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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 (3)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The skill claims it can list files, read full document contents, and check import status, but the bundled helper only supports KB listing and passage search. This mismatch can cause an agent to over-trust incomplete results, fabricate answers from snippets, or misreport document inventories and job states, which is especially risky in an internal-knowledge context where users may rely on precise, authoritative outputs.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill advertises and documents shell-based execution (bash, curl) and use of environment-provided credentials (JISHUDB_URL, JISHUDB_TOKEN) but does not declare an explicit tool/permission scope. That creates an authorization gap where a host may expose broader shell or environment access than intended, increasing the risk of command execution or secret exposure if the skill is invoked in a permissive runtime.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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 · kb-search.sh (reported line 56)May include surrounding context.

sh
payload="{\"query\":\"${QUERY//\"/\\\"}\",\"topK\":${TOPK}}"
fi

resp=$(curl -sS --max-time 40 "${AUTH[@]}" -H 'content-type: application/json' \
  -X POST "$BASE/api/kb/$KB/search" -d "$payload") \
  || die "cannot reach KB at $BASE — is the 知识库 app running?"