forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit098fb00
committed
Ignore attempts to \gset into specially treated variables.
If an interactive psql session used \gset when querying a compromisedserver, the attacker could execute arbitrary code as the operatingsystem account running psql. Using a prefix not found among speciallytreated variables, e.g. every lowercase string, precluded the attack.Fix by issuing a warning and setting no variable for the column inquestion. Users wanting the old behavior can use a prefix and then ameta-command like "\set HISTSIZE :prefix_HISTSIZE". Back-patch to 9.5(all supported versions).Reviewed by Robert Haas. Reported by Nick Cleaton.Security:CVE-2020-256961 parent0c3185e commit098fb00
File tree
5 files changed
+41
-0
lines changed- src
- bin/psql
- test/regress
- expected
- sql
5 files changed
+41
-0
lines changedLines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
786 | 786 |
| |
787 | 787 |
| |
788 | 788 |
| |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
789 | 796 |
| |
790 | 797 |
| |
791 | 798 |
| |
|
Lines changed: 26 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
360 | 360 |
| |
361 | 361 |
| |
362 | 362 |
| |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
363 | 389 |
| |
364 | 390 |
| |
365 | 391 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
90 | 90 |
| |
91 | 91 |
| |
92 | 92 |
| |
| 93 | + | |
93 | 94 |
| |
94 | 95 |
| |
95 | 96 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
106 | 106 |
| |
107 | 107 |
| |
108 | 108 |
| |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
109 | 113 |
| |
110 | 114 |
| |
111 | 115 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
55 | 55 |
| |
56 | 56 |
| |
57 | 57 |
| |
| 58 | + | |
| 59 | + | |
| 60 | + | |
58 | 61 |
| |
59 | 62 |
| |
60 | 63 |
| |
|
0 commit comments
Comments
(0)