Back to skill

Security audit

噗滋慈善 - 申报助手 / pozzzi-charity application-assistant

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent for drafting Chinese NGO applications, but its privacy controls are weaker than it claims and can send nested or free-text personal data to an external model.

Review before installing if your drafts may contain personal information about staff, volunteers, partners, beneficiaries, or minors. Enter only data you are comfortable sending to the configured model provider, remove individual-level details from all narrative and nested fields, and do not rely on the local validator as a complete PII blocker.

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
src/prompt-builder.js:303
Finding

Detected and Unrecognized PII Is Still Transmitted to the External Model

Content
View full analysis

Vulnerability Details

File Location: src/validators.js:540-593, src/prompt-builder.js:303-332, src/prompt-builder.js:519-529, and src/index.js:218-231
Vulnerability Type: Incomplete PII sanitization and fail-open validation
Risk Level: Medium

Vulnerable Code

src/validators.js:540-593 detects possible personal names in nested team biographies but only generates a warning:

js
function validatePIISafety(input) {
  const piiFields = ['contact_name', 'contact_phone'];
  const warnings = [];

  if (!input || typeof input !== 'object') {
    return { piiFields, warnings };
  }

  // Detect possible Chinese real names in team_composition[].background
  if (Array.isArray(input.team_composition) && input.team_composition.length > 0) {
    const allBackgrounds = input.team_composition
      .map((m, idx) => ({ idx, text: m.background || '' }))
      .filter(item => typeof item.text === 'string' && item.text.trim());

    const nameContextPattern =
      /[\u4e00-\u9fa5]{2,4}(?=是|叫|说|告诉|表示|介绍|反映|名叫|叫做)/g;
    const nameAfterDelimiter =
      /[::、,]\s*([\u4e00-\u9fa5]{2,4})(?=[,,。\s]|$)/g;

    allBackgrounds.forEach(({ idx, text }) => {
      const matches1 = text.match(nameContextPattern) || [];
      const matches2 = [];
      let dm;
      while ((dm = nameAfterDelimiter.exec(text)) !== null) {
        matches2.push(dm[1]);
      }
      nameAfterDelimiter.lastIndex = 0;
      const matches = [...matches1, ...matches2];
      if (matches && matches.length > 0) {
        const uniqueMatches = [...new Set(matches)];
        warnings.push(
          `team_composition[${idx}].background 中检测到疑似真实姓名:${uniqueMatches.join('、')}。请使用职位/专业背景描述代替真实姓名(如"社会工作专业硕士"),以保护团队成员隐私。`,
        );
      }
    });
  }

  return { piiFields, warnings };
}

src/prompt-builder.js:303-332 removes only two exact top-level fields. All other values, including nested values and free-text content, are copied into the model prompt:

js
function buildUserPromp
...[truncated 4857 chars]
Remediation
View remediation

Remediation Suggestions

  1. Create a sanitized data object before prompt construction

    • Never pass the original input to buildPrompt().
    • Make validation return a separately constructed, sanitized object.
    • Ensure all downstream model operations use only that object.
  2. Use an explicit schema allowlist

    • Reconstruct only the fields required for each application type.
    • Reject or discard unknown properties.
    • Define permitted nested keys for arrays such as team_composition, activities_design, and budget_breakdown.
  3. Apply recursive PII filtering

    • Inspect all strings in nested arrays and objects.
    • Detect and redact or block phone numbers, identity numbers, email addresses, bank details, physical addresses, and likely personal names.
    • Apply special handling to beneficiary narratives and team biographies.
  4. Fail closed for high-confidence PII

    • Convert high-confidence findings from warnings into blocking validation errors.
    • Require the user to remove individual-level data before any external model request.
    • Enforce the documented restriction on individual-level data concerning children under 14.
  5. Minimize transmitted data

    • Send only fields needed for the requested template or regenerated section.
    • For section regeneration, avoid transmitting unrelated sections and unrelated input fields.
  6. Retain gateway filtering as defense in depth

    • Continue using model-gateway filtering, but do not rely on it as the sole privacy control.
    • Verify that the gateway rejects rather than merely logs high-confidence PII.
  7. Add regression tests

    • Assert that nested names, telephone numbers, identity numbers, addresses, bank details, and beneficiary-level data never appear in generated model messages.
    • Test unknown keys and deeply nested objects.
    • Test both full generation and section regeneration paths.
Vulnerability Patterns
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (9)

Unvalidated Output Injection

High
Category
Output Handling
Confidence
100% confidence
Finding

Model output is used without validation or sanitization. Unvalidated output injected into downstream contexts (SQL, shell, HTML) enables injection attacks and arbitrary code execution.

Content

Scanner excerpt · src/prompt-builder.js (reported line 430)May include surrounding context.

js
// 在当前 result 上扫描(每轮 regex 都在最新 result 上运行)
    const matches = [];
    let m;
    while ((m = regex.exec(result)) !== null) {
      matches.push({ original: m[0], index: m.index });
    }

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest description and all user-facing documentation in this file are written exclusively in Chinese, with no indication that users may choose another language or that the skill is intentionally restricted to Chinese-speaking users. Under the policy, forcing a specific language without opt-in is a natural-language policy violation unless the locale constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This JavaScript file contains multiple user-visible error and warning strings exclusively in Chinese, such as validation errors and warning messages. Because the skill does not provide any user opt-in or locale selection, it appears to force a specific language, which matches the natural-language policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This code file contains natural-language descriptions exclusively in Chinese, including the module description '申报助手专有', which indicates a language-specific constraint. Under the policy, forcing a specific language without user opt-in or a clearly documented justification is a reportable locale-policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The system prompt explicitly instructs the model to use formal Chinese writing and Chinese-numbered section titles, and the surrounding comments describe the skill as operating for Chinese organizations. This imposes a specific language/locale choice in natural-language instructions without offering the user a choice or clearly documenting that the skill is restricted to a China-specific compliance context at the point of use.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This JavaScript file contains natural-language comments and validation strings exclusively in Chinese, including user-facing error/warning text returned by the validators. Under the language/locale policy, forcing a specific language without user opt-in can be a policy violation unless the locale restriction is explicitly documented and justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The title and the entire template are written as a mandatory Chinese application form, and the file does not indicate that language selection is optional or limited to a China-specific compliance context. This creates a natural-language policy concern because it effectively imposes a specific language/locale without explicit user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The usage instructions specify '正式公文体' and Chinese-language stylistic requirements as a fixed expectation. Because the template does not offer opt-in or explain that it is restricted to Chinese-language government procurement submissions, this is a natural-language locale policy issue under the stated rule.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This line requires the language style to emphasize specific Chinese procurement phrasing, reinforcing a mandatory locale/language constraint. The file does not pair this with an explicit user choice or a clear statement that the skill is only intended for a region-specific Chinese government workflow.

Content

No source excerpt is available for this finding.