forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork0
Commit17aa023
committed
Ensure that all temp files made during pg_upgrade are non-world-readable.
pg_upgrade has always attempted to ensure that the transient dump filesit creates are inaccessible except to the owner. However, refactoringin commit76a7650 broke that for the file containing "pg_dumpall -g"output; since then, that file was protected according to the process'sdefault umask. Since that file may contain role passwords (hopefullyencrypted, but passwords nonetheless), this is a particularly unfortunateoversight. Prudent users of pg_upgrade on multiuser systems wouldprobably run it under a umask tight enough that the issue is moot, butperhaps some users are depending only on pg_upgrade's umask changes toprotect their data.To fix this in a future-proof way, let's just tighten the umask atprocess start. There are no files pg_upgrade needs to write at aweaker security level; and if there were, transiently relaxing theumask around where they're created would be a safer approach.Report and patch by Tom Lane; the idea for the fix is due to Noah Misch.Back-patch to all supported branches.Security:CVE-2018-10531 parent0878b91 commit17aa023
4 files changed
+6
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 35 | | |
44 | 36 | | |
45 | 37 | | |
| |||
74 | 66 | | |
75 | 67 | | |
76 | 68 | | |
77 | | - | |
78 | | - | |
79 | 69 | | |
80 | 70 | | |
81 | 71 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
403 | | - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
404 | 406 | | |
405 | 407 | | |
406 | 408 | | |
| |||
0 commit comments
Comments
(0)