pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Protect against small overread in SASLprep validation
5+ messages / 2 participants
[nested] [flat]

* pgsql: Protect against small overread in SASLprep validation
@ 2024-09-10 09:27 Daniel Gustafsson <dgustafsson@postgresql.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Daniel Gustafsson @ 2024-09-10 09:27 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Protect against small overread in SASLprep validation

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.

Author: Jacob Champion <jacob.champion@enterprisedb.com>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Discussion: https://postgr.es/m/CAOYmi+mTnmM172g=_+Yvc47hzzeAsYPy2C4UBY3HK9p-AXNV0g@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/390b3cbbb2af3c749587b0697c01c94e0e173510

Modified Files
--------------
src/common/saslprep.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Protect against small overread in SASLprep validation
@ 2026-02-06 20:20 Jacob Champion <jchampion@postgresql.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Jacob Champion @ 2026-02-06 20:20 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5d61bdd11448bd8e61ed12df07ae8b5064772a48

Modified Files
--------------
src/common/saslprep.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Protect against small overread in SASLprep validation
@ 2026-02-06 20:20 Jacob Champion <jchampion@postgresql.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Jacob Champion @ 2026-02-06 20:20 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/46aaec4c0e6d90e9f074982feb43efd4b3c42a78

Modified Files
--------------
src/common/saslprep.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Protect against small overread in SASLprep validation
@ 2026-02-06 20:20 Jacob Champion <jchampion@postgresql.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Jacob Champion @ 2026-02-06 20:20 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/ff1d5810e907525b396c67ad900114dd4ef83dc2

Modified Files
--------------
src/common/saslprep.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Protect against small overread in SASLprep validation
@ 2026-02-06 20:20 Jacob Champion <jchampion@postgresql.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Jacob Champion @ 2026-02-06 20:20 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3bb339fa2c9f2bf09805170fe0867d83b562a324

Modified Files
--------------
src/common/saslprep.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2026-02-06 20:20 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-09-10 09:27 pgsql: Protect against small overread in SASLprep validation Daniel Gustafsson <dgustafsson@postgresql.org>
2026-02-06 20:20 pgsql: Protect against small overread in SASLprep validation Jacob Champion <jchampion@postgresql.org>
2026-02-06 20:20 pgsql: Protect against small overread in SASLprep validation Jacob Champion <jchampion@postgresql.org>
2026-02-06 20:20 pgsql: Protect against small overread in SASLprep validation Jacob Champion <jchampion@postgresql.org>
2026-02-06 20:20 pgsql: Protect against small overread in SASLprep validation Jacob Champion <jchampion@postgresql.org>

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