forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitaafbd1d
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 parent0294ac2 commitaafbd1d
2 files changed
+27
-0
lines changedLines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6944 | 6944 |
| |
6945 | 6945 |
| |
6946 | 6946 |
| |
| 6947 | + | |
| 6948 | + | |
| 6949 | + | |
6947 | 6950 |
| |
6948 | 6951 |
| |
6949 | 6952 |
| |
|
Lines changed: 24 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4635 | 4635 |
| |
4636 | 4636 |
| |
4637 | 4637 |
| |
| 4638 | + | |
| 4639 | + | |
| 4640 | + | |
| 4641 | + | |
| 4642 | + | |
| 4643 | + | |
| 4644 | + | |
| 4645 | + | |
| 4646 | + | |
| 4647 | + | |
| 4648 | + | |
| 4649 | + | |
| 4650 | + | |
| 4651 | + | |
| 4652 | + | |
| 4653 | + | |
| 4654 | + | |
| 4655 | + | |
| 4656 | + | |
| 4657 | + | |
| 4658 | + | |
| 4659 | + | |
| 4660 | + | |
| 4661 | + | |
4638 | 4662 |
| |
4639 | 4663 |
| |
4640 | 4664 |
| |
|
0 commit comments
Comments
(0)