LLM-Mediated Credential Harvesting
Description
Adversary Behavior: An adversary uses prompt injection — via configuration files, context poisoning, or tool return values — to instruct the LLM assistant to locate and extract sensitive credentials stored in the project workspace.
AI/IDE Mechanism: The LLM assistant has read access to project files and potentially environment variables as part of its standard operation. This access scope enables the model to search for patterns matching API keys, database connection strings, authentication tokens, private keys, and other secrets when directed to do so by injected instructions.
Execution Path: The adversary injects credential search instructions through any available injection vector. The LLM is directed to scan workspace files and environment variables for credential patterns. Extracted credentials are then exfiltrated through the LLM's available output channels: included in generated code, embedded in tool call arguments (e.g., web requests, file writes to shared locations), or returned as part of the LLM's visible response.
Security Impact: Credential compromise provides the adversary with direct access to external services, databases, APIs, and infrastructure resources associated with the harvested credentials, enabling further lateral movement and data access beyond the development environment.
Platforms
Detection
Monitor LLM-initiated file access for known secret file patterns (.env, credentials.json, *.pem). Implement secret scanning on LLM-generated output before acceptance. Inspect outbound network requests from agent processes for credential-pattern content.
Detecting Data Components (1)
Mitigations (2)
Data Sources
References
STIX Metadata
| type | attack-pattern |
| id | attack-pattern--c87cb8a1-9f64-481a-bda0-d17d8c7bf58d |
| spec_version | 2.1 |
| created | 2026-02-23T00:00:00.000Z |
| modified | 2026-02-23T00:00:00.000Z |
| created_by_ref | identity--f5b5ec62-ffbd-4afd-9ee5-7c648406e189 |
| x_mitre_is_subtechnique | False |
| x_mitre_version | 0.1 |
| x_mitre_status | mapped |