Aias00 opened a new issue, #10678:
URL: https://github.com/apache/rocketmq/issues/10678
### Before Creating the Bug Report
- [x] I have searched the existing issues and pull requests.
### Runtime platform environment
All platforms.
### RocketMQ version
develop branch.
### JDK Version
Not applicable.
### Describe the Bug
`AckMessageActivity.ackMessage` reads the first ack entry before validating
that the request contains any entries:
```java
boolean isBatchAck = ConfigurationManager.getProxyConfig().isEnableBatchAck()
&& !request.getEntries(0).hasLiteTopic();
```
If a gRPC client sends an `AckMessageRequest` with an empty `entries` list,
this path throws an `IndexOutOfBoundsException`. That makes an invalid client
request look like an internal Proxy failure instead of a structured gRPC
bad-request response.
### Steps to Reproduce
1. Send an `AckMessageRequest` with valid `topic` and `group`, but no
`entries`.
2. Let Proxy handle the request through `AckMessageActivity.ackMessage`.
3. `request.getEntries(0)` is evaluated before entry-count validation.
### What Did You Expect to See?
Proxy should reject the request with a structured client-side error, for
example `GrpcProxyException(Code.BAD_REQUEST, "ack message entries cannot be
empty")`.
### What Did You See Instead?
Proxy throws `IndexOutOfBoundsException` while trying to access the first
entry.
### Additional Context
This is a small gRPC Proxy request validation hardening issue. It keeps
invalid client input from surfacing as an internal server error and makes the
behavior easier for clients and operators to diagnose.
--
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]