You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "R0CKing666 (via GitHub)" <gi...@apache.org> on 2026/09/19 10:35:11 UTC
[I] [Bug] Remoting authorization trusts the client-supplied AccessKey when authorization is enabled without authentication [rocketmq]
R0CKing666 opened a new issue, #11178:
URL: https://github.com/apache/rocketmq/issues/11178
### Runtime platform environment
- OS: Linux (reproduced in a Docker container)
- RocketMQ: branch `develop`, version `5.5.1`, commit `80e1ae557` (also still present in the latest upstream `develop`)
### JDK Version
- Compiler: JDK 1.8
### Describe the Bug
In the Remoting (TCP) authorization path, the authorization subject is taken directly from the client-supplied `AccessKey` in the request extFields, without any signature verification:
```java
// DefaultAuthorizationContextBuilder#build(ChannelHandlerContext, RemotingCommand)
Subject subject = null;
if (fields.containsKey(SessionCredentials.ACCESS_KEY)) {
subject = User.of(fields.get(SessionCredentials.ACCESS_KEY)); // client-controlled, unverified
}
```
`authorizationEnabled` and `authenticationEnabled` are independent switches with no cross-validation. With `authorizationEnabled=true` and `authenticationEnabled=false`, the `AuthenticationPipeline` returns early and does nothing, while the `AuthorizationPipeline` still derives the caller identity from the raw `AccessKey`. An attacker who knows any user's AccessKey (e.g. the SUPER user) can impersonate them — publish, consume, delete topics, etc. — without providing a SecretKey/signature.
The gRPC path is not affected: it clears the client-supplied `AUTHORIZATION_AK` and only re-injects the verified identity after successful authentication.
### Steps to Reproduce
1. Start a broker with `authorizationEnabled=true` and `authenticationEnabled=false`, and a SUPER user with a known AccessKey (e.g. `rocketmq2`) present in the auth metadata.
2. Send a `SEND_MESSAGE` Remoting request whose extFields contain `AccessKey=rocketmq2` but no `Signature`.
3. Observe that the request is authorized and processed.
A minimal JUnit reproduction that exercises the exact broker authorization path (`DefaultAuthorizationContextBuilder` + `AuthorizationEvaluator` + `UserAuthorizationHandler`) is included in the accompanying PR. Its three tests confirm: the forged identity is authorized, an unknown AccessKey is denied, and enabling authentication rejects the unsigned request.
### What Did You Expect to See?
With authorization enabled but authentication disabled, the broker should either refuse to start (fail-closed), or treat the caller as unauthenticated and deny the request.
### What Did You See Instead?
The forged `AccessKey` is accepted as an authenticated SUPER identity and the request passes authorization.
### Additional Context
Suggested fix (fail-closed): refuse to start when `authorizationEnabled=true` and `authenticationEnabled=false`, mirroring the existing fail-closed guards in `ProxyAdminAuthInterceptor` for the gRPC admin surface. The accompanying PR adds this startup validation plus a unit test.
--
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: commits-unsubscribe@rocketmq.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] Remoting authorization trusts the client-supplied AccessKey when authorization is enabled without authentication [rocketmq]
Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #11178:
URL: https://github.com/apache/rocketmq/issues/11178#issuecomment-5741317682
**Issue Evaluation**
Category: `bug` | Status: **Confirmed** | Severity: **High**
This is a valid security vulnerability in the Remoting (TCP) authorization path.
**Root Cause:** In `DefaultAuthorizationContextBuilder#build()`, the authorization `Subject` is derived directly from the client-supplied `AccessKey` in request `extFields` without any signature verification:
```java
// line ~178
Subject subject = null;
if (fields.containsKey(SessionCredentials.ACCESS_KEY)) {
subject = User.of(fields.get(SessionCredentials.ACCESS_KEY)); // unverified
}
```
Since `authorizationEnabled` and `authenticationEnabled` are independent switches:
- `AuthenticationPipeline.execute()` returns early when `authenticationEnabled=false`
- `AuthorizationPipeline.execute()` proceeds when `authorizationEnabled=true`
- The unverified `AccessKey` is used as the caller identity for all authorization decisions
**Impact:** An attacker who knows any user AccessKey can impersonate them over the Remoting protocol without providing a SecretKey or signature.
**Affected component:** `auth` module, `DefaultAuthorizationContextBuilder` (Remoting path only; gRPC path is not affected).
**Severity:** High — authentication bypass enabling privilege escalation in misconfigured deployments.
The suggested fail-closed approach (refuse to start when authorization is enabled but authentication is disabled) is a sound mitigation.
---
*Automated evaluation by github-manager-bot*
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org