-
-
Notifications
You must be signed in to change notification settings - Fork 310
Open
Description
Description:
Close() at internal/corazawaf/transaction.go:1561-1601 puts the transaction back into sync.Pool via defer tx.WAF.txPool.Put(tx) but does NOT reset several fields:
tx.matchedRules— old matched rules leak into reused transactionstx.interruption— previous interruption persiststx.Skip,tx.SkipAfter,tx.AllowType— stale rule-skip statetx.audit— audit flag from previous requesttx.lastPhase— phase tracking from previous request
While newTransaction() in waf.go does reset these, the defer Put() means the transaction is always returned to the pool, even on error paths, with potentially dirty state. If newTransaction() logic ever changes, stale state will leak between requests.
Steps:
- Reset
matchedRules,interruption,Skip,SkipAfter,AllowType,audit,lastPhaseinClose()before thedefer Put()
Files: internal/corazawaf/transaction.go
Reactions are currently unavailable