Back to skill

Security audit

aipexbase

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent BaaS web-app builder, but it uses unsafe installation steps and handles an administrator token in ways that could expose it.

Review before installing. Do not provide a real administrator token unless you are comfortable with it being written to local config files and copied into projects. Avoid running the setup commands automatically; install prerequisites through trusted, pinned methods, and exclude secret config files from deployment archives.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
Findings (4)

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:45
Finding
Unverified Remote Script Downloaded and Executed Through a Shell Pipeline<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:45-48` **Vulnerability Type**: Remote payload retrieval and immediate execution **Risk Level**: Critical ### Vulnerable Code ```bash # Install nvm curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash ``` ### Technical Analysis The installation instructions pipe content retrieved from an external URL directly into Bash. Although the URL appears to reference the upstream `nvm-sh/nvm` GitHub repository and a version tag, the downloaded content is not verified using a cryptographic checksum or signature and cannot be reviewed before execution. The effective payload therefore depends on content delivered at execution time rather than content included in the audited Skill. Compromise of the upstream account, repository, release reference, hosting infrastructure, TLS trust chain, or local network configuration could turn this instruction into arbitrary code execution. The NVM installer may also modify persistent shell initialization files such as `~/.bashrc`. Installing NVM is not necessary when a compatible Node.js runtime is already available, so unconditional execution exceeds the minimum access required by the Skill. ### Attack Path 1. An attacker compromises or gains control over content delivered from the referenced external source, or redirects the request through a compromised trust path. 2. The Skill executes the documented `curl` command. 3. `curl` writes the remotely supplied content to standard output. 4. Bash executes that content immediately without checksum validation or user inspection. 5. The payload runs with all permissions of the user invoking the Skill. 6. The payload can read or modify user-accessible files, credentials, project content, and shell configuration. If invoked from an elevated shell, its impact expands accordingly. ### Impact Assessment Successful exploitation provides arbitrary command execution under the invoking user's account. Th ...[truncated 406 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the `curl | bash` pipeline entirely. 2. Detect whether a compatible Node.js runtime is already present before installing anything. 3. Require explicit user approval before changing the runtime or shell configuration. 4. If NVM must be installed: - Download the installer into a temporary file. - Pin an immutable release artifact. - Verify a publisher-provided SHA-256 digest or cryptographic signature. - Display or inspect the downloaded script before execution. - Execute it as a separate step only after successful verification. 5. Prefer a trusted system package manager or a pre-provisioned runtime in a controlled environment. 6. Run installation without elevated privileges and document any persistent changes made to shell initialization files. ]]>

T08 · Insecure Dependencies

Error
Location
SKILL.md:55
Finding
Unpinned Global CLI and Browser Dependencies Permit Supply-Chain Code Execution<![CDATA[ ## Vulnerability Details **File Locations**: - `SKILL.md:55-58` - `references/aipexbase-js-api.md:344-348` - `references/html-template.html:6-8` - `references/html-template.html:71-73` - `references/style-guide.md:10-13` **Vulnerability Type**: Unpinned and integrity-unverified third-party dependencies **Risk Level**: High ### Vulnerable Code ```bash # Global install of the baas CLI npm i aipexbase-cli -g ``` ```html <!-- Tailwind CSS --> <script src="https://cdn.tailwindcss.com"></script> ``` ```html <!-- AiPexBase SDK --> <script src="https://cdn.jsdelivr.net/npm/aipexbase-js/dist/aipexbase.umd.min.js"></script> ``` The SDK reference repeats the same unpinned dependency: ```html <script src="https://cdn.jsdelivr.net/npm/aipexbase-js/dist/aipexbase.umd.min.js"></script> ``` ### Technical Analysis The npm command installs the latest package matching `aipexbase-cli` globally rather than selecting an audited, exact version. npm package lifecycle scripts may execute during installation. A malicious newly published version, compromised maintainer account, or registry compromise could therefore execute code on the development host. Global installation also gives the package broader reach than a project-local dependency and can affect future projects or commands using that executable. The generated browser applications load Tailwind and `aipexbase-js` from remote CDNs without exact version pinning or Subresource Integrity metadata. The `aipexbase-js` URL does not contain a version, so future page loads can receive a different package version without changes to the audited application. Both CDN resources execute JavaScript in the application's origin and consequently have access to page content, application API keys, browser storage allowed to that origin, and authenticated application operations. No evidence in the project establishes the provenance or integrity of the `aipexbase-cli` package or the browser bundles. ### Attack Path #### CLI de ...[truncated 1480 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin `aipexbase-cli` to an exact audited version. 2. Install it as a project-local development dependency rather than globally. 3. Commit a lockfile and enforce integrity verification with a reproducible installation command such as `npm ci`. 4. Review package ownership, release provenance, transitive dependencies, and lifecycle scripts. 5. Consider disabling lifecycle scripts where compatible with the package. 6. Pin browser dependencies to exact versions. 7. Self-host verified production bundles, or use versioned CDN URLs with valid Subresource Integrity hashes and `crossorigin="anonymous"`. 8. Replace the Tailwind development CDN with a locally built, pinned production stylesheet. 9. Deploy a restrictive Content Security Policy that limits permitted script sources and avoids inline script execution. 10. Establish an update process in which dependency changes are reviewed and tested before deployment. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:69
Finding
Administrator Management Token Can Be Copied Into and Uploaded With Deployable Project Files<![CDATA[ ## Vulnerability Details **File Locations**: - `SKILL.md:69-72` - `SKILL.md:83-96` - `references/deploy.md:9-14` - `references/deploy.md:27-31` - `config.json:1-4` **Vulnerability Type**: Plaintext credential propagation and deployment artifact exposure **Risk Level**: High ### Vulnerable Code The global configuration is explicitly documented as containing a reusable management token: ```markdown | Configuration file | Location | Description | |---------|------|------| | **Global configuration** `config.json` | This Skill (`baas-frontend/`) directory | Contains `baseUrl` and `manageToken`, supplied by the user and shared by all projects | | **Project configuration** `baas-config.json` | Project directory | Copied from the global configuration when creating an application, then updated with `apiKey` and `appId` | ``` The workflow asks for the administrator token and copies the complete configuration into the project: ```markdown Read `<skill directory>/config.json` and check whether `baseUrl` and `manageToken` are configured. If the file does not exist or required fields are missing: 1. Ask the user to provide `baseUrl` 2. Ask the user to provide `manageToken` (administrator token) ``` ```bash cd <project directory> cp <current skill directory>/config.json ./baas-config.json ``` The deployment workflow recursively archives the entire project without excluding the configuration: ```bash cd <project directory> zip -r project.zip . -x "node_modules/*" -x ".git/*" -x "*.zip" ``` ```bash baas -c ./baas-config.json deploy ./project.zip ``` The shipped configuration currently contains an empty token: ```json { "baseUrl": "https://baas.kuafuai.net/baas-api", "manageToken": "" } ``` The immediate repository does not expose a live token, but the documented workflow instructs users to populate and propagate one. ### Technical Analysis The Skill combines management-plane credentials and project/runtime configuration in the same JSON file. It th ...[truncated 2358 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Separate management-plane secrets from project and frontend configuration. 2. Never copy `manageToken` into a project directory. 3. Read the management token from a protected environment variable or secret manager only when executing management commands. 4. Generate a sanitized project configuration containing only values explicitly safe for the application runtime. 5. Do not include management credentials in browser-delivered files. 6. Replace recursive archive-by-default behavior with an explicit deployment allowlist, such as a dedicated `dist/` directory. 7. Explicitly exclude at least: - `baas-config.json` - `config.json` - `.env` and `.env.*` - credential files - development schemas and management scripts - source maps containing sensitive source data 8. Add an automated pre-deployment secret scan and fail deployment if credentials are detected. 9. Apply restrictive file permissions to any unavoidable local secret file. 10. Prevent secret-containing configuration files from entering version control through `.gitignore` and repository scanning. 11. Rotate any management token that may previously have been copied into or deployed with a project. 12. Scope management tokens to the minimum required applications and operations, and use short expiration periods where supported. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
references/html-template.html:122
Finding
Unsanitized Toast Messages Are Inserted With innerHTML, Enabling DOM-Based XSS<![CDATA[ ## Vulnerability Details **File Locations**: - `references/html-template.html:122-146` - `references/style-guide.md:489-516` **Vulnerability Type**: DOM-based cross-site scripting through an unsafe HTML sink **Risk Level**: Medium ### Vulnerable Code ```javascript function showToast(message, type = 'success') { const container = document.getElementById('toast-container'); const toast = document.createElement('div'); const styles = { success: 'bg-green-50 border-green-200 text-green-800', error: 'bg-red-50 border-red-200 text-red-800', warning: 'bg-yellow-50 border-yellow-200 text-yellow-800', info: 'bg-blue-50 border-blue-200 text-blue-800' }; const icons = { success: '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/>', error: '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>', warning: '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/>', info: '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>' }; toast.className = `flex items-center px-4 py-3 rounded-xl border shadow-soft-lg animate-slide-down ${styles[type]}`; toast.innerHTML = ` <svg class="w-5 h-5 mr-3 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">${icons[type]}</svg> <span class="font-medium">${message}</span> `; container.appendChild(toast); } ``` The style guide contains the same pattern: ```javascript toast.innerHTML = ` <svg class="w-5 h-5 mr-3 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"> ${icons[type]} </svg> <span class="font-medium">${message}</span> `; ``` ### Technical A ...[truncated 2374 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not interpolate untrusted messages into `innerHTML`. 2. Create the message element separately and set its content with `textContent`: ```javascript const messageNode = document.createElement('span'); messageNode.className = 'font-medium'; messageNode.textContent = String(message); toast.appendChild(svgNode); toast.appendChild(messageNode); ``` 3. Build the SVG with DOM methods or select it from a fixed, internal template rather than combining trusted and untrusted values in one HTML string. 4. If rich HTML messages are genuinely required, sanitize them with a well-maintained allowlist sanitizer and prohibit scripts, event handlers, dangerous URLs, and active embedded content. 5. Validate `type` against a fixed allowlist such as `success`, `error`, `warning`, and `info`, falling back to a safe default. 6. Add tests using hostile payloads to ensure Toast messages are always rendered as text. 7. Deploy a restrictive Content Security Policy that prohibits inline script and inline event-handler execution. CSP should be defense in depth and must not replace safe DOM construction. ]]>
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
Findings (21)

Chaining Abuse

High
Category
Tool Misuse
Content
```bash
# 安装 nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

# 加载 nvm 环境
source ~/.bashrc
Confidence
98% confidence
Finding
Piping curl output directly into bash is a classic unsafe command-chaining pattern that executes untrusted network content immediately. In this skill, the context makes it more dangerous because the instructions encourage automated setup, so a compromised upstream script could lead to arbitrary code execution on the host.

Hidden Instructions

High
Category
Prompt Injection
Content
```html
<body class="bg-gradient-subtle min-h-screen">
    <!-- 顶部导航(玻璃态) -->
    <nav class="sticky top-0 z-50 glass border-b border-gray-200/50">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex justify-between h-16 items-center">
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
```html
<body class="bg-gradient-subtle min-h-screen">
    <!-- 顶部导航(玻璃态) -->
    <nav class="sticky top-0 z-50 glass border-b border-gray-200/50">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex justify-between h-16 items-center">
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
### 3.10 加载状态

```html
<!-- 页面加载(全屏) -->
<div class="fixed inset-0 bg-white/80 backdrop-blur-sm flex items-center justify-center z-50">
    <div class="flex flex-col items-center">
        <div class="w-12 h-12 rounded-full border-4 border-primary-200 border-t-primary-600 animate-spin"></div>
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
### 3.10 加载状态

```html
<!-- 页面加载(全屏) -->
<div class="fixed inset-0 bg-white/80 backdrop-blur-sm flex items-center justify-center z-50">
    <div class="flex flex-col items-center">
        <div class="w-12 h-12 rounded-full border-4 border-primary-200 border-t-primary-600 animate-spin"></div>
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill explicitly says new app creation and iterative code/schema changes should be performed automatically without user confirmation. Because these operations can create resources, mutate schemas, and alter project code, they can cause unintended data-impacting changes and surprise side effects if the agent misinterprets requirements.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
The skill directs installation of system-level tooling and package modifications, including piping a remote installer into bash and using sudo to install OS packages. For a frontend/BaaS development skill, these actions expand the host attack surface and can change the environment in ways unrelated to the immediate task, especially if run automatically without explicit user consent.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
npm i aipexbase-cli -g

# 安装 zip(部署打包时需要)
sudo apt-get install -y zip
```

---
Confidence
97% confidence
Finding
The sudo apt-get install step requires elevated privileges and modifies the host operating system. In an agent skill context, privilege escalation is risky because it can make persistent system changes beyond the task scope and magnify harm if any preceding command or package source is compromised.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill instructs collecting a manageToken and storing it in a shared config.json without any warning about secret handling, access control, or file exposure. Administrator tokens are highly sensitive; placing them in project-accessible configuration files increases the risk of accidental disclosure, reuse across projects, and privilege misuse.

Context-Inappropriate Capability

Medium
Confidence
89% confidence
Finding
The skill instructs the agent to use external public image/network sources during data insertion even though this is not essential to core app generation. This can cause unreviewed third-party network access, introduce privacy and licensing issues, and make builds depend on untrusted remote content.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
This markdown file includes a delete example that removes database records, but the surrounding description provides no warning that deletion is destructive or may permanently affect user data. For markdown files, safety-relevant behaviors that can impact data integrity should be accompanied by an explicit caution to users.

Context-Inappropriate Capability

Medium
Confidence
88% confidence
Finding
The manifest describes an end-to-end web application development skill, where database, auth, deployment, and normal frontend implementation details are expected. This reference file additionally instructs use of unrelated platform-extension capabilities such as package tracking, geolocation, robot/webhook notifications, email sending, and arbitrary custom API invocation, which go beyond what is inherently required for generic frontend app construction.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
Line L01 presents the document heading and instructions entirely in Chinese, including a directive that constrains how the PRD should be produced. Because this is a reusable template rather than a clearly region-specific compliance artifact, it effectively forces a specific language/locale without opt-in, which matches the stated policy-violation category.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The style guide is written as a mandatory standard and begins by requiring all pages to follow it, but it is entirely in Chinese with no indication that language choice is optional or region-specific. This creates a natural-language locale policy issue because it effectively forces one language/locale without user opt-in or documented justification.

Intent-Code Divergence

Medium
Confidence
97% confidence
Finding
The Toast example builds HTML with `toast.innerHTML` and interpolates `${message}` directly into the DOM. If `message` can contain user-controlled content, this creates a DOM XSS sink that can execute arbitrary script or markup, which is especially risky in a frontend skill intended as reusable guidance.

External Script Fetching

Low
Category
Supply Chain
Content
```bash
# 安装 nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

# 加载 nvm 环境
source ~/.bashrc
Confidence
93% confidence
Finding
Fetching and executing a remote installation script from GitHub introduces supply-chain risk because the script content is not reviewed at execution time and could change or be compromised. In a skill designed to run autonomously, this is especially dangerous because it normalizes executing remote code during setup.

Missing User Warnings

Low
Confidence
84% confidence
Finding
The skill recommends using third-party image URLs but omits warnings about outbound network access, content provenance, licensing, and potential leakage of search terms or project context. While lower severity, this still creates compliance and privacy risks when agents fetch or embed external assets automatically.

Missing User Warnings

Low
Confidence
77% confidence
Finding
The documentation demonstrates updating database records, including changing user status, but does not mention that this alters persisted user data and should be done carefully. In markdown skill guidance, state-changing operations that affect user data should disclose their impact so users understand the risk.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
The file's instructional content is presented entirely in Chinese, with no indication that the user can choose another language or that the skill is intentionally limited to a Chinese-speaking or region-specific context. This creates a natural-language policy concern because it implicitly enforces a specific language without opt-in.

Natural-Language Policy Violations

Low
Confidence
93% confidence
Finding
The HTML document hard-codes `lang="zh-CN"`, and the visible UI text throughout the template is also fixed in Chinese. For a general-purpose template, this is a natural-language locale constraint without any user opt-in or documented region-specific justification.

Intent-Code Divergence

Low
Confidence
92% confidence
Finding
L825-L829 明确规定上传失败必须有 toast 提示,但图片上传相关函数 handleUpload、handleDrop、showPreview 仅处理成功预览路径,没有文件过大、类型非法、读取失败等错误处理,也没有调用 showToast。这里不是简单的说明不完整,而是文档中的“必须”要求与示例代码行为不一致。

Static analysis

Detected: suspicious.exposed_secret_literal

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/aipexbase-js-api.md:8