abhilash1in opened a new pull request, #2370:
URL: https://github.com/apache/zookeeper/pull/2370

   ## Summary
   
   Fixes log-injection (CWE-117) in `EnsembleAuthenticationProvider` where 
attacker-controlled ensemble names containing `\n`/`\r` could forge arbitrary 
fake log lines in ZooKeeper's operational log.
   
   - Add `StringUtils.sanitizeForLog()` which replaces `\n`, `\r`, and `\t` 
with their printable escape sequences
   - Use it in `EnsembleAuthenticationProvider.handleAuthentication()` before 
logging the unexpected ensemble name warning
   - Add unit tests in `StringUtilTest` covering null, normal strings, and 
injection payloads
   
   This follows the same pattern as 
[ZOOKEEPER-3979](https://issues.apache.org/jira/browse/ZOOKEEPER-3979) which 
fixed a similar CWE-117 issue in the audit log path.
   
   ## JIRA
   
   https://issues.apache.org/jira/browse/ZOOKEEPER-5025
   
   ## Test plan
   
   - [ ] `StringUtilTest#testSanitizeForLog` — unit tests for the new utility 
method
   - [ ] Existing `EnsembleAuthenticationProvider` behavior unchanged (only log 
output is sanitized)
   - [ ] `mvn verify spotbugs:check checkstyle:check -Pfull-build`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to