]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Protect against small overread in SASLprep validation
authorJacob Champion <jchampion@postgresql.org>
Fri, 6 Feb 2026 19:08:24 +0000 (11:08 -0800)
committerJacob Champion <jchampion@postgresql.org>
Fri, 6 Feb 2026 19:08:24 +0000 (11:08 -0800)
commit5d61bdd11448bd8e61ed12df07ae8b5064772a48
treef19685c2de5683aaf3ec12df2ca719420072da68
parent67ad4387b2260884407388d597d79b34ebd992a5
Protect against small overread in SASLprep validation

(This is a cherry-pick of 390b3cbbb, which I hadn't realized wasn't
backpatched. It was originally reported to security@ and determined not
to be a vulnerability; thanks to Stanislav Osipov for noticing the
omission in the back branches.)

In case of torn UTF8 in the input data we might end up going
past the end of the string since we don't account for length.
While validation won't be performed on a sequence with a NULL
byte it's better to avoid going past the end to beging with.
Fix by taking the length into consideration.

Reported-by: Stanislav Osipov <stasos24@gmail.com>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Discussion: https://postgr.es/m/CAOYmi+mTnmM172g=_+Yvc47hzzeAsYPy2C4UBY3HK9p-AXNV0g@mail.gmail.com
Backpatch-through: 14
src/common/saslprep.c