{"id":16671,"date":"2026-09-03T11:40:59","date_gmt":"2026-09-03T11:40:59","guid":{"rendered":"https:\/\/newestek.com\/?p=16671"},"modified":"2026-09-03T11:40:59","modified_gmt":"2026-09-03T11:40:59","slug":"decade-old-postgresql-flaw-turns-backup-account-into-a-backdoor","status":"publish","type":"post","link":"https:\/\/newestek.com\/?p=16671","title":{"rendered":"Decade-old PostgreSQL flaw turns backup account into a backdoor"},"content":{"rendered":"<div>\n<div id=\"remove_no_follow\">\n<div class=\"grid grid--cols-10@md grid--cols-8@lg article-column\">\n<div class=\"col-12 col-10@md col-6@lg col-start-3@lg\">\n<div class=\"article-column__content\">\n<section class=\"wp-block-bigbite-multi-title\">\n<div class=\"container\"><\/div>\n<\/section>\n<p class=\"wp-block-paragraph\">A critical vulnerability in PostgreSQL had remained hidden for more than a decade, potentially turning a routine backup account into a path to full database and server compromise.<\/p>\n<p class=\"wp-block-paragraph\">The issue, dubbed PostGREShell by Cyera Research, exists in the database\u2019s replication functionality and could allow an attacker with a low-privilege account carrying the REPLICATION attribute to load and execute arbitrary code.<\/p>\n<p class=\"wp-block-paragraph\">\u201cThe flaw lets a low-privilege \u201cbackup\u201d account load and execute arbitrary code on the database server, achieving remote code execution across Windows, Linux, and macOS,\u201d said Cyera researcher <a href=\"https:\/\/www.linkedin.com\/in\/vladimir-eliezer-tokarev\/\" target=\"_blank\" rel=\"noreferrer noopener\">Vladimir Tokarev<\/a> in a blog <a href=\"https:\/\/www.cyera.com\/pt-br\/research\/postgreshell-the-database-powering-much-of-the-internet-had-an-open-door-for-12-years\">post<\/a>. \u201cThat foothold escalates to full PostgreSQL superuser with persistent backdoor access, turning a routine replication account into total database and server compromise.\u201d<\/p>\n<p class=\"wp-block-paragraph\">The vulnerability, tracked as <a href=\"https:\/\/www.postgresql.org\/support\/security\/CVE-2026-6471\/\" target=\"_blank\" rel=\"noreferrer noopener\">CVE-2026-6471<\/a>, affects PostgreSQL versions dating back to 9.4, released in 2014, and was patched in all supported PostgreSQL releases, including versions 18.6, 17.11, 16.15, 15.19, and 14.24, released on August 13.<\/p>\n<p class=\"wp-block-paragraph\">While PostgreSQL installations across Windows, Linux, and macOS were affected, the conditions needed to achieve code execution vary by platform, Tokarev noted.<\/p>\n<h2 class=\"wp-block-heading\"><a><\/a>Existing protections were not enough<\/h2>\n<p class=\"wp-block-paragraph\">The problem comes from PostgreSQL\u2019s handling of output plugins used by logical replication. These plugins are compiled code that PostgreSQL loads to format database changes for external systems and tools.<\/p>\n<p class=\"wp-block-paragraph\">PostgreSQL already has protections designed to stop non-superusers from loading arbitrary libraries from unsafe filesystem locations. Its \u201ccheck_restricted_library_name()\u201d mechanism restricts where such users can load plugins from, preventing path traversal and absolute paths.<\/p>\n<p class=\"wp-block-paragraph\">But, according to Cyera, the replication code path never called that security check.<\/p>\n<p class=\"wp-block-paragraph\">An attacker able to create a logical replication slot could provide a specially crafted plugin name containing filesystem paths, traversal sequences, or, on Windows, UNC paths. PostgreSQL would then pass that name directly to the operating system\u2019s library-loading functions.<\/p>\n<p class=\"wp-block-paragraph\">When the malicious library was loaded, its initialization code would execute inside the PostgreSQL server process.<\/p>\n<p class=\"wp-block-paragraph\">The resulting code execution is serious especially because REPLICATION accounts are commonly used as operational plumbing for backups, replicas, change data capture pipelines, migrations, and monitoring.<\/p>\n<p class=\"wp-block-paragraph\">Cyera said Windows systems are particularly exposed because an attacker could host a malicious DLL on a remote SMB server and point PostgreSQL at it, requiring no prior placement of the malicious file on the target system.<\/p>\n<h2 class=\"wp-block-heading\" id=\"backup-accounts-turned-into-superusers\">Backup accounts turned into superusers<\/h2>\n<p class=\"wp-block-paragraph\">The problem does not stop at code execution.<\/p>\n<p class=\"wp-block-paragraph\">Because an output plugin runs inside the PostgreSQL server process, Cyera said malicious code can operate outside the normal SQL permission model. A malicious plugin could manipulate <a href=\"https:\/\/www.csoonline.com\/article\/4167137\/ai-finds-20-year-old-bugs-in-postgresql-and-mariadb.html\">PostgreSQL<\/a> internals to elevate the attacker\u2019s privileges to superuser and modify internal authentication data.<\/p>\n<p class=\"wp-block-paragraph\">With superuser access, an attacker could access all databases and their contents, including customer data, application secrets and stored credentials. PostgreSQL superusers can also interact with the underlying operating system, potentially allowing attackers to execute commands, read sensitive files and write data to the server.<\/p>\n<p class=\"wp-block-paragraph\">Cyera demonstrated multiple persistence mechanisms, including modifications to PostgreSQL authentication configuration and the use of preloaded libraries that could survive database restarts. Tokarev said such access could also be used to gain deeper access into an organization\u2019s environment.<\/p>\n<p class=\"wp-block-paragraph\">The company reported the issue to the PostgreSQL Security Team in February, which reviewed the findings, assigned the flaw a CVE ID, and released fixes in August.<\/p>\n<p class=\"wp-block-paragraph\">Though the flaw fell short of a critical CVSS rating at 7.2, Cyera urged customers to patch immediately, noting that PostgreSQL plugins are a popular target for attackers. Its VirusTotal threat hunt found 114 malicious PostgreSQL plugins in the wild, including trojans, cryptocurrency miners, and reverse shells, though the disclosure did not link any of those plugins to the exploitation of CVE-2026-6471.<\/p>\n<p class=\"wp-block-paragraph\">Outside of patching, users were recommended to audit accounts with the REPLICATION attribute, restrict replication access and block unnecessary outbound SMB and NFS connections from database servers.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>A critical vulnerability in PostgreSQL had remained hidden for more than a decade, potentially turning a routine backup account into a path to full database and server compromise. The issue, dubbed PostGREShell by Cyera Research, exists in the database\u2019s replication functionality and could allow an attacker with a low-privilege account carrying the REPLICATION attribute to load and execute arbitrary code. \u201cThe flaw lets a low-privilege&#8230; <\/p>\n<p class=\"more\"><a class=\"more-link\" href=\"https:\/\/newestek.com\/?p=16671\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-16671","post","type-post","status-publish","format-standard","hentry","category-uncategorized","is-cat-link-borders-light is-cat-link-rounded"],"_links":{"self":[{"href":"https:\/\/newestek.com\/index.php?rest_route=\/wp\/v2\/posts\/16671","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/newestek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/newestek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/newestek.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/newestek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16671"}],"version-history":[{"count":0,"href":"https:\/\/newestek.com\/index.php?rest_route=\/wp\/v2\/posts\/16671\/revisions"}],"wp:attachment":[{"href":"https:\/\/newestek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/newestek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/newestek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}