PostgreSQL 18.4 → 18.6
1 release · 0 breaking changes · 30 security fixes · 28 advisories fixed
30security0breaking0deprecated8feature2fix
Vulnerabilities fixed by this upgrade
- 8.1 CVE-2026-6464 Untrusted data inclusion in PostgreSQL psql COPY may allow a server administrator to elicit execution of data lines as psql commands, via error injection. If the "COPY FROM STDIN" or "\copy FROM S…
- 3.8 CVE-2026-6469 Incorrect ownership assignment in PostgreSQL ALTER TABLE ALTER TYPE command reassigns ownership of dependent statistics objects to the current user. This wrongly allows the table owner to run DROP…
- 4.3 CVE-2026-6470 Missing authorization in PostgreSQL DDL commands allows an object creator to achieve denial of service against ALTER and DROP of the type, via creating a dependency on the type. Many DDL operation…
- 7.2 CVE-2026-6471 Missing authorization in PostgreSQL logical decoding allows a non-superuser holding REPLICATION privilege to dlopen any file visible to the operating system account running the server, via the choi…
- 8.8 CVE-2026-18408 Untrusted data inclusion in pg_dump in PostgreSQL allows a malicious superuser of the origin server to inject arbitrary code for restore-time execution as the client operating system account runnin…
- 8.8 CVE-2026-19385 Heap buffer overflow in PostgreSQL pg_dump of long function transform lists allows an object creator to execute arbitrary code as the operating system user running pg_dump, via a crafted transform…
- 4.3 CVE-2026-18024 Buffer over-read in PostgreSQL ascii() SQL function allows a user to disclose up to 3 bytes after the end of a specific allocation, via a crafted text value. This is the same class of defect that…
- 8.8 CVE-2026-15742 Integer wraparound in PostgreSQL fuzzystrmatch allows a user to direct writes to a huge range of addresses, executing arbitrary code as the operating system user running the database, via extreme i…
- 8.8 CVE-2026-16238 Type confusion in PostgreSQL pg_restore_attribute_stats() allows an object creator to execute arbitrary code as the operating system user running the database, via conflation of range and multirang…
- 8.8 CVE-2026-16239 Type confusion in PostgreSQL "portal"/cursor lifecycle allows a user to execute arbitrary code as the operating system user running the database, via re-creation of a cursor or other portal with di…
- 3.8 CVE-2026-16241 Integer underflow in PostgreSQL ECPG allows a database server administrator to achieve temporary denial of service against the ECPG client via sending a bytea value lacking the mandatory prefix. T…
- 8.8 CVE-2026-14677 Integer wraparound in PostgreSQL 32-bit builds of pltcl and plperl allows an object creator to cause the server to undersize an allocation and write out-of-bounds via crafted function bodies. This…
- 4.3 CVE-2026-14678 Buffer over-read in PostgreSQL pg_trgm index picksplit function reads past end of a heap buffer. This might allow a table maintainer to infer limited memory values, via the lossy signal of index s…
- 8.2 CVE-2026-14679 Stack buffer overflow in PostgreSQL argument name matching allows an object creator to achieve unknown impacts via OUT parameter count. The attack can write only 0x0 and 0x1 bytes. Versions befor…
- 8.8 CVE-2026-14680 Type confusion with PostgreSQL "internal" data type arguments allows any user to execute arbitrary code as the operating system user running the database, via calls to functions with that argument…
- 4.2 CVE-2026-14681 Improper enforcement of message integrity in PostgreSQL GSSAPI support allows a user to negotiate GSSAPI contrary to pg_hba.conf rules, via initial direct TLS connection. Despite a pg_hba.conf tha…
- 8.8 CVE-2026-15741 SQL injection in PostgreSQL EXTRACT() deparse allows an object owner to execute arbitrary SQL as a superuser via a hostile object definition. Attacks affect expression deparse consumers broadly, i…
- 8.1 CVE-2026-14668 Type confusion regarding input of PostgreSQL ctid data type selectivity estimator allows an object creator to view a calculation derived from the value of an arbitrary 4-byte span of memory, via a…
- 8.8 CVE-2026-14669 Heap buffer overflow in PostgreSQL to_char(timestamptz) allows the party choosing the timezone to execute arbitrary code as the operating system user running the database, via a long POSIX timezone…
- 8.8 CVE-2026-14670 Heap buffer overflow in PostgreSQL plperl return of a tied hash allows the function owner to execute arbitrary code as the operating system user running the database, via a crafted function body.…
- 8.8 CVE-2026-14671 Type confusion in PostgreSQL module "refint" allows an object creator to execute arbitrary code as the operating system user running the database. The fix for this emerged as a non-security bug re…
- 5.3 CVE-2026-14672 Observable response discrepancy in PostgreSQL SCRAM authentication allows an unauthenticated user to test the existence of a user via observing the SCRAM iteration count. This requires the probed…
- 3.8 CVE-2026-14673 Untrusted search path in PostgreSQL amcheck allows a grantee of amcheck function EXECUTE privilege to execute arbitrary functions as the owners of expression indexes that depend on the search path,…
- 8.8 CVE-2026-14676 Heap buffer overflow in PostgreSQL pg_stat_statements allows the query author to execute arbitrary code as the operating system user running the database, via crafted queries containing array const…
- 8.8 CVE-2026-14662 Integer wraparound in PostgreSQL tsvector and tsquery data type functions allows an unprivileged database user to cause the server to undersize an allocation and write out-of-bounds, via crafted la…
- 6.5 CVE-2026-14663 Cleartext storage in PostgreSQL pgcrypto disabled ciphers allows a user to recover cleartext, via direct observation of the faulty ciphertext. The OpenSSL version and OpenSSL configuration determi…
- 8.8 CVE-2026-14664 Heap buffer overflow in PostgreSQL regexp allows the query author to execute arbitrary code as the operating system user running the database, via text that would not pass encoding validation. Thi…
- 4.2 CVE-2026-14666 Incomplete tracking in PostgreSQL of changes to role membership, role attributes, and database ownership allows a query to continue using cached row-level security policies after those changes requ…
Breaking changes
None in the release notes.
Security changes
- security Restrict logical decoding output plugins to the set specified by a new server parameter output_plugin_libraries (Jacob Champion) Previously, a replication user could select any loadable library for logical decoding, allowing exploits of various sorts. To allow locking this down without breaking… in 18.6
- security Fix contrib/pgcrypto's PGP encryption to detect unsupported ciphers (Daniel Gustafsson) Previously, if OpenSSL rejected the requested cipher (for example, because it is running in FIPS mode, or the legacy provider hasn't been loaded), pgcrypto failed to notice the failure and simply XOR'd the… in 18.6
- security Fix psql to skip in-line data following a scripted COPY ... FROM STDIN command, even if the COPY fails before sending PGRES_COPY_IN (Tom Lane) Previously, if a COPY command failed at startup (for instance, because the target table doesn't exist) psql would not realize that and would proceed to… in 18.6
- security Cross-check the output row type of a portal running EXECUTE or FETCH (Robert Haas) EXECUTE and FETCH use two portals: an outer one for the statement itself, and an inner one running the query being executed on its behalf. It was previously possible to make the declared row types of the two portals… in 18.6
- security Fix buffer overrun with long time zone abbreviation in to_char() (Tom Lane) This can easily crash the server, and exploits leading to arbitrary code execution have been reported. The PostgreSQL Project thanks Hcamael, Amjad Shahzad, Tan Zhen of AntAISecurityLab, Tomer Fichman, Zheng Yu, Amy… in 18.6
- security Fix buffer overrun in regexp match/split functions (Masahiko Sawada) If passed invalidly-encoded data, these functions could write past the end of their conversion buffer. The PostgreSQL Project thanks Francesco Verardi for reporting this problem. (CVE-2026-14664) in 18.6
- security Harden the ascii() function against invalid input (Michael Paquier) By supplying invalidly-encoded input, this function could be coaxed to read and return a few bytes of data that it shouldn't. In assert-enabled builds, its assertions could be triggered too. The PostgreSQL Project thanks Hcamael… in 18.6
- security Fix multirange type handling in pg_restore_attribute_stats() (OpenAI Security Research Team) pg_restore_attribute_stats() treated multirange types just like their underlying range type. This works correctly for the bounds histogram, but it was wrong for all the other statistics kinds. The… in 18.6
- security Make scalarineqsel() check that a constant it expects to be of type tid actually is (Tom Lane) This expectation will hold for all the built-in operators that use this estimator, but a maliciously-constructed operator could violate it, leading to a crash or server memory disclosure. The PostgreSQL… in 18.6
- security Harden tsvector and tsquery code against overly long values (both individual lexemes and total vector/query length) (Tom Lane) The documented limits were not enforced in all code paths. The PostgreSQL Project thanks Yuhang Wu, Zhenpeng Lin, Zheng Yu, and Hcamael for reporting these problems.… in 18.6
- security Fix various places that mistakenly assumed they would not have to deal with more than FUNC_MAX_ARGS function arguments (Tom Lane) Notably, the server's actual limit on the number of arguments to an aggregate function is FUNC_MAX_ARGS - 1, but the parser failed to enforce that, creating hazards… in 18.6
- security Reject calls from SQL to functions that take or return type internal (Tom Lane) The existing defenses against doing this have been shown to be insufficient, so add more explicit checks. The PostgreSQL Project thanks Amy Burnett (OpenAI Codex Security) for reporting this problem. (CVE-2026-14680) in 18.6
- security Preserve the ownership of extended statistics objects when they are rebuilt by ALTER TABLE (Masahiko Sawada) Previously, the role running ALTER TABLE gained ownership of such objects, but that seems inappropriate. The PostgreSQL Project thanks Noah Misch for reporting this problem. (CVE-2026-6469) in 18.6
- security When deparsing an EXTRACT() function call, quote the field name if needed (Nathan Bossart) The parser accepts any string literal as a field name in EXTRACT(), deferring validation to execution. If the call is stored and deparsed (for example during pg_dump), the string body was regurgitated… in 18.6
- security Check for USAGE privilege on data types in places that formerly failed to check that (Nathan Bossart) CREATE TYPE AS RANGE did not check, nor did ALTER TABLE OF, nor did commands that create stored expressions. These omissions allowed roles without USAGE privilege to nonetheless create objects… in 18.6
- security Invalidate role-dependent cached plans after role changes (Ilya Staroverov, Shinya Kato, Nathan Bossart) Role membership, role attribute, and database ownership changes may impact the expected behavior of row-level security policies, but previously we'd continue to use cached plans that were made… in 18.6
- security Reject GSSEncRequest after direct SSL connection (Michael Paquier) After establishing a TLS-encrypted connection, the server would still accept a request for GSSAPI encryption. If that succeeded, the connection would proceed using TLS encryption, but it would look like a GSS connection to the… in 18.6
- security Make mock SCRAM authentication secrets more plausible (Nathan Bossart) If a SCRAM login is attempted against a role that doesn't exist or doesn't have a SCRAM secret, we generate a mock secret and carry out the authentication handshake anyway, to avoid revealing these facts to an attacker. But the… in 18.6
- security Fix out-of-bounds writes in ecpg applications caused by invalid bytea data received from the server (Michael Paquier) ecpg assumed without checking that any bytea value must begin with \x. A broken or malicious server might send a string shorter than 2 bytes, resulting in memory clobber in the… in 18.6
- security Do not do backquote expansion on the argument of psql's \unrestrict command (Nathan Bossart) This oversight in the fix for CVE-2025-8714 allows a malicious server to inject shell commands into plain-text dump output that will be run at restore time on the machine running psql, the exact scenario… in 18.6
- security Remove pg_dump's assumption that pg_proc.protrftypes cannot have more than FUNC_MAX_ARGS entries (Tom Lane) Since there could be entries for both input and output arguments, it's feasible for this array's length to exceed FUNC_MAX_ARGS (which constrains only input arguments). Even if that were not… in 18.6
- security Harden PL/Perl against “tied” Perl arrays and hashes (Tom Lane) A tied object that doesn't behave like a regular one could lead to memory overwrite, or to constructing a corrupt result array (which would likely cause problems later). The PostgreSQL Project thanks Hcamael for reporting this… in 18.6
- security Fix integer overflows in memory-allocation calculations in PL/Perl and PL/Tcl (Heikki Linnakangas) This is the same type of problem as CVE-2026-6473, just in a different part of the code, and is fixed in the same way. The PostgreSQL Project thanks the Tulya Project (Team Dhiutsa, Bitecope… in 18.6
- security Ensure that contrib/amcheck functions restrict search_path before executing index expressions (Noah Misch) Because amcheck will run such index expressions as the owner of their tables, a caller could potentially hijack search_path-dependent functions to run arbitrary code as the table owner. By… in 18.6
- security Fix integer overflows in contrib/fuzzystrmatch's levenshtein() and levenshtein_less_equal() functions (Nathan Bossart) Passing large cost values to these functions could cause integer overflows, thereby producing nonsensical results, and even causing out-of-bounds writes in some cases. The… in 18.6
- security Fix buffer overrun in contrib/pg_stat_statements (Álvaro Herrera) Query normalization didn't accurately account for the amount of space the normalized string would require. The PostgreSQL Project thanks Sajeeb Lohani (with TrendAI Zero Day Initiative) and Yuelin Wang for reporting this problem.… in 18.6
- security Fix datatype error in contrib/pg_trgm's GiST picksplit function (Heikki Linnakangas) This mistake resulted in reading past the end of the buffer, typically causing bad split decisions; but a crash could ensue if you're very unlucky. The PostgreSQL Project thanks Mehmet D. Ince for reporting this… in 18.6
- security Remove the plan cache in contrib/refint (Ayush Tiwari) This caching behavior has several serious bugs, notably that check_foreign_key() embeds the new key values in its cascade-UPDATE queries, so a cached plan reuses the originally-needed values rather than the key values that should be used. The… in 18.6
- security Clean up quoting of string parameters within constructed replication commands (Tom Lane) Various places that generate replication commands were not being adequately careful about quoting replication slot names and other parameters that need to be inserted into those commands. This could result in… in 18.6
- security Avoid NULL-pointer dereference in contrib/refint's check_foreign_key() (Ayush Tiwari) In the on-update-cascade case, a null value of a referenced column led to a crash. This is an oversight in the fix for CVE-2026-6637, but the code that was there before that wasn't really right either. in 18.6
Every release in between
securityRestrict logical decoding output plugins to the set specified by a new server parameter output_plugin_libraries (Jacob Champion) Previously, a replication user could select any loadable library for logical decoding, allowing exploits of various sorts. To allow locking this down without breaking…
securityFix contrib/pgcrypto's PGP encryption to detect unsupported ciphers (Daniel Gustafsson) Previously, if OpenSSL rejected the requested cipher (for example, because it is running in FIPS mode, or the legacy provider hasn't been loaded), pgcrypto failed to notice the failure and simply XOR'd the…
securityFix psql to skip in-line data following a scripted COPY ... FROM STDIN command, even if the COPY fails before sending PGRES_COPY_IN (Tom Lane) Previously, if a COPY command failed at startup (for instance, because the target table doesn't exist) psql would not realize that and would proceed to…
securityCross-check the output row type of a portal running EXECUTE or FETCH (Robert Haas) EXECUTE and FETCH use two portals: an outer one for the statement itself, and an inner one running the query being executed on its behalf. It was previously possible to make the declared row types of the two portals…
securityFix buffer overrun with long time zone abbreviation in to_char() (Tom Lane) This can easily crash the server, and exploits leading to arbitrary code execution have been reported. The PostgreSQL Project thanks Hcamael, Amjad Shahzad, Tan Zhen of AntAISecurityLab, Tomer Fichman, Zheng Yu, Amy…
securityFix buffer overrun in regexp match/split functions (Masahiko Sawada) If passed invalidly-encoded data, these functions could write past the end of their conversion buffer. The PostgreSQL Project thanks Francesco Verardi for reporting this problem. (CVE-2026-14664)
securityHarden the ascii() function against invalid input (Michael Paquier) By supplying invalidly-encoded input, this function could be coaxed to read and return a few bytes of data that it shouldn't. In assert-enabled builds, its assertions could be triggered too. The PostgreSQL Project thanks Hcamael…
securityFix multirange type handling in pg_restore_attribute_stats() (OpenAI Security Research Team) pg_restore_attribute_stats() treated multirange types just like their underlying range type. This works correctly for the bounds histogram, but it was wrong for all the other statistics kinds. The…
securityMake scalarineqsel() check that a constant it expects to be of type tid actually is (Tom Lane) This expectation will hold for all the built-in operators that use this estimator, but a maliciously-constructed operator could violate it, leading to a crash or server memory disclosure. The PostgreSQL…
securityHarden tsvector and tsquery code against overly long values (both individual lexemes and total vector/query length) (Tom Lane) The documented limits were not enforced in all code paths. The PostgreSQL Project thanks Yuhang Wu, Zhenpeng Lin, Zheng Yu, and Hcamael for reporting these problems.…
securityFix various places that mistakenly assumed they would not have to deal with more than FUNC_MAX_ARGS function arguments (Tom Lane) Notably, the server's actual limit on the number of arguments to an aggregate function is FUNC_MAX_ARGS - 1, but the parser failed to enforce that, creating hazards…
securityReject calls from SQL to functions that take or return type internal (Tom Lane) The existing defenses against doing this have been shown to be insufficient, so add more explicit checks. The PostgreSQL Project thanks Amy Burnett (OpenAI Codex Security) for reporting this problem. (CVE-2026-14680)
securityPreserve the ownership of extended statistics objects when they are rebuilt by ALTER TABLE (Masahiko Sawada) Previously, the role running ALTER TABLE gained ownership of such objects, but that seems inappropriate. The PostgreSQL Project thanks Noah Misch for reporting this problem. (CVE-2026-6469)
securityWhen deparsing an EXTRACT() function call, quote the field name if needed (Nathan Bossart) The parser accepts any string literal as a field name in EXTRACT(), deferring validation to execution. If the call is stored and deparsed (for example during pg_dump), the string body was regurgitated…
securityCheck for USAGE privilege on data types in places that formerly failed to check that (Nathan Bossart) CREATE TYPE AS RANGE did not check, nor did ALTER TABLE OF, nor did commands that create stored expressions. These omissions allowed roles without USAGE privilege to nonetheless create objects…
securityInvalidate role-dependent cached plans after role changes (Ilya Staroverov, Shinya Kato, Nathan Bossart) Role membership, role attribute, and database ownership changes may impact the expected behavior of row-level security policies, but previously we'd continue to use cached plans that were made…
securityReject GSSEncRequest after direct SSL connection (Michael Paquier) After establishing a TLS-encrypted connection, the server would still accept a request for GSSAPI encryption. If that succeeded, the connection would proceed using TLS encryption, but it would look like a GSS connection to the…
securityMake mock SCRAM authentication secrets more plausible (Nathan Bossart) If a SCRAM login is attempted against a role that doesn't exist or doesn't have a SCRAM secret, we generate a mock secret and carry out the authentication handshake anyway, to avoid revealing these facts to an attacker. But the…
securityFix out-of-bounds writes in ecpg applications caused by invalid bytea data received from the server (Michael Paquier) ecpg assumed without checking that any bytea value must begin with \x. A broken or malicious server might send a string shorter than 2 bytes, resulting in memory clobber in the…
securityDo not do backquote expansion on the argument of psql's \unrestrict command (Nathan Bossart) This oversight in the fix for CVE-2025-8714 allows a malicious server to inject shell commands into plain-text dump output that will be run at restore time on the machine running psql, the exact scenario…
securityRemove pg_dump's assumption that pg_proc.protrftypes cannot have more than FUNC_MAX_ARGS entries (Tom Lane) Since there could be entries for both input and output arguments, it's feasible for this array's length to exceed FUNC_MAX_ARGS (which constrains only input arguments). Even if that were not…
securityHarden PL/Perl against “tied” Perl arrays and hashes (Tom Lane) A tied object that doesn't behave like a regular one could lead to memory overwrite, or to constructing a corrupt result array (which would likely cause problems later). The PostgreSQL Project thanks Hcamael for reporting this…
securityFix integer overflows in memory-allocation calculations in PL/Perl and PL/Tcl (Heikki Linnakangas) This is the same type of problem as CVE-2026-6473, just in a different part of the code, and is fixed in the same way. The PostgreSQL Project thanks the Tulya Project (Team Dhiutsa, Bitecope…
securityEnsure that contrib/amcheck functions restrict search_path before executing index expressions (Noah Misch) Because amcheck will run such index expressions as the owner of their tables, a caller could potentially hijack search_path-dependent functions to run arbitrary code as the table owner. By…
securityFix integer overflows in contrib/fuzzystrmatch's levenshtein() and levenshtein_less_equal() functions (Nathan Bossart) Passing large cost values to these functions could cause integer overflows, thereby producing nonsensical results, and even causing out-of-bounds writes in some cases. The…
securityFix buffer overrun in contrib/pg_stat_statements (Álvaro Herrera) Query normalization didn't accurately account for the amount of space the normalized string would require. The PostgreSQL Project thanks Sajeeb Lohani (with TrendAI Zero Day Initiative) and Yuelin Wang for reporting this problem.…
securityFix datatype error in contrib/pg_trgm's GiST picksplit function (Heikki Linnakangas) This mistake resulted in reading past the end of the buffer, typically causing bad split decisions; but a crash could ensue if you're very unlucky. The PostgreSQL Project thanks Mehmet D. Ince for reporting this…
securityRemove the plan cache in contrib/refint (Ayush Tiwari) This caching behavior has several serious bugs, notably that check_foreign_key() embeds the new key values in its cascade-UPDATE queries, so a cached plan reuses the originally-needed values rather than the key values that should be used. The…
fixFix mis-handling of asynchronous reads when rescanning an asynchronous Append plan node (Alexander Korotkov, Gleb Kashkin, Etsuro Fujita) When an upper plan node rescans an Append before having read the entire Append output, we need to discard any in-flight requests sent to external servers (by…
fixFix error in partition pruning for RANGE-partitioned tables (David Rowley) In some cases the DEFAULT partition would be skipped when it should not be, which could lead to rows missing from query results.
featureAdd missed checks for hashability of equality comparisons on container datatypes (arrays, composites, ranges) (Andrei Lepikhov, Tom Lane) The planner must verify hashability of the container's component type(s) before deciding it can use a hash-based plan type. This step was missed in some places,…
featurePrevent “no empty local buffer available” errors during temporary table access (Melanie Plageman) Limit the number of local buffers that the read streaming mechanism is allowed to use. Previously, a large value of effective_io_concurrency could allow a single stream to use all the buffers,…
featureRestore full use of shared buffer pool in VACUUM's wraparound failsafe mode (Melanie Plageman) An ordinary VACUUM is limited to use just a few shared buffers, so as not to impinge too much on other processing. However, in failsafe mode we want to reclaim transaction IDs as quickly as possible, so…
featureHonor query cancel and vacuum delay during GIN index posting-tree cleanup (Paul Kim, Alexander Korotkov) The posting tree for a common value can be large, so that this missed check could allow vacuum to run for a long time before noticing an interrupt.
featureEnsure that the new last block of a bulk-extended table is added to its free space map promptly (Jingtang Zhang) An off-by-one error caused the last block of a multi-block table extension to not be marked as free in the map. This would eventually get corrected by vacuum, but meanwhile the space…
securityClean up quoting of string parameters within constructed replication commands (Tom Lane) Various places that generate replication commands were not being adequately careful about quoting replication slot names and other parameters that need to be inserted into those commands. This could result in…
featureAllow libpq to accept ParameterDescription messages exceeding 30000 bytes (Ning Sun) Previously, this message type was not among those that libpq's validity heuristics believed could be long. The limit resulted in failure for prepared queries having more than 7498 parameters, which is unlikely but…
featureReject multiple descriptor header items in ecpg's GET/SET DESCRIPTOR statements (Masashi Kamura) Previously the grammar allowed this syntax, but broken C code was generated. Adjust the grammar and the documentation to allow only one header item.
securityAvoid NULL-pointer dereference in contrib/refint's check_foreign_key() (Ayush Tiwari) In the on-update-cascade case, a null value of a referenced column led to a crash. This is an oversight in the fix for CVE-2026-6637, but the code that was there before that wasn't really right either.
featureUpdate time zone data files to tzdata release 2026c (Tom Lane) Alberta (America/Edmonton) will be on year-round UTC-06 (effectively, permanent DST) beginning in November 2026. This release assumes that their TZ abbreviation will be CST from that time forward. That seems likely to change, but it's…
+100 more items in the release notes