You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Security hardening: fix session fixation, origin validation, command injection, and 12 more issues
- Prevent session fixation by always generating server-side UUIDs for new sessions
- Harden origin validation to exact match only (remove wildcard suffix and localhost substring matching)
- Add command injection prevention for all active response arguments via _sanitize_ar_argument
- Fix auth token scopes: empty list [] now correctly denies access (None = full access for legacy)
- Fix circuit breaker tripping on user input errors (narrow to connection/server exceptions)
- Fix retry logic: let httpx 5xx/ConnectError/TimeoutException propagate to tenacity instead of wrapping
- Fix SSE ACTIVE_CONNECTIONS double-decrement by moving dec into generator finally block
- Replace regex IP validation with ipaddress.ip_address() for proper IPv4/IPv6 support
- Fix SanitizingLogFilter crash when log record args is a dict
- Replace Redis KEYS with SCAN for O(log N) iteration instead of O(N) blocking
- Fix indexer _search retry: let server errors propagate for tenacity
- Improve check_agent_isolation and check_user_status to use alert history
- Add level parameter format validation and group_by parameter whitelist
- Bound auth token storage (10k max), OAuth stores, and rate limiter memory
- Remove Redis URL from log messages to prevent credential leakage
- Add 21 new tests covering all fixes (54 total)
- Bump version to 4.0.9
Copy file name to clipboardExpand all lines: CHANGELOG.md
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,39 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
+
## [4.0.9] - 2026-03-02
9
+
10
+
### Security
11
+
-**Session fixation prevention**: Server now always generates UUIDs for new sessions; client-provided session IDs are only used to look up existing sessions
12
+
-**Origin validation hardened**: Removed insecure wildcard suffix matching (`*.example.com`) and overly-permissive localhost substring matching; only exact match and explicit `*` wildcard are allowed
13
+
-**Command injection prevention**: All active response and rollback methods now sanitize arguments, blocking shell metacharacters (`;`, `|`, `` ` ``, `$`, etc.)
14
+
-**Auth token scopes**: Empty scopes list (`[]`) now correctly denies all access; previously returned True like `None` (full access)
15
+
-**Bounded token storage**: Auth token store evicts oldest entries when exceeding 10,000 tokens
16
+
-**OAuth bounded stores**: Authorization codes (1,000 max), access/refresh tokens (5,000 max), and client registrations (1,000 max) are now bounded to prevent memory exhaustion
17
+
-**Rate limiter bounded memory**: Added `MAX_TRACKED_CLIENTS = 10,000` with automatic cleanup of stale entries
18
+
-**Redis URL logging**: Removed Redis URLs (which may contain passwords) from log messages
19
+
20
+
### Fixed
21
+
-**Circuit breaker tripping on user errors**: Narrowed `expected_exception` from `Exception` to specific connection/server error types so `ValueError` doesn't trip the circuit
22
+
-**Retry logic defeated by exception wrapping**: 5xx `HTTPStatusError`, `ConnectError`, and `TimeoutException` now propagate directly to tenacity instead of being wrapped
23
+
-**SSE ACTIVE_CONNECTIONS double-decrement**: Moved decrement into SSE generator `finally` block with `track_connection` flag to prevent gauge going negative
24
+
-**IPv6 validation**: Replaced regex-based IP validation with `ipaddress.ip_address()` for proper IPv4 and IPv6 support
25
+
-**SanitizingLogFilter dict args**: Fixed crash when log record args is a dict instead of a tuple
26
+
-**Redis KEYS command**: Replaced `KEYS` (O(N) blocking) with `SCAN` (cursor-based iteration) in `RedisSessionStore`
27
+
-**Indexer retry logic**: `_search()` now lets 5xx, ConnectError, and TimeoutException propagate for tenacity retry
28
+
-**`check_agent_isolation`**: Now checks alert history for isolation evidence instead of using disconnected status as a proxy
29
+
-**`check_user_status`**: Now searches active response alert history instead of returning hardcoded data
30
+
31
+
### Added
32
+
-`_sanitize_ar_argument()` static method on `WazuhClient` for input sanitization of active response commands
33
+
-`group_by` parameter validation with whitelist of allowed fields
34
+
-`level` parameter format validation (must match `^[0-9]{1,2}\+?$`)
35
+
- 21 new test cases covering all audit v2 fixes (54 total tests)
36
+
37
+
### Changed
38
+
-`CircuitBreakerConfig.expected_exception` now accepts `Union[Type[Exception], Tuple[Type[Exception], ...]]`
0 commit comments