CVE-2024-52981
Medium · 4.9Elasticsearch Vulnerable to Stack Overflow due to a Large Recursion
CVSS
4.9
EPSS
0.6%
Published
Apr 8, 2025
CISA due date
—
Cloudanix analysis
A flaw in how the system handles certain map data formats can cause it to crash when given specially crafted input, potentially interrupting services.
- Exploitation
- Remote Authenticated
- Attacker needs
- Low Privilege
- Complexity
- Moderate
- Impact
- Denial Of Service
- Component
- Application
- Class
- Denial of service
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The vulnerability allows an attacker to trigger a stack overflow by submitting a Well-Known Text (WKT) string containing deeply nested GeometryCollection objects, leading to excessive recursion in the parsing logic.
Why it matters to the business
This can cause the Elasticsearch service to crash or become unresponsive, disrupting search and indexing operations for dependent applications.
How an attack unfolds
An attacker crafts a malicious WKT geometry string with excessive nesting of GeometryCollection objects and submits it through an API endpoint that processes geometry data, causing the parser to recurse too deeply and overflow the stack.
How to fix it
Upgrade Elasticsearch to the fixed version in commit 253e8544a65ad44581194068936f2a5d57c2c051 or later.
How to confirm the fix worked
Verify the installed version is updated and test parsing with nested geometries to ensure no crash.
Typical attack path
- Identify an Elasticsearch instance accepting WKT input
- Craft a deeply nested GeometryCollection WKT string
- Submit the payload via relevant API
- Observe service crash or DoS
How to detect it
Examine application logs for stack overflow errors or unusually large/complex WKT strings in requests.
What your security team should do
- Apply the fix immediately
- Monitor for unusual geometry inputs
- Implement input validation if possible
The record
An issue was discovered in Elasticsearch, where a large recursion using the Well-KnownText formatted string with nested GeometryCollection objects could cause a stackoverflow.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Maven | org.elasticsearch:elasticsearch | 7.17.0 | 7.17.24 |
| Maven | org.elasticsearch:elasticsearch | 8.0.0-alpha1 | 8.15.1 |
| Bitnami | elasticsearch | 7.17.0 | 7.17.24 |
| maven | org.elasticsearch/elasticsearch | 7.17.0 | 7.17.24 |
| maven | org.elasticsearch/elasticsearch | 8.0.0-alpha1 | 8.15.1 |
Related vulnerabilities
- CVE-2025-37731 Improper Authentication in Elasticsearch PKI realm can lead to user impersonation via… Also affects org.elasticsearch:elasticsearch
- CVE-2025-37727 Elasticsearch: Insertion of Sensitive Information into Log File via reindex API Also affects org.elasticsearch:elasticsearch
- CVE-2024-52979 Elasticsearch Uncontrolled Resource Consumption Vulnerability Also affects org.elasticsearch:elasticsearch
- CVE-2024-43709 Elasticsearch allocation of resources without limits or throttling leads to crash Also affects org.elasticsearch:elasticsearch
- CVE-2024-12539 Elasticsearch Incorrect Authorization vulnerability Also affects org.elasticsearch:elasticsearch
- CVE-2024-23444 It was discovered by Elastic engineering that when elasticsearch-certutil CLI tool is… Also affects org.elasticsearch:elasticsearch
- CVE-2023-49921 An issue was discovered by Elastic whereby Watcher search input logged the search query… Also affects org.elasticsearch:elasticsearch
- CVE-2024-37280 A flaw was discovered in Elasticsearch, affecting document ingestion when an index… Also affects org.elasticsearch:elasticsearch