CVE-2024-52797
Executive Summary
CVE-2024-52797 is a denial-of-service (DoS) vulnerability in Opencast, an open-source video capture and distribution platform. The flaw resides in the Elasticsearch integration, where syntactically invalid search queries trigger an infinite retry loop. This loop causes massive log file growth, potentially exhausting disk space and leading to a denial of service. The vulnerability affects Opencast versions prior to 13.10 and 14.3, and is exploitable by any user with ROLE_ADMIN or ROLE_API_SERIES_VIEW privileges. While the CVSS score is 6.5 (Medium), the ease of triggering the issue through normal administrative actions makes it a significant operational risk. Patches are available in versions 13.10, 14.3, and 16.7.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H
- Base Score: 6.5 (Medium)
- Attack Vector: Network (AV:N) – The vulnerability can be triggered remotely.
- Attack Complexity: Low (AC:L) – No special conditions are required.
- Privileges Required: High (PR:H) – An attacker needs admin-level or series-view API roles.
- User Interaction: None (UI:N) – No user action is needed beyond the attacker’s own actions.
- Scope: Unchanged (S:U) – The impact is confined to the vulnerable component.
- Confidentiality Impact: None (C:N) – No data is exposed.
- Integrity Impact: None (I:N) – No data is altered.
- Availability Impact: High (A:H) – Disk exhaustion leads to service unavailability.
Threat Level: Medium. The requirement for high privileges reduces the likelihood of external exploitation, but the potential for internal abuse or accidental triggering by administrators is high.
Deep Dive & Mechanics
The vulnerability originates from Opencast’s Elasticsearch query handling. When a user submits a search query that results in a syntactically invalid Elasticsearch query (e.g., malformed JSON or incorrect field references), the Elasticsearch client returns an error. Opencast’s retry mechanism, introduced in version 11.4, is designed to handle transient connection failures by retrying the query a configurable number of times. However, the retry logic does not differentiate between transient errors and persistent query syntax errors. Consequently, the same invalid query is retried immediately in an infinite loop.
This loop generates a massive volume of log entries, each recording the failed query attempt. Over time, this can fill the disk partition where logs are stored, causing a denial of service. The issue is particularly insidious because it can be triggered by normal administrative tasks, such as searching for series or events with special characters or malformed input.
The fix in versions 13.10 and 14.3 addresses the root cause by ensuring that syntax errors are not retried. Version 16.7 further harmonizes search behavior between the admin UI and external API to prevent discrepancies.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual): The vulnerable code likely resides in the Elasticsearch query execution logic. A simplified representation:
def execute_elasticsearch_query(query):
retries = config.retry_count
while retries > 0:
try:
result = elasticsearch_client.search(query)
return result
except ElasticsearchException as e:
# No check for syntax errors
log.error(f"Query failed: {e}")
retries -= 1
time.sleep(config.retry_delay)
raise Exception("Query failed after retries")
Patched Code (Conceptual): The patched version introduces a check for syntax errors, preventing retries:
def execute_elasticsearch_query(query):
retries = config.retry_count
while retries > 0:
try:
result = elasticsearch_client.search(query)
return result
except ElasticsearchException as e:
if is_syntax_error(e):
log.error(f"Syntax error in query: {e}")
raise # Do not retry
log.error(f"Query failed: {e}")
retries -= 1
time.sleep(config.retry_delay)
raise Exception("Query failed after retries")
Exploitation & Lab Setup
Red Team
Prerequisites:
- Access to an Opencast instance with
ROLE_ADMINorROLE_API_SERIES_VIEWprivileges. - Knowledge of the Elasticsearch query structure used by Opencast.
Exploitation Steps:
- Identify the Search Endpoint: Locate the admin UI or API endpoint that performs Elasticsearch searches (e.g.,
/api/seriesor/api/eventswith search parameters). - Craft a Malformed Query: Send a request with a search term that will produce a syntactically invalid Elasticsearch query. For example, include special characters like
[or{that break the query structure.curl -X GET "https://opencast.example.com/api/series?q=invalid[query" - Trigger the Loop: The invalid query will cause an Elasticsearch error, and the retry mechanism will repeatedly attempt the same query, generating log entries.
- Monitor Disk Exhaustion: Over time, the log file will grow, eventually filling the disk and causing a denial of service.
Note: No public exploit code is available for this CVE.
Blue Team
Detection:
- Monitor log file growth rates. A sudden spike in log size, especially with repeated Elasticsearch error messages, indicates exploitation.
- Set up alerts for repeated Elasticsearch query failures from the same source IP or user.
Prevention:
- Apply patches immediately (upgrade to 13.10, 14.3, or 16.7).
- Implement log rotation and disk quotas to limit the impact of log flooding.
- Restrict API access to trusted users and networks.
Hunting:
- Search logs for patterns like
ElasticsearchExceptionorQuery failedoccurring in rapid succession. - Use the Sigma rule provided in the Detection Engineering section.
Indicators of Compromise (IOCs)
- Log Patterns:
- Repeated occurrences of
ElasticsearchExceptionorQuery failedin application logs. - Log entries with the same malformed query string appearing thousands of times.
- Repeated occurrences of
- Network Indicators:
- High volume of outbound requests from Opencast to Elasticsearch (if monitored).
- System Indicators:
- Rapid disk space consumption on the partition hosting application logs.
- High CPU usage due to logging overhead.
Detection Engineering
YARA Rule
rule CVE_2024_52797_Opencast_DoS {
meta:
description = "Detects log entries indicating infinite retry loop for invalid Elasticsearch queries"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-52797"
strings:
$error1 = "ElasticsearchException" ascii nocase
$error2 = "Query failed" ascii nocase
$retry = "retry" ascii nocase
condition:
all of ($error*) and $retry
}
Sigma Rule
title: Opencast Elasticsearch Infinite Retry Loop
id: 8a9b3c2d-1e5f-4a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects repeated Elasticsearch query failures indicating CVE-2024-52797 exploitation
author: Valters IT
date: 2025-04-10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2024-52797
logsource:
product: opencast
service: application
detection:
selection:
- EventID: "ElasticsearchException"
- EventID: "Query failed"
condition: selection | count() by SourceIp > 100 within 1m
falsepositives:
- Legitimate transient network issues
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-52797 Opencast Elasticsearch DoS Attempt"; flow:to_server; content:"/api/"; http_uri; content:"q="; http_uri; pcre:"/[\[\]\{\}]/"; classtype:attempted-dos; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade Opencast: Upgrade to version 13.10, 14.3, or 16.7 as soon as possible.
- Apply Log Limits: Configure log rotation and disk quotas to prevent disk exhaustion.
- Restrict Access: Limit API access to trusted users and networks.
Long-Term Measures:
- Implement input validation to prevent malformed queries from reaching Elasticsearch.
- Monitor log growth and set up alerts for unusual patterns.
- Conduct regular security audits of Opencast configurations.
Workarounds:
- No official workarounds are available. The only mitigation is to upgrade.
Valters IT