Skip to content

Commit 369c229

Browse files
committed
Document risks of "make check" in the regression testing instructions.
Since the temporary server started by "make check" uses "trust" authentication, another user on the same machine could connect to it as database superuser, and then potentially exploit the privileges of the operating-system user who started the tests. We should change the testing procedures to prevent this risk; but discussion is required about the best way to do that, as well as more testing than is practical for an undisclosed security problem. Besides, the same issue probably affects some user-written test harnesses. So for the moment, we'll just warn people against using "make check" when there are untrusted users on the same machine. In passing, remove some ancient advice that suggested making the regression testing subtree world-writable if you'd built as root. That looks dangerously insecure in modern contexts, and anyway we should not be encouraging people to build Postgres as root. Security: CVE-2014-0067
1 parent 45bf240 commit 369c229

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

doc/src/sgml/regress.sgml

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,31 @@ gmake check
5555
<quote>failure</> represents a serious problem.
5656
</para>
5757

58+
<warning>
5859
<para>
59-
Because this test method runs a temporary server, it will not work
60-
when you are the root user (since the server will not start as root).
61-
If you already did the build as root, you do not have to start all
62-
over. Instead, make the regression test directory writable by
63-
some other user, log in as that user, and restart the tests.
64-
For example:
65-
<screen>
66-
<prompt>root# </prompt><userinput>chmod -R a+w src/test/regress</userinput>
67-
<prompt>root# </prompt><userinput>su - joeuser</userinput>
68-
<prompt>joeuser$ </prompt><userinput>cd <replaceable>top-level build directory</></userinput>
69-
<prompt>joeuser$ </prompt><userinput>gmake check</userinput>
70-
</screen>
71-
(The only possible <quote>security risk</quote> here is that other
72-
users might be able to alter the regression test results behind
73-
your back. Use common sense when managing user permissions.)
60+
This test method starts a temporary server, which is configured to accept
61+
any connection originating on the local machine. Any local user can gain
62+
database superuser privileges when connecting to this server, and could
63+
in principle exploit all privileges of the operating-system user running
64+
the tests. Therefore, it is not recommended that you use <literal>gmake
65+
check</> on machines shared with untrusted users. Instead, run the tests
66+
after completing the installation, as described in the next section.
67+
</para>
68+
69+
<para>
70+
On Unix-like machines, this danger can be avoided if the temporary
71+
server's socket file is made inaccessible to other users, for example
72+
by running the tests in a protected chroot. On Windows, the temporary
73+
server opens a locally-accessible TCP socket, so filesystem protections
74+
cannot help.
7475
</para>
76+
</warning>
77+
7578
<para>
76-
Alternatively, run the tests after installation.
79+
Because this test method runs a temporary server, it will not work
80+
if you did the build as the root user, since the server will not start as
81+
root. Recommended procedure is not to do the build as root, or else to
82+
perform testing after completing the installation.
7783
</para>
7884

7985
<para>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy