PostgreSQL 18.3 → 18.4
1 release · 1 breaking change · 16 security fixes · 11 advisories fixed
16security1breaking0deprecated3feature20fix
Vulnerabilities fixed by this upgrade
- 8.8 CVE-2026-6475 Symlink following in PostgreSQL pg_basebackup plain format and in pg_rewind allows an origin superuser to overwrite local files, e.g. /var/lib/postgres/.bashrc, that hijack the operating system acc…
- 7.2 CVE-2026-6476 SQL injection in PostgreSQL pg_createsubscriber allows an attacker with pg_create_subscription rights to execute arbitrary SQL as a superuser. The attack takes effect when pg_createsubscriber next…
- 8.8 CVE-2026-6477 Use of inherently dangerous function PQfn(..., result_is_int=0, ...) in PostgreSQL libpq lo_export(), lo_read(), lo_lseek64(), and lo_tell64() functions allows the server superuser to overwrite a c…
- 6.5 CVE-2026-6478 Covert timing channel in comparison of MD5-hashed password in PostgreSQL authentication allows an attacker to recover user credentials sufficient to authenticate. This does not affect scram-sha-25…
- 7.5 CVE-2026-6479 Uncontrolled recursion in PostgreSQL SSL and GSS negotiation allows an attacker able to connect to a PostgreSQL AF_UNIX socket to achieve sustained denial of service. If SSL and GSS are both disab…
- 4.3 CVE-2026-6575 Buffer over-read in PostgreSQL function pg_restore_attribute_stats() accepts array values of unmatched length, which causes query planning to read past end of one array. This allows a table mainta…
- 8.8 CVE-2026-6637 Stack buffer overflow in PostgreSQL module "refint" allows an unprivileged database user to execute arbitrary code as the operating system user running the database. A distinct attack is possible…
- 3.7 CVE-2026-6638 SQL injection in PostgreSQL logical replication ALTER SUBSCRIPTION ... REFRESH PUBLICATION allows a subscriber table creator to execute arbitrary SQL with the subscription's publication-side creden…
- 5.4 CVE-2026-6472 Missing authorization in PostgreSQL CREATE TYPE allows an object creator to hijack other queries that use search_path to find user-defined types, including extension-defined types. That is to say,…
- 8.8 CVE-2026-6473 Integer wraparound in multiple PostgreSQL server features allows an unprivileged database user to cause the server to undersize an allocation and write out-of-bounds. This may execute arbitrary co…
- 4.3 CVE-2026-6474 Externally-controlled format string in PostgreSQL timeofday() function allows an attacker to retrieve portions of server memory, via crafted timezone zones. Versions before PostgreSQL 18.4, 17.10,…
Breaking changes
- breaking Fix incomplete removal of relation references in RestrictInfo structs during join removal (Tom Lane) This oversight has been shown to result in planner failures such as unexpected “FULL JOIN is only supported with merge-joinable or hash-joinable join conditions” errors. It may also have caused… in 18.4
Security changes
- security Prevent unbounded recursion while processing startup packets (Michael Paquier) A malicious client could crash the connected backend by alternating rejected SSL and GSS encryption requests indefinitely. The PostgreSQL Project thanks Calif.io (in collaboration with Claude and Anthropic Research) for… in 18.4
- security Fix assorted integer overflows in memory-allocation calculations (Tom Lane, Nathan Bossart, Heikki Linnakangas) Various places were incautious about the possibility of integer overflow in calculations of how much memory to allocate. Overflow would lead to allocating a too-small buffer which the… in 18.4
- security Properly quote subscription names in pg_createsubscriber (Nathan Bossart) The given subscription name was inserted into SQL commands without quoting, so that SQL injection could be achieved in the (perhaps unlikely) case that the subscription name comes from an untrusted source. The PostgreSQL… in 18.4
- security Properly quote object names in logical replication origin checks (Pavel Kohout) ALTER SUBSCRIPTION ... REFRESH PUBLICATION interpolated schema and relation names into SQL commands without quoting them, allowing execution of arbitrary SQL on the publisher. The PostgreSQL Project thanks Pavel Kohout… in 18.4
- security Reject over-length options in ts_headline() (Michael Paquier) The StartSel, StopSel and FragmentDelimiter strings must not exceed 32Kb in length, but this was not checked for. An over-length value would typically crash the server. The PostgreSQL Project thanks Xint Code for reporting this problem.… in 18.4
- security Detect faulty input when restoring attribute MCV statistics (Michael Paquier) The statistics restore functions were insufficiently careful about validating most-common-value statistics, and would accept values that could crash the planner later on. The PostgreSQL Project thanks Jeroen Gui for… in 18.4
- security Guard against malicious time zone names in timeofday() and pg_strftime() (Tom Lane) A crafted time zone setting could pass % sequences to snprintf(), potentially causing crashes or disclosure of server memory. Another path to similar results was to overflow the limited-size output buffer used by… in 18.4
- security When creating a multirange type, ensure the user has CREATE privilege on the schema specified for the multirange type (Jelte Fennema-Nio) The multirange type can be put into a different schema than its parent range type, but we neglected to apply the required privilege check when doing so. The… in 18.4
- security Use timing-safe string comparisons in authentication code (Michael Paquier) Use timingsafe_bcmp() instead of memcmp() or strcmp() when checking passwords, hashes, etc. It is not known whether the data dependency of those functions is usefully exploitable in any of these places, but in the… in 18.4
- security Mark PQfn() as unsafe, and avoid using it within libpq (Nathan Bossart) For a non-integral result type, PQfn() is not passed the size of the output buffer, so it cannot check that the data returned by the server will fit. A malicious server could therefore overwrite client memory. This is… in 18.4
- security Prevent path traversal in pg_basebackup and pg_rewind (Michael Paquier) These applications failed to validate output file paths read from their input, so that a malicious source could overwrite any file writable by these applications. Constrain where data can be written by rejecting paths that are… in 18.4
- security Guard against field overflow within contrib/intarray's query_int type and contrib/ltree's ltxtquery type (Tom Lane) Parsing of these query structures did not check for overflow of 16-bit fields, so that construction of an invalid query tree was possible. This can crash the server when executing… in 18.4
- security Guard against overly long values of contrib/ltree's lquery type (Michael Paquier) Values with more than 64K items caused internal overflows, potentially resulting in stack smashes or wrong answers. The PostgreSQL Project thanks Vergissmeinnicht, A1ex, and Jihe Wang for reporting this problem.… in 18.4
- security Prevent SQL injection and buffer overruns in contrib/spi (Nathan Bossart) check_foreign_key() was insufficiently careful about quoting key values, and also used fixed-length buffers for constructing queries. While this module is only meant as example code, it still shouldn't contain such dangerous… in 18.4
- security Prevent buffer overruns when parsing an affix file for an Ispell dictionary (Tom Lane) A corrupt or malicious affix file could crash the server. This is not considered a security issue because text search configuration files are presumed trustworthy, but it still seems worth fixing. in 18.4
- security Ensure that tuplestore data structures are internally consistent even after an error (Tom Lane) The code was previously careless about this, which is fine most of the time but is problematic for the tuplestore backing a WITH HOLD cursor. In v15 and before this leads to easily-reproducible crashes;… in 18.4
Every release in between
securityPrevent unbounded recursion while processing startup packets (Michael Paquier) A malicious client could crash the connected backend by alternating rejected SSL and GSS encryption requests indefinitely. The PostgreSQL Project thanks Calif.io (in collaboration with Claude and Anthropic Research) for…
securityFix assorted integer overflows in memory-allocation calculations (Tom Lane, Nathan Bossart, Heikki Linnakangas) Various places were incautious about the possibility of integer overflow in calculations of how much memory to allocate. Overflow would lead to allocating a too-small buffer which the…
securityProperly quote subscription names in pg_createsubscriber (Nathan Bossart) The given subscription name was inserted into SQL commands without quoting, so that SQL injection could be achieved in the (perhaps unlikely) case that the subscription name comes from an untrusted source. The PostgreSQL…
securityProperly quote object names in logical replication origin checks (Pavel Kohout) ALTER SUBSCRIPTION ... REFRESH PUBLICATION interpolated schema and relation names into SQL commands without quoting them, allowing execution of arbitrary SQL on the publisher. The PostgreSQL Project thanks Pavel Kohout…
securityReject over-length options in ts_headline() (Michael Paquier) The StartSel, StopSel and FragmentDelimiter strings must not exceed 32Kb in length, but this was not checked for. An over-length value would typically crash the server. The PostgreSQL Project thanks Xint Code for reporting this problem.…
securityDetect faulty input when restoring attribute MCV statistics (Michael Paquier) The statistics restore functions were insufficiently careful about validating most-common-value statistics, and would accept values that could crash the planner later on. The PostgreSQL Project thanks Jeroen Gui for…
securityGuard against malicious time zone names in timeofday() and pg_strftime() (Tom Lane) A crafted time zone setting could pass % sequences to snprintf(), potentially causing crashes or disclosure of server memory. Another path to similar results was to overflow the limited-size output buffer used by…
securityWhen creating a multirange type, ensure the user has CREATE privilege on the schema specified for the multirange type (Jelte Fennema-Nio) The multirange type can be put into a different schema than its parent range type, but we neglected to apply the required privilege check when doing so. The…
securityUse timing-safe string comparisons in authentication code (Michael Paquier) Use timingsafe_bcmp() instead of memcmp() or strcmp() when checking passwords, hashes, etc. It is not known whether the data dependency of those functions is usefully exploitable in any of these places, but in the…
securityMark PQfn() as unsafe, and avoid using it within libpq (Nathan Bossart) For a non-integral result type, PQfn() is not passed the size of the output buffer, so it cannot check that the data returned by the server will fit. A malicious server could therefore overwrite client memory. This is…
securityPrevent path traversal in pg_basebackup and pg_rewind (Michael Paquier) These applications failed to validate output file paths read from their input, so that a malicious source could overwrite any file writable by these applications. Constrain where data can be written by rejecting paths that are…
securityGuard against field overflow within contrib/intarray's query_int type and contrib/ltree's ltxtquery type (Tom Lane) Parsing of these query structures did not check for overflow of 16-bit fields, so that construction of an invalid query tree was possible. This can crash the server when executing…
securityGuard against overly long values of contrib/ltree's lquery type (Michael Paquier) Values with more than 64K items caused internal overflows, potentially resulting in stack smashes or wrong answers. The PostgreSQL Project thanks Vergissmeinnicht, A1ex, and Jihe Wang for reporting this problem.…
securityPrevent SQL injection and buffer overruns in contrib/spi (Nathan Bossart) check_foreign_key() was insufficiently careful about quoting key values, and also used fixed-length buffers for constructing queries. While this module is only meant as example code, it still shouldn't contain such dangerous…
breakingFix incomplete removal of relation references in RestrictInfo structs during join removal (Tom Lane) This oversight has been shown to result in planner failures such as unexpected “FULL JOIN is only supported with merge-joinable or hash-joinable join conditions” errors. It may also have caused…
fixFix self-join removal to handle join clauses that are bare boolean columns, e.g. ON t1.boolcol (Andrei Lepikhov, Tender Wang, Alexander Korotkov) Previously such a case led to a “no relation entry for relid N” error.
fixFix UPDATE/DELETE ... WHERE CURRENT OF to work on tables with virtual generated columns (Satyanarayana Narlapuram, Dean Rasheed)
fixFix expansion of virtual generated columns in EXCLUDED column references in INSERT ... ON CONFLICT (Satyanarayana Narlapuram, Dean Rasheed)
fixFix incorrect handling of NEW generated columns in rule actions and rule qualifications (Richard Guo, Dean Rasheed) Previously, such column references would produce NULL in INSERT cases, or be equivalent to the OLD value in UPDATE cases.
fixFix spurious “indexes on virtual generated columns are not supported” errors (Robert Haas) Creation of an expression index could sometimes incorrectly report this error.
fixFix spurious “generated columns are not supported in COPY FROM WHERE conditions” errors (Tom Lane) Use of a system column in a COPY FROM WHERE condition could sometimes incorrectly report this error.
fixFix CREATE TABLE ... LIKE ... INCLUDING STATISTICS for cases where the source table has dropped column(s) (Julien Tachoires) In such cases, extended statistics objects could be copied incorrectly, or the command could give an incorrect error.
featureAllow ALTER INDEX ... ATTACH PARTITION to mark the parent index valid if appropriate (Sami Imseih) There are edge cases in which a partitioned index might remain marked as invalid even when all its leaf indexes are valid. This change provides a mechanism whereby a user can correct such a situation…
fixFix ALTER TABLE ... SET NOT NULL to invoke object-access hook functions only after completing the catalog change (Artur Zakirov)
fixFix ALTER FOREIGN DATA WRAPPER to not drop the wrapper object's dependency on its handler function (Jeff Davis)
fixFix loss of deferrability of foreign-key triggers (Yasuo Honda) Previously, a foreign key defined as DEFERRABLE INITIALLY DEFERRED would behave as NOT DEFERRABLE after being set to NOT ENFORCED status and then back to ENFORCED. If you have a foreign key with this problem, it can be repaired (after…
fixFix WITHOUT OVERLAPS to allow domains (Jian He) UNIQUE/PRIMARY KEY ... WITHOUT OVERLAPS requires the no-overlap column to be a range or multirange, but it should allow a domain over such a type too.
fixFix datum-image comparisons to be insensitive to sign-extension variations (David Rowley) This fixes some situations that previously led to “could not find memoization table entry” errors or wrong query results.
fixFix incorrect logic for hashed IN/NOT IN with non-strict equality operator (Chengpeng Yan) The previous coding could crash or give wrong answers. All built-in data types have strict equality operators, so that this issue could only arise with an extension data type.
securityPrevent buffer overruns when parsing an affix file for an Ispell dictionary (Tom Lane) A corrupt or malicious affix file could crash the server. This is not considered a security issue because text search configuration files are presumed trustworthy, but it still seems worth fixing.
fixFix array_agg_array_combine() to combine the arrays' null bitmaps correctly (Dmytro Astapov) This mistake resulted in sometimes-incorrect output from parallelized array_agg(anyarray) calculations.
fixFix incorrect behavior of pg_stat_reset_single_table_counters() on a shared catalog (Chao Li) Such cases had a side-effect of resetting the current database's stat_reset_timestamp, which was unintended.
fixFix “no relation entry for relid 0” failure while estimating array lengths in set operations (Tender Wang)
fixFix buffer overread when pglz_decompress() receives corrupt input (Andrew Dunstan) It was possible to read a few bytes past the end of the input, which in very unlucky cases might cause a crash.
fixFix incremental JSON parser's handling of numeric tokens that cross input buffer boundaries (Andrew Dunstan) It was possible to accept an incorrectly-formatted number, leading to failures later.
fixFix excessive log output from idle slotsync worker processes (Zhijie Hou)
securityEnsure that tuplestore data structures are internally consistent even after an error (Tom Lane) The code was previously careless about this, which is fine most of the time but is problematic for the tuplestore backing a WITH HOLD cursor. In v15 and before this leads to easily-reproducible crashes;…
fixFix premature NULL lag reporting in pg_stat_replication (Shinya Kato) The lag columns frequently read as NULL even while replication activity was happening.
featureIn contrib/basic_archive, allow the archive directory to be missing at startup (Nathan Bossart) Previously, the setting of basic_archive.archive_directory was rejected if it didn't point to an existing directory. This is undesirable because archiving will be stuck indefinitely, even if the…
featureUpdate time zone data files to tzdata release 2026b (Tom Lane) British Columbia (America/Vancouver) will be on year-round UTC-07 (effectively, permanent DST) beginning in November 2026. This release assumes that their TZ abbreviation will be MST from that time forward. That seems likely to change,…
+34 more items in the release notes