Wazuh MCP Server v4.1.0
What's New in v4.1.0
This release delivers a comprehensive security and reliability audit, addressing 17 issues across the entire stack — from critical security vulnerabilities and runtime bugs to dependency corrections and CI/CD pipeline fixes.
Security Hardening (6 fixes)
- X-Forwarded-For IP spoofing prevention — The
get_client_ipmethod previously returned the first IP in theX-Forwarded-Forchain, which is attacker-controlled. It now correctly returns the rightmost untrusted IP, closing a rate-limit bypass vector. - OAuth token revocation now authenticates callers — The
/oauth/revokeendpoint previously accepted requests from any party without validating client credentials. It now enforces client authentication per RFC 7009. - Redis credential leakage eliminated — Connection error logs no longer include the full Redis URL, which may contain passwords.
- Health endpoint information disclosure hardened — Internal error messages from Wazuh Manager and Indexer connectivity checks are no longer exposed to unauthenticated callers on
/health. - Token validation null safety —
validate_token()no longer throws an unhandledAttributeErrorwhen called withNone. - Trusted proxy set corrected — An empty
TRUSTED_PROXIESenvironment variable no longer inadvertently includes an empty string in the trusted proxy set.
Bug Fixes (6 fixes)
- JSON-RPC batch crash on malformed items — Non-dict entries in batch requests now return proper JSON-RPC error objects instead of crashing the entire batch with an unhandled
TypeError. process_idsilent default eliminated —wazuh_kill_processandwazuh_check_processnow correctly require theprocess_idparameter. Previously, omitting it would silently default to PID 100.- Session deletion returns proper 404 — The
DELETE /mcphandler now correctly returns404 Not Foundfor non-existent sessions. The previousexcept KeyErrorhandler was unreachable. - SSE metrics accuracy — Request status code metrics are now recorded after processing completes. Previously, all requests were counted as
200regardless of actual outcome. - Indexer client resource leak on re-initialization —
WazuhIndexerClient.initialize()now closes the existinghttpx.AsyncClientbefore creating a new one, preventing leaked connections. - Redis session store race condition —
RedisSessionStore._ensure_initializednow uses anasyncio.Lockto prevent concurrent coroutines from double-initializing the Redis connection.
Dependency Corrections (2 fixes)
- JWT library migrated from
python-josetopyjwt— The previous dependency onpython-jose>=3.5.0was unsatisfiable (version 3.5.0 was never released on PyPI, and the project is abandoned). Replaced with the actively maintainedpyjwt[crypto]>=2.9.0. cryptographyversion constraint fixed — Changed from>=46.0.5(which does not exist) to>=44.0.0.
CI/CD Pipeline Fixes (7 fixes)
- Docker release workflow now triggers correctly — The condition was checking for a non-existent
mcp-remotebranch; it now triggers on all tag pushes. - Semgrep action migrated — Moved from the deprecated
returntocorp/semgrep-actiontosemgrep/semgrep-action. - Security scanner versions pinned — Trivy action pinned to
v0.31.0(was@master), TruffleHog pinned tov3.88.0(was@main), Gitleaks updated fromv8.18.4tov8.21.2. - Build job now gated on all checks — The build job now depends on lint, test, and syntax-check (previously only syntax-check).
- Unused mypy install removed from the CI lint job.
- Docker build action updated from
v5tov6.
Infrastructure
- Version synchronized across all 5 files (
pyproject.toml,__init__.py,Dockerfile,compose.yml,requirements.txt) — several were still referencing4.0.7. - Stale branch references cleaned up — All
mcp-remotereferences in Dockerfile labels, compose labels, and OCI metadata updated tomain. - Dockerfile improvements — Trivy flag updated from deprecated
--security-checksto--scanners; misleadingPYTHONFAULTHANDLERcomment corrected. - Docker Compose hardened — Removed unnecessary
NET_BIND_SERVICEcapability (port 3000 does not require it); removed unused volume definition. - README corrected — Python version badge updated from
3.13+to3.11+to matchrequires-python = ">=3.11".
Compatibility
| Component | Supported Versions |
|---|---|
| Python | 3.11, 3.12, 3.13 |
| Wazuh | 4.8.0 – 4.14.3 |
| MCP Protocol | 2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25 |
Upgrade Notes
- Breaking dependency change:
python-josehas been replaced withpyjwt[crypto]. If you have arequirements.txtor lockfile that pinspython-jose, update it topyjwt[crypto]>=2.9.0. - All other changes are backwards-compatible. No configuration changes are required.
Full Changelog: https://github.com/gensecaihq/Wazuh-MCP-Server/blob/main/CHANGELOG.md