[Bug] Authentication audit logs expose request signatures
- Dominant language
- Java
- Stars
- 22.6k
- Forks
- 12k
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 27
Description
### Problem
`DefaultAuthenticationProvider.doAuditLog()` writes the raw request signature into authentication audit logs for both failed and successful authentication attempts:
```java
log.info("[AUTHENTICATION] User:{} is authenticated failed with Signature = {}.", context.getUsername(), context.getSignature());
log.debug("[AUTHENTICATION] User:{} is authenticated success with Signature = {}.", context.getUsername(), context.getSignature());
```
Signatures are security-sensitive authentication material and should not be emitted verbatim to logs.
### Impact
Operators may persist raw authentication signatures in log aggregation systems, increasing credential-related exposure risk during authentication failures or debug logging.
### Expected behavior
Authentication audit logs should preserve useful diagnostics, but redact or summarize signatures instead of printing the raw value.
### Code evidence
- `auth/src/main/java/org/apache/rocketmq/auth/authentication/provider/DefaultAuthenticationProvider.java`
### Suggested fix
Mask the signature before logging, and add tests covering both short and long signatures.
Contributor guide
Research direction
Start in auth/src/main/java/org/apache/rocketmq/auth/authentication/provider/DefaultAuthenticationProvider.java and inspect doAuditLog(), including both failed and successful authentication paths. Add focused tests for short and long signatures; done means audit logs retain useful diagnostics without emitting either raw signature.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- authentication, security
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100