CVE-2021-26814: Wazuh Remote Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-w36g-q975-37rg
CVSS 8.8
CWE-20
Published
Advisory Summary

CVE-2021-26814 is a HIGH (CVSS 8.8) remote code execution vulnerability (CWE-20: Improper Input Validation) affecting Wazuh libraries in the npm ecosystem. The issue involves improper input validation (rce). Remediation is available by upgrading affected packages to version 4.0.4.

CVE-2021-26814 at a Glance

CVE Identifier CVE-2021-26814
GHSA Identifier GHSA-w36g-q975-37rg
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-20: Improper Input Validation
Affected Product Wazuh
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2021-26814

To remediate this vulnerability, upgrade all affected Wazuh dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

wazuh fixed: 4.0.4
npm install wazuh@4.0.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls wazuh

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2021-26814, inspect your project dependencies using npm:

npm ls wazuh

Analyze the terminal output to locate any version of Wazuh in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.0.4), your application is affected.

Note: The npm ls wazuh command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Wazuh, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Wazuh API in Wazuh from 4.0.0 to 4.0.3 allows authenticated users to execute arbitrary code with administrative privileges via /manager/files URI. An authenticated user to the service may exploit incomplete input validation on the /manager/files API to inject arbitrary code within the API service script.

CVE-2021-26814 Affected Wazuh Versions

1 component(s)
Fixed Versions:
4.0.4
Product / Package Ecosystem Affected Versions Fixed Version
wazuh
npm
≥ 4.0.0
< 4.0.4
4.0.4

References

Frequently Asked Questions

What is CVE-2021-26814?
CVE-2021-26814 is a security vulnerability in Wazuh involving Improper Input Validation (RCE) under CWE-20: Improper Input Validation.
Which Wazuh versions are affected?
Affected versions include releases prior to 4.0.4 across affected packages: wazuh.
What version fixes CVE-2021-26814?
Upgrading to 4.0.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is wazuh affected?
Yes, wazuh is affected in releases prior to 4.0.4. Upgrade your dependency to 4.0.4 or later.
What is the CVSS score of CVE-2021-26814?
CVE-2021-26814 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2021-26814?
CVE-2021-26814 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check npm dependencies for CVE-2021-26814?
Run the dependency tree command: 'npm ls wazuh'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-w36g-q975-37rg",
  "modified" : "2021-03-12T22:48:12Z",
  "published" : "2021-03-18T19:30:20Z",
  "aliases" : [ "CVE-2021-26814" ],
  "summary" : "Improper Input Validation (RCE)",
  "details" : "Wazuh API in Wazuh from 4.0.0 to 4.0.3 allows authenticated users to execute arbitrary code with administrative privileges via /manager/files URI. An authenticated user to the service may exploit incomplete input validation on the /manager/files API to inject arbitrary code within the API service script.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "wazuh"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.0.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.0.3"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-26814"
  }, {
    "type" : "WEB",
    "url" : "https://documentation.wazuh.com/4.0/release-notes/release_4_0_4.html"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/wazuh/wazuh/releases/tag/v4.0.4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-03-12T22:48:12Z",
    "nvd_published_at" : "2021-03-06T02:15:00Z"
  }
}