- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitcbc8fd0
committed
oauth: Limit JSON parsing depth in the client
Check the ctx->nested level as we go, to prevent a server from runningthe client out of stack space.The limit we choose when communicating with authorization servers can'tbe overly strict, since those servers will continue to add extensions intheir JSON documents which we need to correctly ignore. For the SASLcommunication, we can be more conservative, since there are no definedextensions (and the peer is probably more Postgres code).Reviewed-by: Aleksander Alekseev <aleksander@timescale.com>Discussion:https://postgr.es/m/CAOYmi%2Bm71aRUEi0oQE9ciBnBS8xVtMn3CifaPu2kmJzUfhOZgA%40mail.gmail.com1 parent1ca583f commitcbc8fd0
File tree
4 files changed
+96
-6
lines changed- src
- interfaces
- libpq
- libpq-oauth
- test/modules/oauth_validator/t
4 files changed
+96
-6
lines changedLines changed: 26 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
82 | 82 |
| |
83 | 83 |
| |
84 | 84 |
| |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
85 | 99 |
| |
86 | 100 |
| |
87 | 101 |
| |
| |||
495 | 509 |
| |
496 | 510 |
| |
497 | 511 |
| |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
498 | 518 |
| |
499 | 519 |
| |
500 | 520 |
| |
| |||
599 | 619 |
| |
600 | 620 |
| |
601 | 621 |
| |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
602 | 628 |
| |
603 | 629 |
| |
604 | 630 |
| |
|
Lines changed: 25 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
157 | 157 |
| |
158 | 158 |
| |
159 | 159 |
| |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
160 | 168 |
| |
161 | 169 |
| |
162 | 170 |
| |
| |||
196 | 204 |
| |
197 | 205 |
| |
198 | 206 |
| |
| 207 | + | |
| 208 | + | |
| 209 | + | |
199 | 210 |
| |
200 | 211 |
| |
201 | 212 |
| |
| |||
254 | 265 |
| |
255 | 266 |
| |
256 | 267 |
| |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
257 | 272 |
| |
258 | 273 |
| |
259 | 274 |
| |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
260 | 284 |
| |
261 | 285 |
| |
262 | 286 |
| |
| |||
519 | 543 |
| |
520 | 544 |
| |
521 | 545 |
| |
| 546 | + | |
522 | 547 |
| |
523 | 548 |
| |
524 | 549 |
| |
|
Lines changed: 20 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
295 | 295 |
| |
296 | 296 |
| |
297 | 297 |
| |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
298 | 318 |
| |
299 | 319 |
| |
300 | 320 |
| |
|
Lines changed: 25 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
| 10 | + | |
10 | 11 |
| |
11 | 12 |
| |
12 | 13 |
| |
| |||
213 | 214 |
| |
214 | 215 |
| |
215 | 216 |
| |
216 |
| - | |
217 |
| - | |
218 |
| - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
219 | 228 |
| |
220 |
| - | |
221 |
| - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
222 | 241 |
| |
223 |
| - | |
| 242 | + | |
224 | 243 |
| |
225 | 244 |
| |
226 | 245 |
| |
|
0 commit comments
Comments
(0)