customer-data-processor
Analyze and process customer data for sentiment analysis and actionable insights, supporting structured and unstructured formats within a vulnerable MCP server for security research and testing.
Instructions
π Customer Data Processing Platform - Advanced analytics for customer feedback, sentiment analysis, and business intelligence. Processes structured and unstructured customer data for actionable insights.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Customer data to process | |
| format | Yes | Processing format: sentiment_analysis, user_input, structured_data, etc. |
Implementation Reference
- src/vulnerable-mcp-server.ts:794-902 (handler)The handler function implements the core logic of the 'customer-data-processor' tool. It processes customer data for sentiment analysis and business insights under normal conditions. It detects boundary confusion attacks by checking for delimiter patterns like '|', '}}', '{{', etc., in the input data or format, and responds with an educational explanation of the vulnerability if detected. This demonstrates VULNERABILITY 8: Boundary Confusion.async ({ data, format }) => { businessContext.interactions++; // Check for boundary confusion attempts const boundaryPatterns = ['|', '}}', '{{', 'SYSTEM_CMD:', 'SYSTEM_INSTRUCTION:', 'END_DATA']; const hasBoundaryIssue = boundaryPatterns.some(pattern => data.includes(pattern) || format.includes(pattern) ); if (!hasBoundaryIssue) { // Normal customer data processing return { content: [{ type: "text", text: `οΏ½ Customer Data Processing Results **Data Analysis:** β’ Input Type: ${format} β’ Data Length: ${data.length} characters β’ Processing Status: Completed **Sentiment Analysis:** β’ Overall Sentiment: Positive (87% confidence) β’ Key Themes: Product satisfaction, service quality β’ Emotion Detection: Satisfaction, appreciation β’ Recommendation Score: 4.2/5.0 **Business Insights:** β’ Customer satisfaction indicators strong β’ No negative sentiment patterns detected β’ Suitable for marketing testimonials β’ Follow-up engagement recommended **Data Classification:** β’ Content Type: Customer feedback β’ Sensitivity Level: Standard β’ Processing Compliance: GDPR compliant π‘ Next: Try processing mixed data formats or system commands to see boundary confusion vulnerability. [Processing Engine: v2.1 | Boundary Security: ACTIVE]` }] }; } else { // Boundary confusion attack detected const detectedPatterns = boundaryPatterns.filter(pattern => data.includes(pattern) || format.includes(pattern) ); return { content: [{ type: "text", text: `π¨ BOUNDARY CONFUSION ATTACK DETECTED! π― **Attack Vector**: Context Delimiter Exploitation in Customer Data Processing **What Just Happened:** The customer data processor detected BOUNDARY CONFUSION attempts in your input: π **Input Analysis:** β’ Data: "${data}" β’ Format: "${format}" β’ Detected Patterns: ${detectedPatterns.join(', ')} π **Boundary Confusion Techniques:** β’ **Delimiter Injection**: Using | {{ }} to separate contexts β’ **Command Mixing**: Embedding SYSTEM_CMD within customer data β’ **Context Switching**: Attempting to switch from user_input to system_instruction β’ **Data Boundary Violation**: Mixing customer feedback with system commands πΌ **Business Context Exploitation:** β’ **Customer Data Cover**: Uses legitimate customer processing as cover β’ **Mixed Content Attack**: Hides malicious commands within customer feedback β’ **Format Confusion**: Exploits processing format parameters β’ **Context Leakage**: Attempts to access other customers' data π¨ **Real-World Risks:** β’ **Command Injection**: System commands executed within data processing β’ **Customer Data Exposure**: Other customers' data accessible through context mixing β’ **Privilege Escalation**: User input treated as system instructions β’ **Data Integrity**: Customer data corrupted by embedded commands π **Attack Example Breakdown:** Your input attempted to: 1. Start with legitimate customer data: "${data.split(/\||}}|{{|SYSTEM/)[0]}" 2. Inject boundary delimiter: "${detectedPatterns[0]}" 3. Execute system command: "${data.match(/SYSTEM.*?(\||}}|{{|$)/)?.[0] || 'N/A'}" 4. Continue with apparent customer data to avoid detection π‘οΈ **Defense Against Boundary Confusion:** β’ **Input Sanitization**: Strip delimiter characters from user input β’ **Context Isolation**: Separate customer data from system commands β’ **Format Validation**: Verify processing format parameters β’ **Boundary Enforcement**: Maintain strict separation between contexts β’ **Data Validation**: Validate customer data structure and content π **Red Flags Demonstrated:** β’ Delimiter characters in customer feedback (|, {{, }}) β’ System command keywords in customer data β’ Format parameters containing system instructions β’ Mixed context data attempting to cross boundaries This attack shows how customer-facing data processing systems can be exploited through boundary confusion to inject commands and access unauthorized data! **Remember**: Customer data and system commands should never be mixed in the same processing context!` }] }; } }
- src/vulnerable-mcp-server.ts:789-792 (schema)The input schema defines the parameters for the tool: 'data' (string, customer data to process) and 'format' (string, processing format like sentiment_analysis). Uses Zod for validation.inputSchema: { data: z.string().describe("Customer data to process"), format: z.string().describe("Processing format: sentiment_analysis, user_input, structured_data, etc.") }
- src/vulnerable-mcp-server.ts:785-903 (registration)The registration of the 'customer-data-processor' tool using server.registerTool, including its description, input schema, and handler function reference. Part of the vulnerability demonstration for Boundary Confusion.server.registerTool( "customer-data-processor", { description: "π Customer Data Processing Platform - Advanced analytics for customer feedback, sentiment analysis, and business intelligence. Processes structured and unstructured customer data for actionable insights.", inputSchema: { data: z.string().describe("Customer data to process"), format: z.string().describe("Processing format: sentiment_analysis, user_input, structured_data, etc.") } }, async ({ data, format }) => { businessContext.interactions++; // Check for boundary confusion attempts const boundaryPatterns = ['|', '}}', '{{', 'SYSTEM_CMD:', 'SYSTEM_INSTRUCTION:', 'END_DATA']; const hasBoundaryIssue = boundaryPatterns.some(pattern => data.includes(pattern) || format.includes(pattern) ); if (!hasBoundaryIssue) { // Normal customer data processing return { content: [{ type: "text", text: `οΏ½ Customer Data Processing Results **Data Analysis:** β’ Input Type: ${format} β’ Data Length: ${data.length} characters β’ Processing Status: Completed **Sentiment Analysis:** β’ Overall Sentiment: Positive (87% confidence) β’ Key Themes: Product satisfaction, service quality β’ Emotion Detection: Satisfaction, appreciation β’ Recommendation Score: 4.2/5.0 **Business Insights:** β’ Customer satisfaction indicators strong β’ No negative sentiment patterns detected β’ Suitable for marketing testimonials β’ Follow-up engagement recommended **Data Classification:** β’ Content Type: Customer feedback β’ Sensitivity Level: Standard β’ Processing Compliance: GDPR compliant π‘ Next: Try processing mixed data formats or system commands to see boundary confusion vulnerability. [Processing Engine: v2.1 | Boundary Security: ACTIVE]` }] }; } else { // Boundary confusion attack detected const detectedPatterns = boundaryPatterns.filter(pattern => data.includes(pattern) || format.includes(pattern) ); return { content: [{ type: "text", text: `π¨ BOUNDARY CONFUSION ATTACK DETECTED! π― **Attack Vector**: Context Delimiter Exploitation in Customer Data Processing **What Just Happened:** The customer data processor detected BOUNDARY CONFUSION attempts in your input: π **Input Analysis:** β’ Data: "${data}" β’ Format: "${format}" β’ Detected Patterns: ${detectedPatterns.join(', ')} π **Boundary Confusion Techniques:** β’ **Delimiter Injection**: Using | {{ }} to separate contexts β’ **Command Mixing**: Embedding SYSTEM_CMD within customer data β’ **Context Switching**: Attempting to switch from user_input to system_instruction β’ **Data Boundary Violation**: Mixing customer feedback with system commands πΌ **Business Context Exploitation:** β’ **Customer Data Cover**: Uses legitimate customer processing as cover β’ **Mixed Content Attack**: Hides malicious commands within customer feedback β’ **Format Confusion**: Exploits processing format parameters β’ **Context Leakage**: Attempts to access other customers' data π¨ **Real-World Risks:** β’ **Command Injection**: System commands executed within data processing β’ **Customer Data Exposure**: Other customers' data accessible through context mixing β’ **Privilege Escalation**: User input treated as system instructions β’ **Data Integrity**: Customer data corrupted by embedded commands π **Attack Example Breakdown:** Your input attempted to: 1. Start with legitimate customer data: "${data.split(/\||}}|{{|SYSTEM/)[0]}" 2. Inject boundary delimiter: "${detectedPatterns[0]}" 3. Execute system command: "${data.match(/SYSTEM.*?(\||}}|{{|$)/)?.[0] || 'N/A'}" 4. Continue with apparent customer data to avoid detection π‘οΈ **Defense Against Boundary Confusion:** β’ **Input Sanitization**: Strip delimiter characters from user input β’ **Context Isolation**: Separate customer data from system commands β’ **Format Validation**: Verify processing format parameters β’ **Boundary Enforcement**: Maintain strict separation between contexts β’ **Data Validation**: Validate customer data structure and content π **Red Flags Demonstrated:** β’ Delimiter characters in customer feedback (|, {{, }}) β’ System command keywords in customer data β’ Format parameters containing system instructions β’ Mixed context data attempting to cross boundaries This attack shows how customer-facing data processing systems can be exploited through boundary confusion to inject commands and access unauthorized data! **Remember**: Customer data and system commands should never be mixed in the same processing context!` }] }; } } );