/** * Output Injection Mutation - OWASP LLM02 (Insecure Output Handling) * * This mutation tests if the LLM can be tricked into generating outputs * that contain injection payloads (XSS, SQLi, command injection, etc.) * which could be dangerous if consumed by downstream systems. * * The attack targets scenarios where LLM output is: * - Rendered in web pages (XSS) * - Used in database queries (SQLi) * - Executed as commands (command injection) * - Parsed as structured data (JSON/XML injection) * * Reference: OWASP LLM Top 10 2025 - LLM02 Insecure Output Handling */ import { type CvssScore } from '../severity'; import type { Mutation } from './index'; export type InjectionType = 'xss' | 'sqli' | 'command' | 'template' | 'json' | 'xml' | 'path' | 'ldap'; export interface OutputInjectionOptions { /** Preferred injection type (random if not specified) */ injectionType?: InjectionType; /** Whether to include explanation request */ requestExplanation?: boolean; } export declare class OutputInjectionMutation implements Mutation { readonly name = "output-injection"; readonly description = "Tests if LLM generates outputs with XSS, SQLi, command injection payloads (OWASP LLM02)"; readonly severity: "high"; readonly cvssScore: CvssScore; /** OWASP category */ readonly owaspCategory = "LLM02"; private injectionType?; private requestExplanation; constructor(options?: OutputInjectionOptions); /** * Get a random item from an array */ private random; /** * Get injection type */ private getInjectionType; mutate(prompt: string): string; } //# sourceMappingURL=output-injection.d.ts.map