pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: psql: Don't do backquote expansion in \unrestrict.
Date: Mon, 10 Aug 2026 13:41:33 +0000
Message-ID: <E1wtQFx-00000000yQK-3Uu7@gemulon.postgresql.org> (raw)

psql: Don't do backquote expansion in \unrestrict.

This oversight in commit 71ea0d6795 allows a malicious server to
inject shell commands into plain-text dump output that are run at
restore time on the machine running psql.  To fix, interpret all
text after \unrestrict until the end of the line as its argument.

Reported-by: Lucas Velgus <velgusgus599@gmail.com>
Reported-by: Filip Janus <fjanus@redhat.com>
Reported-by: Daniel Bakker <daniel@jackds.nl>
Author: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Reviewed-by: Noah Misch <noah@leadboat.com>
Security: CVE-2026-18408
Backpatch-through: 14

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2006fca401e07fc116a5d1777fc0f22bf49c9fae
Author: Nathan Bossart <nathan@postgresql.org>

Modified Files
--------------
doc/src/sgml/ref/psql-ref.sgml |  5 +++++
src/bin/psql/command.c         | 19 +++++++++++++++++--
2 files changed, 22 insertions(+), 2 deletions(-)



view thread (7+ messages)

Message-ID: <E1wtQFx-00000000yQK-3Uu7@gemulon.postgresql.org>
Permalink:  ../E1wtQFx-00000000yQK-3Uu7@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wtQFx-00000000yQK-3Uu7@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: noah@leadboat.com, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: psql: Don't do backquote expansion in \unrestrict.
  In-Reply-To: <E1wtQFx-00000000yQK-3Uu7@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox