forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork0
Commit70846ee
committed
Make json{b}_populate_recordset() use the right tuple descriptor.
json{b}_populate_recordset() used the tuple descriptor created from thequery-level AS clause without worrying about whether it matched the actualinput record type. If it didn't, that would usually result in a crash,though disclosure of server memory contents seems possible as well, for askilled attacker capable of issuing crafted SQL commands. Instead, usethe query-supplied descriptor only when there is no input tuple to look at,and otherwise get a tuple descriptor based on the input tuple's own typemarking. The core code will detect any type mismatch in the latter case.Michael Paquier and Tom Lane, per a report from David Rowley.Back-patch to 9.3 where this functionality was introduced.Security:CVE-2017-150981 parent29d0670 commit70846ee
File tree
5 files changed
+63
-11
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
5 files changed
+63
-11
lines changedLines changed: 25 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2607 | 2607 |
| |
2608 | 2608 |
| |
2609 | 2609 |
| |
2610 |
| - | |
2611 |
| - | |
2612 |
| - | |
2613 |
| - | |
2614 |
| - | |
2615 |
| - | |
2616 |
| - | |
2617 |
| - | |
2618 |
| - | |
2619 |
| - | |
2620 |
| - | |
2621 | 2610 |
| |
2622 | 2611 |
| |
2623 | 2612 |
| |
2624 | 2613 |
| |
2625 | 2614 |
| |
| 2615 | + | |
2626 | 2616 |
| |
| 2617 | + | |
| 2618 | + | |
| 2619 | + | |
| 2620 | + | |
| 2621 | + | |
| 2622 | + | |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
2627 | 2629 |
| |
| 2630 | + | |
2628 | 2631 |
| |
2629 | 2632 |
| |
| 2633 | + | |
| 2634 | + | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
| 2639 | + | |
| 2640 | + | |
2630 | 2641 |
| |
2631 | 2642 |
| |
2632 | 2643 |
| |
| |||
2670 | 2681 |
| |
2671 | 2682 |
| |
2672 | 2683 |
| |
| 2684 | + | |
| 2685 | + | |
| 2686 | + | |
2673 | 2687 |
| |
2674 | 2688 |
| |
2675 | 2689 |
| |
|
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1384 | 1384 |
| |
1385 | 1385 |
| |
1386 | 1386 |
| |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
1387 | 1400 |
| |
1388 | 1401 |
| |
1389 | 1402 |
| |
|
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1744 | 1744 |
| |
1745 | 1745 |
| |
1746 | 1746 |
| |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
1747 | 1760 |
| |
1748 | 1761 |
| |
1749 | 1762 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
394 | 394 |
| |
395 | 395 |
| |
396 | 396 |
| |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
397 | 403 |
| |
398 | 404 |
| |
399 | 405 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
364 | 364 |
| |
365 | 365 |
| |
366 | 366 |
| |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
367 | 373 |
| |
368 | 374 |
| |
369 | 375 |
| |
|
0 commit comments
Comments
(0)