CVE-2021-22148

8.8 HIGH

📋 TL;DR

This vulnerability in Elastic Enterprise Search App Search allows API keys to access engines beyond their intended scope. A less privileged user could gain unauthorized access to engines they shouldn't have permissions for. This affects all Elastic Enterprise Search App Search versions before 7.14.0.

💻 Affected Systems

Products:
  • Elastic Enterprise Search App Search
Versions: All versions before 7.14.0
Operating Systems: All supported platforms
Default Config Vulnerable: ⚠️ Yes
Notes: Affects all deployments using API keys with engine-specific permissions.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Privilege escalation leading to unauthorized access to sensitive data across all engines, potentially resulting in data exfiltration or manipulation.

🟠

Likely Case

Unauthorized access to some engines beyond user's intended permissions, potentially exposing sensitive business data.

🟢

If Mitigated

Limited impact with proper access controls and monitoring, but still represents a privilege escalation risk.

🌐 Internet-Facing: HIGH
🏢 Internal Only: HIGH

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires valid API key credentials but minimal technical skill to abuse the misconfigured permissions.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 7.14.0 and later

Vendor Advisory: https://discuss.elastic.co/t/elastic-stack-7-14-0-security-update/280344

Restart Required: Yes

Instructions:

1. Backup your configuration and data. 2. Upgrade Elastic Enterprise Search App Search to version 7.14.0 or later. 3. Restart the service. 4. Regenerate all API keys to ensure proper engine binding.

🔧 Temporary Workarounds

API Key Rotation

all

Regularly rotate all API keys to limit exposure window

curl -X POST -H "Authorization: Bearer <admin_token>" https://<appsearch_host>:<port>/api/as/v1/credentials/<key_id>/regenerate

🧯 If You Can't Patch

  • Implement strict network segmentation to limit access to App Search instances
  • Enforce principle of least privilege and monitor all API key usage patterns

🔍 How to Verify

Check if Vulnerable:

Check App Search version via API: curl -X GET https://<appsearch_host>:<port>/api/as/v1/engines

Check Version:

curl -X GET https://<appsearch_host>:<port>/api/as/v1/engines | grep version

Verify Fix Applied:

Verify version is 7.14.0 or later and test API key permissions are properly scoped to intended engines

📡 Detection & Monitoring

Log Indicators:

  • API key accessing multiple engines in short timeframes
  • Unusual engine access patterns from single API key

Network Indicators:

  • Multiple engine API calls from single source in rapid succession

SIEM Query:

source="appsearch" AND ("engine" OR "api_key") | stats count by src_ip, api_key, engine

🔗 References

📤 Share & Export