CVE-2021-28040
OSSEC vulnerability analysis and mitigation

Overview

An uncontrolled recursion vulnerability was discovered in OSSEC 3.6.0 (CVE-2021-28040). The vulnerability exists in the os_xml.c file where the _ReadElem() function allows unlimited recursion when processing XML tags. The issue was discovered and disclosed in February 2021 (GitHub Issue).

Technical details

The vulnerability occurs in the XML parsing library (os_xml.c) used by OSSEC. The _ReadElem() function does not implement any recursion limits when processing nested XML tags. When a large number of opening and closing XML tags (<>) are used, the function enters an uncontrolled recursive state. Because recursion is used without restriction, each nested tag causes another stack frame to be allocated until the stack space is exhausted, ultimately leading to a segmentation fault when unmapped memory is accessed (GitHub Issue).

Impact

When exploited, this vulnerability can cause a Denial of Service (DoS) condition through a segmentation fault (SIGSEGV) by exhausting the stack memory. This can lead to a crash of the OSSEC service processing the malicious XML input (GitHub Issue).

Exploitability

The vulnerability can be triggered by providing a specially crafted XML file containing a large number of nested XML tags. A proof-of-concept exploit has been publicly documented that demonstrates how to trigger the stack overflow condition (GitHub Issue).

Mitigation and workarounds

The vulnerability affects OSSEC version 3.6.0. Users should upgrade to a patched version when available. No specific workarounds have been publicly documented (NVD).

Additional resources


SourceThis report was generated using AI

Related OSSEC vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2020-8447CRITICAL9.8
  • OSSEC logoOSSEC
  • net-analyzer/ossec-hids
NoYesJan 30, 2020
CVE-2020-8445CRITICAL9.8
  • OSSEC logoOSSEC
  • cpe:2.3:a:ossec:ossec
NoYesJan 30, 2020
CVE-2021-28040HIGH7.5
  • OSSEC logoOSSEC
  • cpe:2.3:a:ossec:ossec
NoYesMar 05, 2021
CVE-2020-8448MEDIUM5.5
  • OSSEC logoOSSEC
  • cpe:2.3:a:ossec:ossec
NoYesJan 30, 2020
CVE-2020-8446MEDIUM5.5
  • OSSEC logoOSSEC
  • net-analyzer/ossec-hids
NoYesJan 30, 2020

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management