Commit dd1cca5
fix(pdu,graphics): harden ClearCodec and fix shortVBarYOff interpretation
Security hardening informed by FreeRDP ClearCodec CVEs (GHSA-3frr,
GHSA-32q9, CVE-2026-26955, CVE-2026-23531) and three rounds of
targeted code review.
Fixes:
- Correct shortVBarYOff interpretation: 6-bit field is an absolute
end-row offset, not a pixel count. Pixel count = yOff - yOn per
MS-RDPEGFX 2.2.4.1.1.2.1.1.3. (Round 2)
- Validate shortVBarYOff >= shortVBarYOn and <= band_height (Round 2)
- Cap residual run_length iterations to output buffer size (Round 1)
- Cap decoder allocation to 8192x8192 pixels max (Round 3)
- Validate glyph index range 0-3999 per spec 2.2.4.1 (Round 2)
- Cap encoder input to available pixel data (Round 1)
Add integration tests in ironrdp-testsuite-core (35 tests) covering
codec round-trip, adversarial input (DoS, OOM, malformed streams),
bands layer compositing, cache state, compression quality, and
multi-frame session simulation. Inline unit tests (42 tests) in the
PDU and graphics crates cover wire format decode/encode.1 parent efff721 commit dd1cca5
4 files changed
Lines changed: 611 additions & 30 deletions
File tree
- crates
- ironrdp-graphics/src/clearcodec
- ironrdp-pdu/src/codecs/clearcodec
- ironrdp-testsuite-core/tests/graphics
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
59 | 66 | | |
60 | 67 | | |
61 | 68 | | |
| |||
74 | 81 | | |
75 | 82 | | |
76 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
77 | 93 | | |
78 | 94 | | |
79 | 95 | | |
| |||
109 | 125 | | |
110 | 126 | | |
111 | 127 | | |
112 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
113 | 131 | | |
114 | 132 | | |
| 133 | + | |
115 | 134 | | |
116 | 135 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
125 | 147 | | |
126 | 148 | | |
127 | 149 | | |
| |||
295 | 317 | | |
296 | 318 | | |
297 | 319 | | |
298 | | - | |
299 | | - | |
300 | | - | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
301 | 325 | | |
302 | 326 | | |
303 | 327 | | |
| |||
439 | 463 | | |
440 | 464 | | |
441 | 465 | | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
442 | 470 | | |
443 | 471 | | |
444 | 472 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
147 | | - | |
148 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
149 | 150 | | |
150 | | - | |
| 151 | + | |
151 | 152 | | |
152 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
153 | 166 | | |
154 | 167 | | |
155 | 168 | | |
156 | 169 | | |
157 | 170 | | |
158 | | - | |
| 171 | + | |
159 | 172 | | |
160 | 173 | | |
161 | 174 | | |
| |||
195 | 208 | | |
196 | 209 | | |
197 | 210 | | |
198 | | - | |
| 211 | + | |
199 | 212 | | |
200 | | - | |
201 | | - | |
| 213 | + | |
| 214 | + | |
202 | 215 | | |
203 | 216 | | |
204 | 217 | | |
| |||
208 | 221 | | |
209 | 222 | | |
210 | 223 | | |
211 | | - | |
| 224 | + | |
212 | 225 | | |
213 | 226 | | |
214 | 227 | | |
| |||
0 commit comments