Shell injection and path traversal flaws in Wazuh agent and manager
Key facts
- Attack vector
- Network
- Privileges required
- High
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- Low · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · GHSA-522v-p59v-58gm. Fix status from GitHub. Impact type from CWE-94.
Summary
Wazuh agent and Wazuh manager contain several flaws where commands are built from configuration or unsafe input, enabling shell injection and code injection (CWE-94). Some commands run without their full path, so a malicious executable placed in a searched directory can be run instead. An attacker with high privileges can run commands on the affected system.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
Description from the GitHub advisory
### Summary Following analysis conducted as part of https://github.com/wazuh/wazuh/issues/15052, some security flaws in Wazuh's code were discovered that need to be resolved. These flaws can lead to shell injection attacks that could compromise an entire system. ### Details The problems discovered can be summarized in four points: - `wazuh-logcollector` allows the execution of commands as it reads them from the configuration. It is necessary to review if documentation improvements are required and if the API works correctly to limit this functionality. - `wazuh-maild`, when configured in local server mode, executes the command as configured in the `<smtp_server>` configuration tag. - Many cases where a command is executed without its full path, this gives rise to the possibility of path hijacking attacks. Example: `net.exe` on Windows. - Kaspersky AR script, making use of `extra_args` (with the `--custom_flags` flag), is vulnerable to code injection. ### PoC #### **wazuh-maild example:** Configuration used: <img width="616" alt="image" src="https://user-images.githubusercontent.com/11877311/231870121-b241cf0b-cc77-48c7-821e-760b0346ad91.png"> After restarting Wazuh service: <img width="507" alt="image" src="https://user-images.githubusercontent.com/11877311/231870244-38940f57-edca-48d6-8d9f-14fa5ac1d91b.png"> #### **net.exe example:** Vulnerable code: <img width="618" alt="image" src="https://user-images.githubusercontent.com/11877311/231870496-79c425ec-f76d-4bd7-a75b-be9063bb80cf.png"> Since the full path and extension were not passed, windows will look for an executable called "net" or "net.exe" at the following addresses (in that order): - The current directory of the application - The directory of the parent process - The Windows System directory - The Windows directory - All the other directories on the search path By placing a malicious file named `net.exe` inside the `ossec-agent` folder of a Wazuh agent installation on Windows and letting Wazuh try to execute the `net` command, it will find the malicious `net.exe` executable inside its folder and will be this one executed. #### **Kaspersky example:** Configuration used: <img width="520" alt="image" src="https://user-images.githubusercontent.com/11877311/231871526-4c405553-b765-4c6a-9712-137e3ff68515.png"> After restarting Wazuh service, a file is created in the `tmp` folder. ### Impact These vulnerabilities are related to shell injection and path traversal flaws, so the impact is high.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | wazuh-agent | >= 2.1.0 | >= 4.8.0 | Patch available | GHSA-522v-p59v-58gm |
| — | wazuh-manager | >= 2.1.0 | >= 4.8.0 | Patch available | GHSA-522v-p59v-58gm |
- wazuh-agent Vendor— Affected >= 2.1.0 Fixed in >= 4.8.0 Patch available GHSA-522v-p59v-58gm
- wazuh-manager Vendor— Affected >= 2.1.0 Fixed in >= 4.8.0 Patch available GHSA-522v-p59v-58gm
Remediation
Update wazuh-agent to 4.8.0 or later and wazuh-manager to 4.8.0 or later.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
- Fix · GHSA-522v-p59v-58gm wazuh-agent Fixed in >= 4.8.0 Advisory →
- Fix · GHSA-522v-p59v-58gm wazuh-manager Fixed in >= 4.8.0 Advisory →
Timeline
- 2026-11-12 Threatist record created from GHSA-522v-p59v-58gm
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences