Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cec57b1

Browse filesBrowse files
committed
Document clashes between logical replication and untrusted users.
Back-patch to v10, which introduced logical replication. Security: CVE-2020-14349
1 parent 11da970 commit cec57b1
Copy full SHA for cec57b1

File tree

1 file changed

+19
-3
lines changed
Filter options

1 file changed

+19
-3
lines changed

‎doc/src/sgml/logical-replication.sgml

Copy file name to clipboardExpand all lines: doc/src/sgml/logical-replication.sgml
+19-3Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,11 +513,27 @@
513513
<sect1 id="logical-replication-security">
514514
<title>Security</title>
515515

516+
<para>
517+
A user able to modify the schema of subscriber-side tables can execute
518+
arbitrary code as a superuser. Limit ownership
519+
and <literal>TRIGGER</literal> privilege on such tables to roles that
520+
superusers trust. Moreover, if untrusted users can create tables, use only
521+
publications that list tables explicitly. That is to say, create a
522+
subscription <literal>FOR ALL TABLES</literal> only when superusers trust
523+
every user permitted to create a non-temp table on the publisher or the
524+
subscriber.
525+
</para>
526+
516527
<para>
517528
The role used for the replication connection must have
518-
the <literal>REPLICATION</literal> attribute (or be a superuser). Access for the role must be
519-
configured in <filename>pg_hba.conf</filename> and it must have the
520-
<literal>LOGIN</literal> attribute.
529+
the <literal>REPLICATION</literal> attribute (or be a superuser). If the
530+
role lacks <literal>SUPERUSER</literal> and <literal>BYPASSRLS</literal>,
531+
publisher row security policies can execute. If the role does not trust
532+
all table owners, include <literal>options=-crow_security=off</literal> in
533+
the connection string; if a table owner then adds a row security policy,
534+
that setting will cause replication to halt rather than execute the policy.
535+
Access for the role must be configured in <filename>pg_hba.conf</filename>
536+
and it must have the <literal>LOGIN</literal> attribute.
521537
</para>
522538

523539
<para>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.