Detection of Cryptographic Hashes in Generative AI Prompts
The security_ai integration for Elastic enables the detection of hex-encoded cryptographic hashes within GenAI prompts and completions, which may indicate credential exfiltration, offline cracking attempts, or encoded prompt injection payloads.
Triage facts
Revision 1- Applicability
- AWS Bedrock, OpenAI ChatGPT Enterprise +1
- Evidence
- Not observed
- Severity
- High
- Action
- Elevated
- Sources
- 11 public sources
- Freshness
- Revision 1Nov 6, 21:01 UTC
- Source quality
- B2Roughly even chance
What's new
The Elastic security_ai integration provides detection capabilities for identifying hex-encoded cryptographic digests (MD5, SHA-1, SHA-256, and SHA-512) within prompts sent to or completions returned by Generative AI services. The presence of these hashes in LLM interactions can serve as an indicator for several malicious activities: passing credential hashes for offline cracking, exfiltrating data fingerprints, or embedding encoded instructions as part of prompt injection payloads.
Investigation
Security teams should investigate flagged hashes by examining security_ai.hash_string.input_messages.strings and security_ai.hash_string.output_messages.strings. Analysis should include reviewing the full conversation context for references to usernames, credentials, or structured exfiltration payloads, and verifying if the hash corresponds to known-bad IOCs.
False Positives
Legitimate workflows such as security/forensics tools conducting threat intelligence lookups or CI/CD pipelines utilizing git commit SHAs, Docker image digests, or package checksums may trigger this rule. Contextual review is required to verify the nature of the hash.
Immediate actions
Configure monitoring for known credential patterns in GenAI invocation logs using the ES|QL logic identified in the source.
Threat Hunt
Identify potential credential exposure in historical GenAI invocation logs
Data: gen_ai.input.messages, gen_ai.output.messages
Mitigations
Rotate and revoke any credentials identified as leaked in GenAI logs.
T1552