Threat: Prompt Injection
- Description: An attacker crafts malicious input that, when incorporated into the prompt sent to the LLM, manipulates the LLM's behavior. The attacker might inject commands or instructions within user input to bypass intended logic, extract sensitive information, or force the LLM to perform unintended actions. This is achieved by exploiting the LLM's interpretation of the prompt and its inability to reliably distinguish between intended instructions and malicious injections within user-provided text.
- Impact: Circumvention of application logic, unauthorized access to data, generation of harmful content, data corruption, denial of service, reputational damage.
- Affected Semantic Kernel Component:
SemanticKernel.PromptTemplateEngine
,SemanticKernel.Connectors.AI.ChatCompletion
,SemanticKernel.Connectors.AI.TextCompletion
(any component interacting with LLMs via prompts). - Risk Severity: Critical
- Mitigation Strategies:
- Input validation and sanitization.
- Prompt hardening techniques.
- Output validation and content filtering.
- Rate limiting.
- Principle of least privilege for LLM actions.
Threat: Indirect Prompt Injection
- Description: An attacker injects malicious data into external data sources (databases, websites, files) that are later retrieved and used by Semantic Kernel to construct prompts. When the application retrieves this poisoned data and includes it in a prompt, the LLM is indirectly manipulated by the attacker's injected content, leading to unintended behavior.
- Impact: Similar to direct prompt injection: circumvention of logic, data breaches, harmful content generation, but potentially harder to trace and detect.
- Affected Semantic Kernel Component:
SemanticKernel.Memory
,SemanticKernel.Connectors.Memory.*
,SemanticKernel.Plugins.*
(any component retrieving data from external sources and incorporating it into prompts). - Risk Severity: High
- Mitigation Strategies:
- Input validation and sanitization of external data.
- Content Security Policies for external data sources.
- Careful selection and vetting of data sources.
- Data integrity checks and provenance tracking.
- Description: If the application allows loading and executing native plugins (code-based plugins), an attacker could introduce a malicious plugin. This plugin, if successfully loaded and executed, could contain arbitrary code designed to compromise the application, the underlying system, or access sensitive data.
- Impact: Full system compromise, data breach, denial of service, privilege escalation, malware installation.
- Affected Semantic Kernel Component:
SemanticKernel.Plugins.KernelPluginFactory
,SemanticKernel.Kernel
(plugin loading and execution mechanisms). - Risk Severity: Critical
- Mitigation Strategies:
- Strict plugin vetting and signing processes.
- Sandboxing or isolation of plugin execution environments.
- Principle of least privilege for plugin execution.
- Secure plugin loading mechanisms and input validation.
- Disable native plugin functionality if not strictly required.
- Description: Plugins, both native code-based plugins and semantic plugins (defined by prompts), might contain vulnerabilities. Native plugins can have code vulnerabilities, while semantic plugins can be vulnerable to prompt injection themselves or have logic flaws in their prompt design. Attackers could exploit these vulnerabilities to gain unauthorized access, cause errors, or manipulate application behavior.
- Impact: Varies depending on the vulnerability: information disclosure, code execution (for native plugins), application malfunction, unintended behavior.
- Affected Semantic Kernel Component:
SemanticKernel.Plugins.*
,SemanticKernel.PromptTemplateEngine
,SemanticKernel.Connectors.AI.ChatCompletion
,SemanticKernel.Connectors.AI.TextCompletion
(all plugin related components and LLM interaction points). - Risk Severity: High
- Mitigation Strategies:
- Regular security audits and vulnerability scanning of plugins.
- Secure plugin development practices and prompt engineering.
- Dependency management for native plugins.
- Careful design and testing of semantic plugin prompts.
- Plugin update mechanisms.
- Minimize plugin usage and use trusted plugins only.
Threat: Connector Credential Compromise
- Description: Semantic Kernel relies on connectors to interact with external services (LLMs, databases, APIs). These connectors often require credentials (API keys, access tokens). If these credentials are compromised, attackers can gain unauthorized access to these external services under the application's identity.
- Impact: Unauthorized access to external services, data breaches from connected services, financial costs associated with compromised API usage, reputational damage.
- Affected Semantic Kernel Component:
SemanticKernel.Connectors.*
(all connector components, especially those handling authentication). - Risk Severity: Critical
- Mitigation Strategies:
- Secure storage and management of connector credentials using secrets management systems.
- Principle of least privilege for connector access.
- Regular credential rotation.
- Monitoring for unauthorized API usage.
- Network segmentation.
- Description: The application's functionality depends on the availability and integrity of external services connected through Semantic Kernel connectors. If these external services become unavailable or are compromised, it can disrupt the application's operation or introduce malicious data into the application's workflow.
- Impact: Denial of service, application malfunction, introduction of malicious data into the application's workflow, data corruption.
- Affected Semantic Kernel Component:
SemanticKernel.Connectors.*
(all connector components), Application Logic relying on external services. - Risk Severity: High
- Mitigation Strategies:
- Implement robust error handling and fallback mechanisms.
- Monitor the health and availability of external services.
- Consider using redundant or alternative services.
- Validate data received from external services.
- Caching to reduce external service dependency.
- Description: Semantic Kernel can use memory connectors (vector databases, in-memory stores) to store and retrieve information, including potentially sensitive data. If this memory storage is not properly secured, sensitive data could be exposed to unauthorized users or attackers.
- Impact: Data breaches, privacy violations, compliance violations, reputational damage.
- Affected Semantic Kernel Component:
SemanticKernel.Memory
,SemanticKernel.Connectors.Memory.*
(memory connectors and related components). - Risk Severity: Critical
- Mitigation Strategies:
- Access control mechanisms for memory storage.
- Encryption of data at rest and in transit.
- Data minimization.
- Regular security audits of memory storage configurations.
- Secure deployment and infrastructure.
- Description: An attacker injects malicious or misleading data into the memory/vector database used by Semantic Kernel. This poisoned data, when retrieved by the application, can lead to incorrect, biased, or harmful outputs.
- Impact: Application malfunction, generation of incorrect or harmful content, manipulation of application behavior, data corruption, reputational damage.
- Affected Semantic Kernel Component:
SemanticKernel.Memory
,SemanticKernel.Connectors.Memory.*
(memory connectors and data ingestion processes). - Risk Severity: High
- Mitigation Strategies:
- Input validation and sanitization before storing data in memory.
- Access control to prevent unauthorized data modification.
- Data integrity checks and provenance tracking.
- Regular monitoring of memory data for anomalies.
Threat: Insecure Default Configurations
- Description: Semantic Kernel components or related dependencies might have insecure default configurations that are not hardened for production environments. These defaults could expose vulnerabilities, weaken security controls, or make the application easier to attack.
- Impact: Increased attack surface, easier exploitation of vulnerabilities, potential for data breaches or system compromise.
- Affected Semantic Kernel Component:
SemanticKernel.*
,SemanticKernel.Connectors.*
, Dependencies of Semantic Kernel. (All components and dependencies with configurable settings). - Risk Severity: High
- Mitigation Strategies:
- Review and harden default configurations.
- Follow security best practices for configuration management.
- Use secure configuration templates.
- Regularly audit configurations.
- Description: Incorrect configuration of Semantic Kernel components (connectors, planners, memory, etc.) can introduce vulnerabilities or weaken security controls.
- Impact: Varies depending on the misconfiguration: information disclosure, unauthorized access, denial of service, application malfunction.
- Affected Semantic Kernel Component:
SemanticKernel.*
,SemanticKernel.Connectors.*
(All configurable components). - Risk Severity: High
- Mitigation Strategies:
- Thorough testing and validation of configurations.
- Use infrastructure-as-code for consistent and auditable configurations.
- Provide clear documentation and guidance on secure configuration practices.
- Automated configuration checks.
- Principle of least privilege in configuration.
Threat: Dependency Vulnerabilities
- Description: Semantic Kernel relies on various third-party libraries and dependencies. Vulnerabilities in these dependencies could be exploited to compromise the application.
- Impact: Varies depending on the vulnerability: information disclosure, remote code execution, denial of service, system compromise.
- Affected Semantic Kernel Component: Dependencies of
SemanticKernel
(Third-party libraries used by Semantic Kernel). - Risk Severity: Critical
- Mitigation Strategies:
- Regularly scan dependencies for vulnerabilities using dependency scanning tools.
- Keep dependencies up-to-date.
- Use dependency management tools.
- Implement a vulnerability management process and Software Composition Analysis (SCA).