From: Tom Lane <tgl@sss.pgh.pa.us>
To: Shay Rojansky <roji@roji.org>
Cc: Karsten Hilbert <Karsten.Hilbert@gmx.net>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Row data is reflected in DETAIL message when constraints fail on insert/update
Date: Thu, 20 Jun 2019 12:27:42 -0400
Message-ID: <14066.1561048062@sss.pgh.pa.us> (raw)
In-Reply-To: <CADT4RqA=Z2EB6irHWg_9i80aQJzZtt+5M1gDokaS9Uo2Xe_7UQ@mail.gmail.com>
References: <CAO8wz8QdKRTJUnW--AZ2N-BvJAemS+P9=Sr7zUbkO+wmAmA7LQ@mail.gmail.com>
<b2afcfd3-a2c2-9bdc-3e62-a28392f0b8f6@aklaver.com>
<CADT4RqDYLKWxxHejU2ZE6Wmveo8x09Zf8aw4pdT-=0uU82Us=Q@mail.gmail.com>
<20190620114527.GD30366@hermes.hilbert.loc>
<7057.1561040804@sss.pgh.pa.us>
<CADT4RqA=Z2EB6irHWg_9i80aQJzZtt+5M1gDokaS9Uo2Xe_7UQ@mail.gmail.com>
Shay Rojansky <roji@roji.org> writes:
>> Yeah, it's fairly hard to see how we could respond to this complaint
>> without lobotomizing our error messages to the point of near uselessness.
>> Almost any non-constant text in an error report could possibly be seen
>> as hazardous.
> I don't think that's true - schema information (table, column names)
> definitely seems like it's in a different category than table contents.
You're not visualizing this with the appropriate amount of paranoia: just
because the database thinks that something is a table or column name
doesn't mean that that's what it actually is. A screw-up in query syntax
could lead to reporting back something that was really a data value.
Admittedly, that's not very likely given a well-debugged application
issuing the queries, but it's not something to ignore either.
> First, there are many lazily-written applications out there which simply
> show exception/error messages to users. So user A could interact with a
> website in a way that triggers a unique constraint violation, and thereby
> get access to the data in the row which caused the violation.
Well, that's just bad webapp design ...
> Second, such exceptions and errors frequently get logged (e.g. to disk).
> Logs in general aren't kept as secure as database data itself (who knows
> where they end up and who handles them).
Yeah. We more commonly see this type of complaint in the alternate guise
of "you're logging sensitive information in the postmaster log! I can't
accept that!". We've basically established a project policy that the
postmaster log has to be secured to exactly the same extent as the
database files themselves, since otherwise there's no certainty that it
won't leak data you don't want leaked. On the whole, I think the right
response to this complaint is that equal attention has to be given to
securing error logs on the client side.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, roji@roji.org, Karsten.Hilbert@gmx.net
Subject: Re: Row data is reflected in DETAIL message when constraints fail on insert/update
In-Reply-To: <14066.1561048062@sss.pgh.pa.us>
References: <CAO8wz8QdKRTJUnW--AZ2N-BvJAemS+P9=Sr7zUbkO+wmAmA7LQ@mail.gmail.com> <b2afcfd3-a2c2-9bdc-3e62-a28392f0b8f6@aklaver.com> <CADT4RqDYLKWxxHejU2ZE6Wmveo8x09Zf8aw4pdT-=0uU82Us=Q@mail.gmail.com> <20190620114527.GD30366@hermes.hilbert.loc> <7057.1561040804@sss.pgh.pa.us> <CADT4RqA=Z2EB6irHWg_9i80aQJzZtt+5M1gDokaS9Uo2Xe_7UQ@mail.gmail.com> <14066.1561048062@sss.pgh.pa.us>
* 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