forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0170b10
committed
Restore PGREQUIRESSL recognition in libpq.
Commit65c3bf1 moved handling of the,already then, deprecated requiressl parameter into conninfo_storeval().The default PGREQUIRESSL environment variable was however lost in thechange resulting in a potentially silent accept of a non-SSL connectioneven when set. Its documentation remained. Restore its implementation.Also amend the documentation to mark PGREQUIRESSL as deprecated forthose not following the link to requiressl. Back-patch to 9.3, wherecommit65c3bf1 first appeared.Behavior has been more complex when the user provides both deprecatedand non-deprecated settings. Before commit65c3bf1, libpq operatedaccording to the first of these found: requiressl=1 PGREQUIRESSL=1 sslmode=* PGSSLMODE=*(Note requiressl=0 didn't override sslmode=*; it would only suppressPGREQUIRESSL=1 or a previous requiressl=1. PGREQUIRESSL=0 had no effectwhatsoever.) Starting with commit65c3bf1, libpq ignored PGREQUIRESSL,and order of precedence changed to this: last of requiressl=* or sslmode=* PGSSLMODE=*Starting now, adopt the following order of precedence: last of requiressl=* or sslmode=* PGSSLMODE=* PGREQUIRESSL=1This retains the65c3bf1 behavior for connection strings that containboth requiressl=* and sslmode=*. It retains the65c3bf1 change thateither connection string option overrides both environment variables.For the first time, PGSSLMODE has precedence over PGREQUIRESSL; thisavoids reducing security of "PGREQUIRESSL=1 PGSSLMODE=verify-full"configurations originating under v9.3 and later.Daniel GustafssonSecurity:CVE-2017-74851 parent74cadea commit0170b10
2 files changed
+27
-0
lines changedLines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7061 | 7061 |
| |
7062 | 7062 |
| |
7063 | 7063 |
| |
| 7064 | + | |
| 7065 | + | |
| 7066 | + | |
7064 | 7067 |
| |
7065 | 7068 |
| |
7066 | 7069 |
| |
|
Lines changed: 24 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5083 | 5083 |
| |
5084 | 5084 |
| |
5085 | 5085 |
| |
| 5086 | + | |
| 5087 | + | |
| 5088 | + | |
| 5089 | + | |
| 5090 | + | |
| 5091 | + | |
| 5092 | + | |
| 5093 | + | |
| 5094 | + | |
| 5095 | + | |
| 5096 | + | |
| 5097 | + | |
| 5098 | + | |
| 5099 | + | |
| 5100 | + | |
| 5101 | + | |
| 5102 | + | |
| 5103 | + | |
| 5104 | + | |
| 5105 | + | |
| 5106 | + | |
| 5107 | + | |
| 5108 | + | |
| 5109 | + | |
5086 | 5110 |
| |
5087 | 5111 |
| |
5088 | 5112 |
| |
|
0 commit comments
Comments
(0)