fuyou001 commented on PR #10693:
URL: https://github.com/apache/rocketmq/pull/10693#issuecomment-5128558180

   [P1] Please avoid failing open when a malformed HAProxy port is present.
   
   `buildHAProxyMessage` now returns `null` both when PROXY metadata is 
unavailable and when an advertised source/destination port is invalid. 
`forwardHAProxyMessage` treats `null` as "nothing to forward" and continues 
with `ctx.fireChannelRead(msg)`. Previously the parsing exception aborted this 
path; after this change, a connection carrying malformed PROXY metadata 
continues to the backend without a PROXY header.
   
   That can replace the real client address with the proxy address downstream 
and affect source-IP ACLs, rate limiting, tenant attribution, and audit logs. 
Please distinguish "metadata absent" from "metadata present but invalid" and 
reject/close the latter connection (or propagate an explicit failure) rather 
than silently continuing.
   
   Please add regression tests asserting that malformed source and destination 
ports do not call `ctx.fireChannelRead`, do not forward application traffic 
without the PROXY header, and close or reject the connection. Tests should also 
cover missing individual attributes, empty values, IPv6, port boundaries, and 
failures/cancellation/interruption from `writeAndFlush(...).sync()`.
   


-- 
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