Skip to content

Wazuh MCP Server v4.1.0

Choose a tag to compare

@alokemajumder alokemajumder released this 11 Mar 08:06
· 126 commits to main since this release

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_ip method previously returned the first IP in the X-Forwarded-For chain, 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/revoke endpoint 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 safetyvalidate_token() no longer throws an unhandled AttributeError when called with None.
  • Trusted proxy set corrected — An empty TRUSTED_PROXIES environment 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_id silent default eliminatedwazuh_kill_process and wazuh_check_process now correctly require the process_id parameter. Previously, omitting it would silently default to PID 100.
  • Session deletion returns proper 404 — The DELETE /mcp handler now correctly returns 404 Not Found for non-existent sessions. The previous except KeyError handler was unreachable.
  • SSE metrics accuracy — Request status code metrics are now recorded after processing completes. Previously, all requests were counted as 200 regardless of actual outcome.
  • Indexer client resource leak on re-initializationWazuhIndexerClient.initialize() now closes the existing httpx.AsyncClient before creating a new one, preventing leaked connections.
  • Redis session store race conditionRedisSessionStore._ensure_initialized now uses an asyncio.Lock to prevent concurrent coroutines from double-initializing the Redis connection.

Dependency Corrections (2 fixes)

  • JWT library migrated from python-jose to pyjwt — The previous dependency on python-jose>=3.5.0 was unsatisfiable (version 3.5.0 was never released on PyPI, and the project is abandoned). Replaced with the actively maintained pyjwt[crypto]>=2.9.0.
  • cryptography version 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-remote branch; it now triggers on all tag pushes.
  • Semgrep action migrated — Moved from the deprecated returntocorp/semgrep-action to semgrep/semgrep-action.
  • Security scanner versions pinned — Trivy action pinned to v0.31.0 (was @master), TruffleHog pinned to v3.88.0 (was @main), Gitleaks updated from v8.18.4 to v8.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 v5 to v6.

Infrastructure

  • Version synchronized across all 5 files (pyproject.toml, __init__.py, Dockerfile, compose.yml, requirements.txt) — several were still referencing 4.0.7.
  • Stale branch references cleaned up — All mcp-remote references in Dockerfile labels, compose labels, and OCI metadata updated to main.
  • Dockerfile improvements — Trivy flag updated from deprecated --security-checks to --scanners; misleading PYTHONFAULTHANDLER comment corrected.
  • Docker Compose hardened — Removed unnecessary NET_BIND_SERVICE capability (port 3000 does not require it); removed unused volume definition.
  • README corrected — Python version badge updated from 3.13+ to 3.11+ to match requires-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-jose has been replaced with pyjwt[crypto]. If you have a requirements.txt or lockfile that pins python-jose, update it to pyjwt[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