{"id":2698,"date":"2026-09-04T18:06:45","date_gmt":"2026-09-04T18:06:45","guid":{"rendered":"https:\/\/thedigitalfortress.us\/?p=2698"},"modified":"2026-09-04T18:06:45","modified_gmt":"2026-09-04T18:06:45","slug":"postgresql-fixes-12-year-old-logical-decoding-flaw-enabling-replication-role-code-execution","status":"publish","type":"post","link":"https:\/\/thedigitalfortress.us\/?p=2698","title":{"rendered":"PostgreSQL Fixes 12-Year-Old Logical Decoding Flaw Enabling Replication-Role Code Execution"},"content":{"rendered":"<div id=\"articlebody\">\n<div class=\"separator\" style=\"clear: both;\"><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEh2Gb4Wd-HSxdrPbdtUFxmldzzEkPEZcW1NkT7tV9-EfTAjDENSExJBWmOey_IJ5UKjszQfCNGkVoBtuxya00rFMrh_lJUAuS66Gr3kvU8GgFjMr7DF-7Ux1rUqwz-aDhum8HkVjxNKQTc6DXHG203CPXwg9sOMcA7nfsq6A81C9cJhb3HUu9GZDIj7FZY\/s1700-nu-rw-lo-l85-e365\/PostgreSQL.jpg\" style=\"display: block;  text-align: center; clear: left; float: left;\"><\/a><\/div>\n<p>PostgreSQL has released updates to address a security flaw that allows an account with the REPLICATION attribute to run arbitrary code as the operating-system user running the database server.<\/p>\n<p>The flaw, tracked as <strong>CVE-2026-6471<\/strong> (CVSS score: 7.2), has been present since logical decoding was introduced in PostgreSQL 9.4 in 2014. Versions before PostgreSQL 18.6, 17.11, 16.15, 15.19, and 14.24 are affected.<\/p>\n<p>Exploitation requires an account carrying the REPLICATION attribute and a server running with wal_level = logical. Backup tools, standby servers, change data capture (CDC) pipelines, and monitoring systems routinely hold that attribute.<\/p>\n<p>The fix, shipped on August 13, adds a server parameter called output_plugin_libraries that lists which libraries may be loaded as logical decoding output plugins, defaulting to &#8216;pgoutput, test_decoding&#8217;.<\/p>\n<p>Installations using any other output plugin, wal2json, and decoderbufs<\/p>\n<p>among them, will have logical decoding refused after updating until an administrator adds the library to that list and reloads the server configuration.<\/p>\n<p>\u00abPreviously, a replication user could select any loadable library for logical decoding, allowing exploits of various sorts. To allow locking this down without breaking setups that worked before, introduce a whitelist of allowed output plugins,\u00bb the PostgreSQL Global Development Group said in the <a href=\"https:\/\/www.postgresql.org\/docs\/release\/18.6\/\" target=\"_blank\">18.6 release notes<\/a>.<\/p>\n<div class=\"dog_two clear\">\n<div class=\"cf\"><a href=\"https:\/\/thehackernews.uk\/trust-world-update-d\" rel=\"nofollow noopener sponsored\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"lazyload\" alt=\"Cybersecurity\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEhYq3TvePXpW0JIC7fXyv7A1W8KQqmb-AZqza2EuPyT0k8Nm5CwHYHISFLKXSKIAyR8JRtqEFQ4zx5jADiAkZKQ08nRWG1jCRV5YAbhKua7WaDdH1L6wsI-xOkoV4brlMfK44UwU-4Q1xqWg0uNN7sZkMCzci4RXYgWMNPHTtuKua7OR4oCbmxE10u0yKnR\/s728-nu-rw-lo-l85-e365\/tl-d.jpg\" width=\"729\" height=\"91\"\/><\/a><\/div>\n<\/div>\n<p>The PostgreSQL Project credited Vladimir Tokarev and Yu Kunpeng with reporting the problem.<\/p>\n<p>Tokarev detailed it in <a href=\"https:\/\/www.cyera.com\/research\/postgreshell-the-database-powering-much-of-the-internet-had-an-open-door-for-12-years\" target=\"_blank\">a September 1 write-up<\/a> for data security firm Cyera Research, which names the flaw <strong>PostGREShell<\/strong>.<\/p>\n<p>The plugin name supplied in a CREATE_REPLICATION_SLOT command is passed directly to the function that loads the library, Cyera said.<\/p>\n<p><a name=\"more\"\/><\/p>\n<p>PostgreSQL&#8217;s existing restriction on plugin paths, which confines non-superusers to a single administrator-controlled directory, is never called on the replication path. The replication protocol&#8217;s parser accepts almost any character inside a double-quoted plugin name, including path separators and ..\/ traversal, so a full filesystem path reaches the loader as typed.<\/p>\n<div class=\"separator\" style=\"clear: both;\"><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEj_uHL_ZX6Is55FpTKxgjxDByemE-RHNXuYO35tnsrCo6de9LMynGNsvZ7dTyUD0oIIZdYOSBmIip1LJOYjF3CrlsRSwo0_a1NbmBup00SXxiUlxoslIivxfT1awlSctBWdmA4S_vYlalhI53nqcldW0nrD3QXQ2T87Xa1PzDdLJ041mwS8QzzzT4YqJe8\/s1700-nu-rw-lo-l85-e365\/db-1.png\" style=\"display: block;  text-align: center; clear: left; float: left;\"><img decoding=\"async\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEj_uHL_ZX6Is55FpTKxgjxDByemE-RHNXuYO35tnsrCo6de9LMynGNsvZ7dTyUD0oIIZdYOSBmIip1LJOYjF3CrlsRSwo0_a1NbmBup00SXxiUlxoslIivxfT1awlSctBWdmA4S_vYlalhI53nqcldW0nrD3QXQ2T87Xa1PzDdLJ041mwS8QzzzT4YqJe8\/s1700-nu-rw-lo-l85-e365\/db-1.png\" alt=\"\" border=\"0\" data-original-height=\"1379\" data-original-width=\"1971\"\/><\/a><\/div>\n<p>On Windows, the server resolves a network path over Server Message Block (SMB) and fetches the library from a machine the attacker controls, writing nothing to the target, Cyera said.<\/p>\n<p>On Linux and macOS, the same result requires enabling Network File System (NFS) automounting. Everywhere else the attacker needs an existing way to write a file to the server&#8217;s disk. Code loaded this way runs inside the database backend process as the postgres operating-system user.<\/p>\n<p>Cyera&#8217;s test plugin then wrote the role catalog directly to make the replication account a PostgreSQL superuser. It also set up three persistence mechanisms that survive a server restart.<\/p>\n<p>Cyera describes the REPLICATION attribute as a low-privilege backup credential, but PostgreSQL scored the flaw with Privileges Required set to High, a rating reproduced in <a href=\"https:\/\/www.suse.com\/security\/cve\/CVE-2026-6471.html\" target=\"_blank\">SUSE&#8217;s own assessment<\/a>.<\/p>\n<div class=\"separator\" style=\"clear: both;\"><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgf4P5leG3QrY8D8d_1Fe2MbNc8DumdZG9zEReOrL6rXiMVYHtP_KL7GEt_4fCfz6ZPev_0BRwH4uCcafgU-pG4WDf75EeWf863GbcrQUf5FAeSlSHC9wqPnOSHXgOIa4MWJuemRNjrR9jjb6kW-JTI1rt2bLBUAsVtz2k6aMUnp02StENSIq85XT60GVY\/s1700-nu-rw-lo-l85-e365\/db-2.png\" style=\"display: block;  text-align: center; clear: left; float: left;\"><img decoding=\"async\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgf4P5leG3QrY8D8d_1Fe2MbNc8DumdZG9zEReOrL6rXiMVYHtP_KL7GEt_4fCfz6ZPev_0BRwH4uCcafgU-pG4WDf75EeWf863GbcrQUf5FAeSlSHC9wqPnOSHXgOIa4MWJuemRNjrR9jjb6kW-JTI1rt2bLBUAsVtz2k6aMUnp02StENSIq85XT60GVY\/s1700-nu-rw-lo-l85-e365\/db-2.png\" alt=\"\" border=\"0\" data-original-height=\"1331\" data-original-width=\"2048\"\/><\/a><\/div>\n<p>PostgreSQL rejected applying its existing LOAD restriction to the replication path.<\/p>\n<p>\u00abREPLICATION users were not previously subject to restrictions on output plugin paths, so they were able to bypass LOAD-time protections during logical decoding. Unfortunately, adding the standard LOAD restrictions now would retroactively require all third-party output plugins to be installed under the $libdir\/plugins directory,\u00bb Jacob Champion, who wrote the fix, said in <a href=\"https:\/\/git.postgresql.org\/pg\/commitdiff\/226e49cbed592eaf7a08320efecb814b7492972e\" target=\"_blank\">the commit message<\/a>.<\/p>\n<p>Failed loads appear in the server log as ERROR: library \u00ab&#8230;\u00bb may not be used as an output plugin, with a hint naming the setting, according to <a href=\"https:\/\/www.postgresql.org\/docs\/current\/runtime-config-replication.html\" target=\"_blank\">the parameter&#8217;s documentation<\/a>.<\/p>\n<p>Administrators are advised to take the following steps &#8211;<\/p>\n<ol>\n<li>Run SELECT DISTINCT plugin FROM pg_replication_slots WHERE plugin IS NOT NULL; before updating to identify the output plugins in use, which will only show plugins successfully used at some point.<\/li>\n<li>Update to 18.6, 17.11, 16.15, 15.19, or 14.24, or to the equivalent distribution package.<\/li>\n<li>Add any non-default plugin to output_plugin_libraries and reload the configuration with pg_ctl reload or SELECT pg_reload_conf(). A restart is not required.<\/li>\n<li>Set the new cluster&#8217;s output_plugin_libraries before running pg_upgrade &#8211;check when migrating from version 17 or later, as the check fails if the list does not permit the old cluster&#8217;s slot plugins.<\/li>\n<\/ol>\n<p>Fixed packages are <a href=\"https:\/\/docs.aws.amazon.com\/AmazonRDS\/latest\/PostgreSQLReleaseNotes\/postgresql-versions.html\" target=\"_blank\">available on Amazon RDS<\/a> for all five branches, as well as from Debian, SUSE, and Ubuntu.<\/p>\n<p><a href=\"https:\/\/www.postgresql.org\/support\/security\/CVE-2026-6471\/\" target=\"_blank\">PostgreSQL&#8217;s advisory<\/a> covers supported branches 14 through 18 and does not address earlier ones. PostgreSQL 14 stops receiving fixes on November 12, 2026, the project said in <a href=\"https:\/\/www.postgresql.org\/about\/news\/postgresql-186-1711-1615-1519-1424-and-19-beta-3-released-3365\/\" target=\"_blank\">its release announcement<\/a>.<\/p>\n<p>The upstream fix \u00abrequires additional changes to the configuration if some extensions are used,\u00bb <a href=\"https:\/\/www.mail-archive.com\/debian-lts-announce@lists.debian.org\/msg04945.html\" target=\"_blank\">Debian&#8217;s advisory<\/a> warns, naming its wal2json and decoderbufs packages.<\/p>\n<p><a href=\"https:\/\/ubuntu.com\/security\/notices\/USN-8653-1\" target=\"_blank\">Ubuntu&#8217;s USN-8653-1<\/a>, which shipped the fix for 22.04, 24.04, and 26.04 LTS on August 20, makes no mention of the parameter and tells administrators only to restart PostgreSQL after the update.<\/p>\n<div class=\"dog_two clear\">\n<div class=\"cf\"><a href=\"https:\/\/thehackernews.uk\/enterprise-ai-security-a\" rel=\"nofollow noopener sponsored\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"lazyload\" alt=\"Cybersecurity\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEhgJrVTpy3T5kJ7VEIro3XfMOmfqDnBU03fYT5CyFWrs2rE9BeQxs835FAS_f1yivzd7mZ7KartftPk4qs8w5Br-WzfYMXruXDQk4FiuXcvSxoA4XH93ipwJJyy2Hbs9jqs-keS9KZhCnQ2YYdv93M51kxJlE862ob-RrrEhP4DEVP3E79zMMPf43e5keoK\/s728-nu-rw-lo-l85-e365\/AI-eBook-d-2.jpg\" width=\"729\" height=\"91\"\/><\/a><\/div>\n<\/div>\n<p>As of September 4, the wal2json project had <a href=\"https:\/\/github.com\/eulerto\/wal2json\/blob\/master\/README.md\" target=\"_blank\">updated its documentation<\/a> to tell users to add the plugin to output_plugin_libraries, citing the CVE.<\/p>\n<p>A gap in the fix is still open. pg_createsubscriber creates replication slots using pgoutput without checking the new parameter, so a &#8211;dry-run succeeds and the conversion then fails.<\/p>\n<p>\u00abpg_createsubscriber command creates replication slots with plugin &#8216;pgoutput&#8217;, without checking the GUC. This meant if the plugin name is not specified in the parameter, &#8211;dry-run mode passes but actual convertion fails. It&#8217;s very surprising for users and should be avoided,\u00bb Hayato Kuroda of Fujitsu said in a message to <a href=\"https:\/\/www.mail-archive.com\/pgsql-hackers@lists.postgresql.org\/msg237836.html\" target=\"_blank\">the pgsql-hackers mailing list<\/a>.<\/p>\n<p>A patch was under review and had not been committed as of September 4. CVE-2026-6471 remained absent from CISA&#8217;s <a href=\"https:\/\/www.cisa.gov\/known-exploited-vulnerabilities-catalog\" target=\"_blank\">Known Exploited Vulnerabilities (KEV) catalog<\/a> as of September 4.<\/p>\n<p>The Hacker News found no proof-of-concept code for it in public repositories on the same date.<\/p>\n<p>Until the update can be applied, Cyera said exposure can be reduced by stripping the REPLICATION attribute from accounts that do not need it, restricting replication entries in pg_hba.conf to known addresses, blocking outbound SMB (port 445) and NFS (port 2049) traffic from database servers, and disabling autofs where it is not needed.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>PostgreSQL has released updates to address a security flaw that allows an account with the REPLICATION attribute to run arbitrary code as the operating-system user running the database server. The&hellip;<\/p>\n","protected":false},"author":1,"featured_media":2699,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3309,10,3311,524,13,655,70,3310,1074,3312],"class_list":["post-2698","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-12yearold","tag-code","tag-decoding","tag-enabling","tag-execution","tag-fixes","tag-flaw","tag-logical","tag-postgresql","tag-replicationrole"],"_links":{"self":[{"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/posts\/2698","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2698"}],"version-history":[{"count":0,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/posts\/2698\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/media\/2699"}],"wp:attachment":[{"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2698"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}