CVE-2020-8446
OSSEC vulnerability analysis and mitigation

Overview

In OSSEC-HIDS versions 2.7 through 3.5.0, the server component responsible for log analysis (ossec-analysisd) contains a path traversal vulnerability with write access. This vulnerability can be exploited via crafted syscheck messages written directly to the analysisd UNIX domain socket by a local user (CVE Details, GitHub Issue).

Technical details

The vulnerability exists in the syscheck decoder (src/analysisd/decoders/syscheck.c) where unsafe path handling is performed using the received agent name when trying to get the agent file. The DB_File function uses the unsanitized agent name when building a file name to be used with fopen, allowing for path traversal. The issue occurs when processing syscheck messages, where an attacker can manipulate the path to write files in attacker-controlled locations within the chroot (GitHub Issue).

Impact

The vulnerability allows local attackers to write files in arbitrary locations within the chroot environment by manipulating the path through crafted syscheck messages. Remote attackers cannot fully exploit this vulnerability as ossec-remoted ensures the prefix of agent name and source IP is always present (GitHub Issue).

Exploitability

The vulnerability is primarily exploitable by local attackers who can write directly to the ossec queue. This allows full control of the lf->location used as the agent argument to fopen, enabling the creation of syscheck DB files in attacker-controlled locations within the chroot (GitHub Issue).

Mitigation and workarounds

The vulnerability was fixed in OSSEC-HIDS version 3.6.0. Users should upgrade to this version or later to address the issue. The suggested fix involves using the w_ref_parent_folder function from src/shared/file_op.c on the location field populated by OS_CleanMSG and rejecting any values that have a 1 return from that function (Gentoo Security, GitHub Issue).

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
  • cpe:2.3:a:ossec:ossec
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