Back to skill

Security audit

Rag Retriever

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent RAG document-retrieval tool, with real but purpose-aligned privacy and supply-chain risks rather than evidence of malicious behavior.

Install only with the understanding that indexed documents and embeddings may persist locally, and OpenAI embeddings will send configured text to OpenAI. Use local-only/simple embeddings for sensitive documents, clear caches when needed, update the locked dependencies, and pin or review transformer model sources before relying on the optional model-download path.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
src/rag2.js:216
Finding

Indirect Prompt Injection Through Retrieved Document Content

Content
View full analysis
{ return `[${i + 1}] ${r.content}`; }); return { context: contextParts.join(separator), hasResults: true, query, resultsCount: results.resultsCount, citations: results.citations, prompt: this.buildAugmentedPrompt(query, contextParts) }; } /** * Build an augmented prompt */ buildAugmentedPrompt(query, contextParts) { return `Based on the following context, answer the question. Use citations [1], [2], etc. to reference sources. Context: ${contextParts.join('\n\n')} Question: ${query} Answer:`; } ``` ### Technical Analysis The retrieved `r.content` values originate from indexed documents and are inserted verbatim into an instruction-bearing prompt. The prompt does not establish a clear trust boundary between system instructions and retrieved data, nor does it instruct the downstream model to disregard commands found in documents. An attacker who can influence an indexed document can add model-directed instructions such as requests to ignore previous instructions, conceal citations, disclose surrounding context, or invoke tools. If that document is retrieved for a later query, its instructions are placed in the same prompt as the legitimate task. Delimiters alone do not reliably prevent this issue. Security controls must ensure that retrieved documents are treated strictly as untrusted evidence and that downstream tool use remains subject to ...[truncated 1385 chars]
Remediation
View remediation
... ``` This instruction should be placed at the highest available trusted prompt level, not merely adjacent to the retrieved content. ]]>

T08 · Insecure Dependencies

Warning
Location
src/transformers-embedding.js:22
Finding

Unpinned Transformer Models Downloaded Through a Hardcoded Third-Party Mirror

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
src/retriever.js:12
Finding

Invalid Chunk Overlap Configuration Can Cause Infinite Processing Loops

Content
View full analysis
0 0 <= overlap < chunkSize ``` When `overlap === chunkSize` and no earlier separator changes the effective chunk end, the next `start` can equal the current `start`. The `while (start < content.length)` condition remains true, so the loop repeatedly creates the same chunk. Other invalid values can make the start position move backward or create unexpectedly small progress. Because each iteration appends another chunk object, the failure consumes both CPU and memory until the process is terminated or the host becomes resource constrained. The use of `value || default` is not a substitute for validation. Negative values, non-integer values, very large values, and some non-finite value ...[truncated 1079 chars]
Remediation
View remediation
= chunkSize) { throw new RangeError( 'overlap must be a non-negative integer smaller than chunkSize' ); } ``` 2. Add an explicit forward-progress assertion inside the loop: ```js const nextStart = end - overlap; if (nextStart <= start) { throw new Error('Chunking configuration does not make forward progress'); } start = nextStart; ``` 3. Set defensible maximum values for chunk size, overlap, document length, and total generated chunks. 4. Reject non-finite numbers, fractions, strings, and negative values. 5. Abort processing when a configured chunk-count or execution-time limit is exceeded. 6. Apply the same centralized validation to both `ChunkingStrategy` and `RAG2Retriever` to prevent inconsistent behavior. 7. Add regression tests covering: - `overlap === chunkSize` - `overlap > chunkSize` - Negative overlap - Zero or negative chunk size - `NaN` and infinity - Extremely long documents - Separators near chunk boundaries ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (50)

Harmful Content Injection

Critical
Category
Prompt Injection
Confidence
70% confidence
Finding

This content may contain harmful instructions that could cause physical harm if followed. CRITICAL: Review carefully before use.

Content

Scanner excerpt · data/model-cache/tokenizer.json (reported line 29758)May include surrounding context.

json
"disgrace": 29591,
      "infused": 29592,
      "pudding": 29593,
      "stalks": 29594,
      "##urbed": 29595,
      "arsenic": 29596,
      "leases": 29597,
      "##hyl": 29598,
      "##rrard": 29599,
      "collarbone": 29600,
      "##waite": 29601,

Harmful Content Injection

Critical
Category
Prompt Injection
Confidence
70% confidence
Finding

This content may contain harmful instructions that could cause physical harm if followed. CRITICAL: Review carefully before use.

Content

Scanner excerpt · data/models/all-MiniLM-L6-v2/tokenizer.json (reported line 29758)May include surrounding context.

json
"disgrace": 29591,
      "infused": 29592,
      "pudding": 29593,
      "stalks": 29594,
      "##urbed": 29595,
      "arsenic": 29596,
      "leases": 29597,
      "##hyl": 29598,
      "##rrard": 29599,
      "collarbone": 29600,
      "##waite": 29601,

Known Vulnerable Dependency: protobufjs==7.5.4 — 12 advisory(ies): CVE-2026-44294 (protobuf.js: Denial of service from crafted field names in generated code); CVE-2026-44293 (protobuf.js: Code injection through bytes field defaults in generated toObject c); CVE-2026-44289 (protobuf.js: Denial of service through unbounded protobuf recursion) +9 more

Critical
Category
Supply Chain
Confidence
96% confidence
Finding

protobufjs 7.5.4 is present and reportedly affected by multiple serious issues including denial of service and potential code-generation-related injection flaws. In a retrieval/ML skill with multiple parsing and model-related dependencies, vulnerable protobuf handling increases risk if untrusted model metadata or serialized inputs are accepted.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: tar==7.5.12 — 6 advisory(ies): CVE-2026-59873 (node-tar: Decompression/parse DoS via unlimited input); CVE-2026-59874 (node-tar: Negative tar entry size causes infinite loop in archive replace); CVE-2026-59875 (node-tar: Uncaught Exception DoS via NUL byte in PAX path/linkpath records) +3 more

Critical
Category
Supply Chain
Confidence
98% confidence
Finding

tar 7.5.12 is included via onnxruntime-node and is associated with multiple archive parsing and decompression denial-of-service issues. This is especially concerning because install-time or runtime archive handling in ML/model tooling can be triggered by remote downloads or crafted archives, creating a realistic DoS and possibly broader supply-chain risk.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node src/rag-skill.js init my_docs

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node src/rag-skill.js init my_docs

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node src/rag-skill.js init my_docs

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node src/rag-skill.js init my_docs

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
import { RAGRetriever } from './src/retriever.js';

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node test/retriever.test.js

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
97% confidence
Finding

form-data 4.0.5 is present and carries a CRLF injection issue in multipart field names. This can be dangerous if any attacker-controlled input is used to construct multipart requests, potentially allowing header/body manipulation in outbound requests to third-party services.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: sharp==0.34.5 — 2 advisory(ies): GHSA-f88m-g3jw-g9cj (sharp inherited vulnerabilities in libvips: CVE-2026-33327, CVE-2026-33328, CVE-); GHSA-rgj7-g3m4-5g8c (sharp: Vulnerabilities in libheif: GHSA-g89c-p67h-r497 and GHSA-2jg2-4ch7-h545)

High
Category
Supply Chain
Confidence
95% confidence
Finding

sharp 0.34.5 is present with advisories inherited from native image-processing libraries such as libvips/libheif. If the skill ever ingests untrusted image files, these native parser bugs can lead to crashes, denial of service, or potentially worse memory-safety impacts depending on the underlying vulnerability.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The entire design document is written in Chinese and does not state that language selection is optional or that the skill is intended only for a Chinese-speaking or region-specific context. Under the policy, forcing a specific language without user opt-in can constitute a natural-language locale violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
80% confidence
Finding

The file states that the system automatically detects Chinese text and uses Chinese tokenization, and the overall README is written entirely in Chinese while emphasizing Chinese-specific behavior. Under the stated policy, language or locale constraints should either be optional via user choice or clearly documented as justified; that clarification is missing here.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill documentation tells users they can add documents and later notes plans to integrate external embedding providers, but it does not warn that supplied documents may be persisted locally in the vector store and could be transmitted to third-party APIs when external embeddings are enabled. This creates a real privacy and data-handling risk because users may unknowingly ingest sensitive content under incorrect assumptions about where that data goes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file contains all user-facing instructions in Chinese, including the title, test steps, expected results, and troubleshooting guidance. Under the policy rules, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified, which is not present here.

Content

No source excerpt is available for this finding.

YARA rule 'network_reconnaissance': Network reconnaissance and scanning patterns [hacktools]

Medium
Category
YARA Match
Confidence
65% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · data/model-cache/tokenizer.json (reported line 9367)May include surrounding context.

json
nquest": 9187,
      "dubbed": 9188,
      "##tv": 9189,
      "halt": 9190,
      "brave": 9191,
      "brunswick": 9192,
      "doi": 9193,
      "arched": 9194,
      "curtis": 9195,
      "divorced": 9196,
      "predominantly": 9197,
      "somerset": 9198,
      "streams": 9199,
      "ugly": 9200,
      "zoo": 9201,
      "horrible": 9202,
      "curved": 9203,
      "buenos": 9204,
      "fierce": 9205,
      "dictionary": 9206,
      "vector": 9207,
      "theological": 9208,
      "unions": 9209,
      "handful": 9210,
      "stability": 9211,
      "chan": 9212,
      "punjab": 9213,
      "segments": 9214,
      "##lly": 9215,
      "altar": 9216,
      "ignoring": 9217,
      "gesture": 9218,
      "monsters": 9219,
      "pastor": 9220,
      "##stone": 9221,
      "thighs": 9222,
      "unexpected": 9223,
      "operators": 9224,
      "abruptly": 9225,
      "coin": 9226,
      "compiled": 9227,
      "associates": 9228,
      "improving": 9229,
      "migration": 9230,

YARA rule 'network_reconnaissance': Network reconnaissance and scanning patterns [hacktools]

Medium
Category
YARA Match
Confidence
65% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · data/models/all-MiniLM-L6-v2/tokenizer.json (reported line 9367)May include surrounding context.

json
nquest": 9187,
      "dubbed": 9188,
      "##tv": 9189,
      "halt": 9190,
      "brave": 9191,
      "brunswick": 9192,
      "doi": 9193,
      "arched": 9194,
      "curtis": 9195,
      "divorced": 9196,
      "predominantly": 9197,
      "somerset": 9198,
      "streams": 9199,
      "ugly": 9200,
      "zoo": 9201,
      "horrible": 9202,
      "curved": 9203,
      "buenos": 9204,
      "fierce": 9205,
      "dictionary": 9206,
      "vector": 9207,
      "theological": 9208,
      "unions": 9209,
      "handful": 9210,
      "stability": 9211,
      "chan": 9212,
      "punjab": 9213,
      "segments": 9214,
      "##lly": 9215,
      "altar": 9216,
      "ignoring": 9217,
      "gesture": 9218,
      "monsters": 9219,
      "pastor": 9220,
      "##stone": 9221,
      "thighs": 9222,
      "unexpected": 9223,
      "operators": 9224,
      "abruptly": 9225,
      "coin": 9226,
      "compiled": 9227,
      "associates": 9228,
      "improving": 9229,
      "migration": 9230,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The code writes cached embeddings to embedding-cache.json, which is a file write affecting local storage. Although comments mention caching, there is no explicit warning or disclosure that processed content derivatives are persisted on disk, which is relevant to user data and system integrity.

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 · src/embeddings.js (reported line 57)May include surrounding context.

js
return this.cache[cacheKey];
    }

    const response = await fetch('https://api.openai.com/v1/embeddings', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',

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 · src/embeddings.js (reported line 107)May include surrounding context.

js
return this.cache[cacheKey];
    }

    const response = await fetch('https://api.openai.com/v1/embeddings', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · src/embeddings.js (reported line 57)May include surrounding context.

js
return this.cache[cacheKey];
    }

    const response = await fetch('https://api.openai.com/v1/embeddings', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · src/embeddings.js (reported line 107)May include surrounding context.

js
return this.cache[cacheKey];
    }

    const response = await fetch('https://api.openai.com/v1/embeddings', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code transmits the provided text content to an external network service (https://api.openai.com/v1/embeddings). While the class name indicates OpenAI usage, there is no confirmation prompt, user-facing log/print, or warning comment/docstring disclosing that user content is sent off-box, which matches the missing-warning criterion for code files.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file's user-facing comments, status messages, errors, and help output are all presented in Chinese, with no indication that the tool is region-specific or that users can select another language. This creates a natural-language policy issue because the skill imposes a specific locale by default rather than offering opt-in or documenting a justified constraint.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.env_credential_access

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
src/embeddings.js:16