pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Add pg_encoding_set_invalid()
6+ messages / 1 participants
[nested] [flat]

* pgsql: Add pg_encoding_set_invalid()
@ 2025-02-10 15:09  Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 6+ messages in thread

From: Andres Freund @ 2025-02-10 15:09 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Add pg_encoding_set_invalid()

There are cases where we cannot / do not want to error out for invalidly
encoded input. In such cases it can be useful to replace e.g. an incomplete
multi-byte characters with bytes that will trigger an error when getting
validated as part of a larger string.

Unfortunately, until now, for some encoding no such sequence existed. For
those encodings this commit removes one previously accepted input combination
- we consider that to be ok, as the chosen bytes are outside of the valid
ranges for the encodings, we just previously failed to detect that.

As we cannot add a new field to pg_wchar_table without breaking ABI, this is
implemented "in-line" in the newly added function.

Author: Noah Misch <noah@leadboat.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Backpatch-through: 13
Security: CVE-2025-1094

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4dc28963533704fc7dd922b9447467466a233d89

Modified Files
--------------
src/common/wchar.c                       | 55 +++++++++++++++++++++++++++++++-
src/include/mb/pg_wchar.h                |  1 +
src/test/regress/expected/conversion.out |  7 ++++
src/test/regress/regress.c               | 50 +++++++++++++++++++++++++++++
src/test/regress/sql/conversion.sql      |  5 +++
5 files changed, 117 insertions(+), 1 deletion(-)



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

* pgsql: Add pg_encoding_set_invalid()
@ 2025-02-10 15:09  Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 6+ messages in thread

From: Andres Freund @ 2025-02-10 15:09 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Add pg_encoding_set_invalid()

There are cases where we cannot / do not want to error out for invalidly
encoded input. In such cases it can be useful to replace e.g. an incomplete
multi-byte characters with bytes that will trigger an error when getting
validated as part of a larger string.

Unfortunately, until now, for some encoding no such sequence existed. For
those encodings this commit removes one previously accepted input combination
- we consider that to be ok, as the chosen bytes are outside of the valid
ranges for the encodings, we just previously failed to detect that.

As we cannot add a new field to pg_wchar_table without breaking ABI, this is
implemented "in-line" in the newly added function.

Author: Noah Misch <noah@leadboat.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Backpatch-through: 13
Security: CVE-2025-1094

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7d43ca6fe068015b403ffa1762f4df4efdf68b69

Modified Files
--------------
src/common/wchar.c                       | 55 +++++++++++++++++++++++++++++++-
src/include/mb/pg_wchar.h                |  1 +
src/test/regress/expected/conversion.out |  7 ++++
src/test/regress/regress.c               | 50 +++++++++++++++++++++++++++++
src/test/regress/sql/conversion.sql      |  5 +++
5 files changed, 117 insertions(+), 1 deletion(-)



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

* pgsql: Add pg_encoding_set_invalid()
@ 2025-02-10 15:09  Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 6+ messages in thread

From: Andres Freund @ 2025-02-10 15:09 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Add pg_encoding_set_invalid()

There are cases where we cannot / do not want to error out for invalidly
encoded input. In such cases it can be useful to replace e.g. an incomplete
multi-byte characters with bytes that will trigger an error when getting
validated as part of a larger string.

Unfortunately, until now, for some encoding no such sequence existed. For
those encodings this commit removes one previously accepted input combination
- we consider that to be ok, as the chosen bytes are outside of the valid
ranges for the encodings, we just previously failed to detect that.

As we cannot add a new field to pg_wchar_table without breaking ABI, this is
implemented "in-line" in the newly added function.

Author: Noah Misch <noah@leadboat.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Backpatch-through: 13
Security: CVE-2025-1094

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6e05b195d0e192e143db8c4c7ef2526860341a2c

Modified Files
--------------
src/common/wchar.c                       | 55 +++++++++++++++++++++++++++++++-
src/include/mb/pg_wchar.h                |  1 +
src/test/regress/expected/conversion.out |  7 ++++
src/test/regress/regress.c               | 50 +++++++++++++++++++++++++++++
src/test/regress/sql/conversion.sql      |  5 +++
5 files changed, 117 insertions(+), 1 deletion(-)



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

* pgsql: Add pg_encoding_set_invalid()
@ 2025-02-10 15:09  Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 6+ messages in thread

From: Andres Freund @ 2025-02-10 15:09 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Add pg_encoding_set_invalid()

There are cases where we cannot / do not want to error out for invalidly
encoded input. In such cases it can be useful to replace e.g. an incomplete
multi-byte characters with bytes that will trigger an error when getting
validated as part of a larger string.

Unfortunately, until now, for some encoding no such sequence existed. For
those encodings this commit removes one previously accepted input combination
- we consider that to be ok, as the chosen bytes are outside of the valid
ranges for the encodings, we just previously failed to detect that.

As we cannot add a new field to pg_wchar_table without breaking ABI, this is
implemented "in-line" in the newly added function.

Author: Noah Misch <noah@leadboat.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Backpatch-through: 13
Security: CVE-2025-1094

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/703b3fd5de5d7bfe9cb3948601bc165da024256d

Modified Files
--------------
src/common/wchar.c                       | 55 +++++++++++++++++++++++++++++++-
src/include/mb/pg_wchar.h                |  1 +
src/test/regress/expected/conversion.out |  7 ++++
src/test/regress/regress.c               | 50 +++++++++++++++++++++++++++++
src/test/regress/sql/conversion.sql      |  5 +++
5 files changed, 117 insertions(+), 1 deletion(-)



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

* pgsql: Add pg_encoding_set_invalid()
@ 2025-02-10 15:09  Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 6+ messages in thread

From: Andres Freund @ 2025-02-10 15:09 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Add pg_encoding_set_invalid()

There are cases where we cannot / do not want to error out for invalidly
encoded input. In such cases it can be useful to replace e.g. an incomplete
multi-byte characters with bytes that will trigger an error when getting
validated as part of a larger string.

Unfortunately, until now, for some encoding no such sequence existed. For
those encodings this commit removes one previously accepted input combination
- we consider that to be ok, as the chosen bytes are outside of the valid
ranges for the encodings, we just previously failed to detect that.

As we cannot add a new field to pg_wchar_table without breaking ABI, this is
implemented "in-line" in the newly added function.

Author: Noah Misch <noah@leadboat.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Backpatch-through: 13
Security: CVE-2025-1094

Branch
------
REL_14_STABLE

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

Modified Files
--------------
src/common/wchar.c                               | 55 +++++++++++++++++++++++-
src/include/mb/pg_wchar.h                        |  3 +-
src/test/regress/expected/conversion.out         |  4 ++
src/test/regress/input/create_function_0.source  |  5 +++
src/test/regress/output/create_function_0.source |  3 ++
src/test/regress/regress.c                       | 50 +++++++++++++++++++++
src/test/regress/sql/conversion.sql              |  3 ++
7 files changed, 121 insertions(+), 2 deletions(-)



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

* pgsql: Add pg_encoding_set_invalid()
@ 2025-02-10 15:09  Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 6+ messages in thread

From: Andres Freund @ 2025-02-10 15:09 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Add pg_encoding_set_invalid()

There are cases where we cannot / do not want to error out for invalidly
encoded input. In such cases it can be useful to replace e.g. an incomplete
multi-byte characters with bytes that will trigger an error when getting
validated as part of a larger string.

Unfortunately, until now, for some encoding no such sequence existed. For
those encodings this commit removes one previously accepted input combination
- we consider that to be ok, as the chosen bytes are outside of the valid
ranges for the encodings, we just previously failed to detect that.

As we cannot add a new field to pg_wchar_table without breaking ABI, this is
implemented "in-line" in the newly added function.

Author: Noah Misch <noah@leadboat.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Backpatch-through: 13
Security: CVE-2025-1094

Branch
------
REL_13_STABLE

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

Modified Files
--------------
src/common/wchar.c                               | 55 +++++++++++++++++++++++-
src/include/mb/pg_wchar.h                        |  3 +-
src/test/regress/expected/conversion.out         |  4 ++
src/test/regress/input/create_function_1.source  |  4 ++
src/test/regress/output/create_function_1.source |  3 ++
src/test/regress/regress.c                       | 51 ++++++++++++++++++++++
src/test/regress/sql/conversion.sql              |  3 ++
7 files changed, 121 insertions(+), 2 deletions(-)



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


end of thread, other threads:[~2025-02-10 15:09 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-02-10 15:09 pgsql: Add pg_encoding_set_invalid() Andres Freund <andres@anarazel.de>
2025-02-10 15:09 pgsql: Add pg_encoding_set_invalid() Andres Freund <andres@anarazel.de>
2025-02-10 15:09 pgsql: Add pg_encoding_set_invalid() Andres Freund <andres@anarazel.de>
2025-02-10 15:09 pgsql: Add pg_encoding_set_invalid() Andres Freund <andres@anarazel.de>
2025-02-10 15:09 pgsql: Add pg_encoding_set_invalid() Andres Freund <andres@anarazel.de>
2025-02-10 15:09 pgsql: Add pg_encoding_set_invalid() Andres Freund <andres@anarazel.de>

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