Commit fe20525
authored
Fix 2253 (#2267)
* start new dev branch; add audit file
* Add failing tests: WebSocket max_frame_size must be range-validated (#2253)
check_websocket_options() validates max_frame_size as an int only — nothing
bounds it. That is a silent footgun: autobahn enforces frames with
'0 < maxFramePayloadSize < length', so a negative value makes '0 < size' false
and the check never fires. A config like {'max_frame_size': -1} passes
'crossbar check', looks like a tightened limit to an operator, and in fact means
NO frame limit at all — the opposite of the intent. 0 is the documented
'unlimited' spelling; a negative value must not be a second, undocumented one.
Add tests asserting max_frame_size rejects a negative value and an over-range
(> 64MB) value, and accepts 0 (unlimited) and a sane positive value. RED as
expected: the negative and over-range assertions fail (InvalidConfigException
not raised); the 0 and positive cases already pass.
Note: This work was completed with AI assistance (Claude Code).
* Range-validate WebSocket max_frame_size [0, 64MB] (#2253)
max_frame_size was type-checked only. Because autobahn enforces frames with
'0 < maxFramePayloadSize < length', a negative value makes '0 < size' false and
the limit never fires — so {'max_frame_size': -1} passed config validation and
silently disabled the frame limit, the opposite of the operator's intent.
- checkconfig.py: add check_transport_max_frame_size() validating an int in
[0, 64MB] (0 = unlimited, the documented spelling; upper bound consistent with
the WebSocket max_message_size policy), and wire it into
check_websocket_options(). max_frame_size is WebSocket-only (RawSocket is
frameless), so RawSocket is unaffected.
- changelog: 26.7.1 entry.
The compressed-vs-uncompressed semantics of both size knobs are already
documented (WebSocket-Options 'Frame and Message Size Limits' + WebSocket
Compression, added in #2250).
Turns the max_frame_size tests green; full local gate: ruff + ty clean,
test_checkconfig 44 passed, Sphinx dummy build clean.
Note: This work was completed with AI assistance (Claude Code).1 parent 46c782d commit fe20525
4 files changed
Lines changed: 59 additions & 0 deletions
File tree
- .audit
- docs
- src/crossbar
- common
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1031 | 1031 | | |
1032 | 1032 | | |
1033 | 1033 | | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
1034 | 1059 | | |
1035 | 1060 | | |
1036 | 1061 | | |
| |||
1622 | 1647 | | |
1623 | 1648 | | |
1624 | 1649 | | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
1625 | 1653 | | |
1626 | 1654 | | |
1627 | 1655 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
289 | 311 | | |
290 | 312 | | |
291 | 313 | | |
| |||
0 commit comments