Commit de2e6ad
Reject negative negotiated frame_max
connection.tune's frame_max is parsed via a signed 32-bit read, so a
broker can send a value with the high bit set and have it come back
negative once negotiated. Unlike negotiatedChannelMax and
negotiatedHeartbeat, the negotiated frameMax was never validated
afterwards.
A negative frameMax reaching Utils.inboundFrameMax defeats the
Math.min against maxInboundMessageBodySize, since the negative value
is always the smaller one, then trips the same "frame_max <= 0 means
no limit" fallback in Utils.framePayloadLimit that frame_max=0
relies on for its legitimate meaning, reintroducing the size-cap
bypass without a broker ever needing to negotiate a literal 0.
A non-default, positive requestedFrameMax is also enough to reach
this on its own, with an otherwise honest broker, since
negotiatedMaxValue only launders a negative value back to 0 when one
side's value is exactly 0.
Reject the negotiated frame max outright when negative, the same way
the sibling channel max and heartbeat checks already do.
(cherry picked from commit 89ed7ea)1 parent e7f10bf commit de2e6ad
2 files changed
Lines changed: 68 additions & 0 deletions
File tree
- src
- main/java/com/rabbitmq/client/impl
- test/java/com/rabbitmq/client/test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
434 | 439 | | |
435 | 440 | | |
436 | 441 | | |
| |||
Lines changed: 63 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
157 | 220 | | |
158 | 221 | | |
159 | 222 | | |
| |||
0 commit comments