Back to skill

Security audit

flydb-cli-release

Security checks for vulnerabilities and agentic risk

Overview

This database-migration skill is mostly transparent and purpose-aligned, but it can install and run unpinned Flydb or JDBC code that may use database credentials and modify databases.

Use this only with Flydb releases and JDBC drivers you trust. Prefer a preinstalled CLI or a reviewed ZIP with a known checksum/signature, set driver downloads to offline/never when possible, pre-provision approved driver JARs, and use least-privileged database credentials. Review dry-run output carefully before production writes or clean/repair/undo actions.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T03 · Remote Payload Retrieval and Execution

Error
Location
references/release-package.md:47
Finding
Unverified Remote Retrieval and Execution of the Flydb CLI Release<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:51-54`; `references/release-package.md:7-13, 47-56`; `references/upstream-sync.json:2-6` **Vulnerability Type**: Remote payload retrieval and execution without mandatory authenticity verification **Risk Level**: High ### Vulnerable Code Snippets `SKILL.md:51-54`: ```markdown 1. 探测已有安装:先查用户给定路径、`FLYDB_HOME`、PATH 和项目工具目录,再按需搜索常见安装位置。 2. 复用本地 ZIP(如 `~/Downloads/flydb-cli-*.zip`),`unzip` 解压 3. 下载:GitHub URL 模式 `https://github.com/zzxCoding/Flydb/releases/download/v<version>/flydb-cli-<version>.zip`;国内网络 GitHub 不可达时用 Gitee 镜像同型 URL `https://gitee.com/zzhenxuan/Flydb/releases/download/v<version>/flydb-cli-<version>.zip` ``` `references/release-package.md:47-56`: ```bash # FLYDB_VERSION 由用户指定或从已核验的 Release 选定,不从源码 pom 自动推断 : "${FLYDB_VERSION:?先选择已核验的发行版本}" curl -fL -o "flydb-cli-${FLYDB_VERSION}.zip" \ "https://github.com/zzxCoding/Flydb/releases/download/v${FLYDB_VERSION}/flydb-cli-${FLYDB_VERSION}.zip" # GitHub 不可达且镜像确有同版本资产时,改用上述 Gitee URL 模式 ``` ```markdown 下载后先 `unzip -t` 检查完整性;Release 提供校验文件时核对其中同名 ZIP 的 SHA-256(macOS `shasum -a 256`,Linux `sha256sum`)。只有自己计算的哈希不能证明来源一致。选择一个精确版本 ZIP,避免通配符混入多个版本。缺少可信校验值时如实报告验证范围。 ``` `references/upstream-sync.json:2-6`: ```json { "source_repository": "https://github.com/zzxCoding/Flydb", "source_commit": "56bc3baef4a4e5c9eefe440644a4343aa960d0a4", "source_version": "0.3.6", "source_inputs_dirty": false, "source_input_status": [], "release_status": "not_verified" } ``` ### Technical Analysis The Skill instructs the Agent to download a ZIP containing executable shell launchers and Java JARs from an external repository and then execute the extracted CLI. This creates a remote code-execution channel whose effective payload may change after the Skill itself has been reviewed. The documented safeguards do not provide mandatory authenticity verification: - `curl -fL` provides transport-level error handling but does not authenticate the release publ ...[truncated 2729 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Fail closed on authenticity verification** - Do not extract or execute a downloaded release unless it matches trusted verification material. - Treat missing signatures or trusted checksums as a blocking error rather than merely reporting reduced verification. 2. **Pin approved release metadata** - Include an allowlist of approved versions and SHA-256 hashes in the reviewed Skill package. - Bind each hash to the exact asset name, release version, and source URL. - Update this manifest only through a reviewed release process. 3. **Use signed release manifests** - Publish checksums in a cryptographically signed manifest. - Pin the expected signing key or certificate fingerprint in the Skill. - Verify the signature and then verify the ZIP against the signed checksum before extraction. 4. **Secure mirror fallback** - Require the GitHub and Gitee assets to match the same trusted signed digest. - Do not treat URL naming consistency as proof that mirror assets are equivalent. - Document and verify the ownership relationship between both release locations. 5. **Harden extraction** - Extract into a newly created, non-privileged directory. - Reject absolute paths, parent-directory traversal entries, device files, and unsafe symbolic links. - Avoid overwriting an existing installation. 6. **Reduce execution privileges** - Run release verification and initial execution without elevated operating-system privileges. - Use a database account scoped to the required schema and migration operations. - Avoid exposing unrelated secrets or broad environment variables to the CLI process. ]]>

T08 · Insecure Dependencies

Warning
Location
references/configuration.md:25
Finding
Automatic Retrieval and Loading of Unpinned JDBC Driver JARs<![CDATA[ ## Vulnerability Details **File Location**: `references/configuration.md:25-30, 69-78`; `references/drivers.md:9-17`; `references/commands.md:20-21` **Vulnerability Type**: Insecure executable dependency resolution **Risk Level**: Medium ### Vulnerable Code Snippets `references/configuration.md:25-30`: ```markdown | `flydb.driver-coordinate` | `FLYDB_DRIVER_COORDINATE` | `--driver-coordinate` | 内置数据库自动推断 | Maven 坐标 `groupId:artifactId:version`;小众或私服驱动显式填写 | | `flydb.driver-download` | `FLYDB_DRIVER_DOWNLOAD` | `--driver-download` | `auto` | `auto` 按 Maven 有效仓库下载,`never` 禁止下载 | | `flydb.driver-cache` | `FLYDB_DRIVER_CACHE` | `--driver-cache` | `~/.flydb/drivers` | 自动下载驱动的本地缓存目录 | | `flydb.maven-settings` | `FLYDB_MAVEN_SETTINGS` | `--maven-settings` | `~/.m2/settings.xml` | Maven settings 文件;读取私服、镜像、认证、代理、Profile 仓库和本地仓库 | | `flydb.maven-local-repository` | `FLYDB_MAVEN_LOCAL_REPOSITORY` | `--maven-local-repository` | Maven 有效本地仓库 | 显式覆盖 Maven 本地仓库目录 | | `flydb.offline` | `FLYDB_OFFLINE` | `--offline` | `false` | 禁止所有远程驱动解析,仍使用本地来源 | ``` `references/drivers.md:9-17`: ```markdown ## 驱动解析顺序(从先到后) 1. 安装目录 `drivers/*.jar` 2. 运行时 classpath 3. Maven 本地仓库:显式 `--maven-local-repository` / `maven.repo.local` → `settings.xml` 的 `localRepository` → `~/.m2/repository` 4. Flydb 驱动缓存 `~/.flydb/drivers`(`--driver-cache` 可改) 5. 按 Maven 有效配置远程下载(`--driver-download auto` 默认允许;`never` 禁止;`--offline` 禁止一切远程解析) 远程解析遵循 `settings.xml` 的 `mirrors`、激活 Profile 的 `repositories`、`servers` 基本认证和活动 `proxy`。配置了 `mirrorOf=*` 时 Central 会被镜像替换,Flydb 不会绕过企业私服直连公网。自动下载写入独立的 `~/.flydb/drivers` 缓存,不修改 Maven 本地仓库。 ``` `references/commands.md:20-21`: ```markdown | `--driver-coordinate <gav>` | 小众/厂商驱动 Maven 坐标 `groupId:artifactId:version` | | `--driver-download <auto\|never>` | 是否允许按 Maven 有效仓库下载缺失驱动 | ``` ### Technical Analysis JDBC drivers are executable Java bytecode loaded into the Flydb process. The default `flydb.driver-download=auto` permits the CLI and GUI to retrieve missi ...[truncated 2556 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Disable automatic downloads by default** - Change the default from `auto` to `never`. - Require a deliberate, task-specific opt-in before any network dependency resolution. 2. **Pre-provision verified drivers** - Obtain JDBC drivers through an approved artifact-management process. - Verify them before placing them in `drivers/`, the classpath, or a controlled local repository. - Use a least-privileged deployment identity for provisioning. 3. **Pin dependency identity** - Maintain an allowlist of approved group IDs, artifact IDs, versions, repositories, and SHA-256 hashes. - Reject dynamic versions, unapproved repositories, and artifacts whose digest does not match the manifest. 4. **Protect repository configuration** - Use authenticated internal artifact repositories where possible. - Restrict write access to Maven `settings.xml`, local repositories, and `~/.flydb/drivers`. - Review mirrors, active profiles, proxies, and repository definitions before enabling downloads. 5. **Validate cached artifacts** - Revalidate cached JARs against trusted digests before every load. - Record the verified coordinate, source repository, and digest for auditability. - Provide a secure mechanism to invalidate or quarantine suspect cache entries. 6. **Apply the MCP restriction consistently** - Extend the MCP behavior of fixed `--driver-download never` to unattended CLI, Agent, CI, and GUI execution. - Keep dependency installation separate from database migration execution. 7. **Limit runtime exposure** - Use a database account restricted to the required schemas and migration actions. - Avoid making unrelated credentials available in the Flydb process environment. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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

Static analysis

No suspicious patterns detected.