Re: Leakproofness of texteq()/textne() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Leakproofness of texteq()/textne()
Date
Msg-id 31274.1568323169@sss.pgh.pa.us
Whole thread Raw
In response to Re: Leakproofness of texteq()/textne()  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Leakproofness of texteq()/textne()
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> I wouldn't feel comfortable with ignoring information leaks that can
> happen with some valid strings but not others. That sounds like
> exactly the sort of information leak that we must prevent. The user
> can write arbitrary stuff in their query, potentially transforming
> strings so that the result hits the ERROR iff the original string had
> some arbitrary property P for which they wish to test.

Agreed.

> However, I wonder if there's any realistic case outside of an encoding
> conversion where such failures can occur. I would expect, perhaps
> naively, that the set of characters that can be represented by UTF-16
> is the same set as can be represented by UTF-8.

Unless Microsoft did something weird, that doesn't seem very likely.
I'm more worried about the possibility that ICU contains weird exception
cases that will make it fail to compare specific strings.  Noting
that ucnv_toUChars has an error indicator but ucol_strcoll does not,
it seems like again any such cases are going to boil down to
encoding conversion problems.

However, if there is some character C that makes ICU misbehave like
that, we are going to have problems with indexing strings containing C,
whether we think varstr_cmp is leaky or not.  So I'm not sure that
focusing our attention on leakiness is a helpful way to proceed.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Leakproofness of texteq()/textne()
Next
From: "Tsunakawa, Takayuki"
Date:
Subject: [bug fix??] Fishy code in tts_cirtual_copyslot()