agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
pgsql: Mark PQfn() unsafe and fix overrun in frontend LO interface.
6+ messages / 1 participants
[nested] [flat]

* pgsql: Mark PQfn() unsafe and fix overrun in frontend LO interface.
@ 2026-05-11 12:19  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2026-05-11 12:19 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Mark PQfn() unsafe and fix overrun in frontend LO interface.

When result_is_int is set to 0, PQfn() cannot validate that the
result fits in result_buf, so it will write data beyond the end of
the buffer when the server returns more data than requested.  Since
this function is insecurable and obsolete, add a warning to the top
of the pertinent documentation advising against its use.

The only in-tree caller of PQfn() is the frontend large object
interface.  To fix that, add a buf_size parameter to
pqFunctionCall3() that is used to protect against overruns, and use
it in a private version of PQfn() that also accepts a buf_size
parameter.

Reported-by: Yu Kunpeng <yu443940816@live.com>
Reported-by: Martin Heistermann <martin.heistermann@unibe.ch>
Author: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Noah Misch <noah@leadboat.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Etsuro Fujita <etsuro.fujita@gmail.com>
Security: CVE-2026-6477
Backpatch-through: 14

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/bd48114937c8af9cb86972e2b576924a761359cf
Author: Nathan Bossart <nathan@postgresql.org>

Modified Files
--------------
doc/src/sgml/libpq.sgml             | 11 ++++++++---
src/interfaces/libpq/fe-exec.c      | 16 +++++++++++++++-
src/interfaces/libpq/fe-lobj.c      | 12 ++++++------
src/interfaces/libpq/fe-protocol3.c | 13 ++++++++++++-
src/interfaces/libpq/libpq-int.h    |  6 +++++-
5 files changed, 46 insertions(+), 12 deletions(-)



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

* pgsql: Mark PQfn() unsafe and fix overrun in frontend LO interface.
@ 2026-05-11 12:19  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2026-05-11 12:19 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Mark PQfn() unsafe and fix overrun in frontend LO interface.

When result_is_int is set to 0, PQfn() cannot validate that the
result fits in result_buf, so it will write data beyond the end of
the buffer when the server returns more data than requested.  Since
this function is insecurable and obsolete, add a warning to the top
of the pertinent documentation advising against its use.

The only in-tree caller of PQfn() is the frontend large object
interface.  To fix that, add a buf_size parameter to
pqFunctionCall3() that is used to protect against overruns, and use
it in a private version of PQfn() that also accepts a buf_size
parameter.

Reported-by: Yu Kunpeng <yu443940816@live.com>
Reported-by: Martin Heistermann <martin.heistermann@unibe.ch>
Author: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Noah Misch <noah@leadboat.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Etsuro Fujita <etsuro.fujita@gmail.com>
Security: CVE-2026-6477
Backpatch-through: 14

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/be013644043e5bae7260c09ab49cc6d64b7992be
Author: Nathan Bossart <nathan@postgresql.org>

Modified Files
--------------
doc/src/sgml/libpq.sgml             | 11 ++++++++---
src/interfaces/libpq/fe-exec.c      | 16 +++++++++++++++-
src/interfaces/libpq/fe-lobj.c      | 12 ++++++------
src/interfaces/libpq/fe-protocol3.c | 13 ++++++++++++-
src/interfaces/libpq/libpq-int.h    |  6 +++++-
5 files changed, 46 insertions(+), 12 deletions(-)



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

* pgsql: Mark PQfn() unsafe and fix overrun in frontend LO interface.
@ 2026-05-11 12:19  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2026-05-11 12:19 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Mark PQfn() unsafe and fix overrun in frontend LO interface.

When result_is_int is set to 0, PQfn() cannot validate that the
result fits in result_buf, so it will write data beyond the end of
the buffer when the server returns more data than requested.  Since
this function is insecurable and obsolete, add a warning to the top
of the pertinent documentation advising against its use.

The only in-tree caller of PQfn() is the frontend large object
interface.  To fix that, add a buf_size parameter to
pqFunctionCall3() that is used to protect against overruns, and use
it in a private version of PQfn() that also accepts a buf_size
parameter.

Reported-by: Yu Kunpeng <yu443940816@live.com>
Reported-by: Martin Heistermann <martin.heistermann@unibe.ch>
Author: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Noah Misch <noah@leadboat.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Etsuro Fujita <etsuro.fujita@gmail.com>
Security: CVE-2026-6477
Backpatch-through: 14

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d88c7be156bbde61ccff337152bf640387b2c629
Author: Nathan Bossart <nathan@postgresql.org>

Modified Files
--------------
doc/src/sgml/libpq.sgml             | 11 ++++++++---
src/interfaces/libpq/fe-exec.c      | 16 +++++++++++++++-
src/interfaces/libpq/fe-lobj.c      | 12 ++++++------
src/interfaces/libpq/fe-protocol3.c | 13 ++++++++++++-
src/interfaces/libpq/libpq-int.h    |  6 +++++-
5 files changed, 46 insertions(+), 12 deletions(-)



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

* pgsql: Mark PQfn() unsafe and fix overrun in frontend LO interface.
@ 2026-05-11 12:19  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2026-05-11 12:19 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Mark PQfn() unsafe and fix overrun in frontend LO interface.

When result_is_int is set to 0, PQfn() cannot validate that the
result fits in result_buf, so it will write data beyond the end of
the buffer when the server returns more data than requested.  Since
this function is insecurable and obsolete, add a warning to the top
of the pertinent documentation advising against its use.

The only in-tree caller of PQfn() is the frontend large object
interface.  To fix that, add a buf_size parameter to
pqFunctionCall3() that is used to protect against overruns, and use
it in a private version of PQfn() that also accepts a buf_size
parameter.

Reported-by: Yu Kunpeng <yu443940816@live.com>
Reported-by: Martin Heistermann <martin.heistermann@unibe.ch>
Author: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Noah Misch <noah@leadboat.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Etsuro Fujita <etsuro.fujita@gmail.com>
Security: CVE-2026-6477
Backpatch-through: 14

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/614474996a48b7fc7f83faf9a940600041a80d67
Author: Nathan Bossart <nathan@postgresql.org>

Modified Files
--------------
doc/src/sgml/libpq.sgml             | 11 ++++++++---
src/interfaces/libpq/fe-exec.c      | 16 +++++++++++++++-
src/interfaces/libpq/fe-lobj.c      | 12 ++++++------
src/interfaces/libpq/fe-protocol3.c | 13 ++++++++++++-
src/interfaces/libpq/libpq-int.h    |  6 +++++-
5 files changed, 46 insertions(+), 12 deletions(-)



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

* pgsql: Mark PQfn() unsafe and fix overrun in frontend LO interface.
@ 2026-05-11 12:19  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2026-05-11 12:19 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Mark PQfn() unsafe and fix overrun in frontend LO interface.

When result_is_int is set to 0, PQfn() cannot validate that the
result fits in result_buf, so it will write data beyond the end of
the buffer when the server returns more data than requested.  Since
this function is insecurable and obsolete, add a warning to the top
of the pertinent documentation advising against its use.

The only in-tree caller of PQfn() is the frontend large object
interface.  To fix that, add a buf_size parameter to
pqFunctionCall3() that is used to protect against overruns, and use
it in a private version of PQfn() that also accepts a buf_size
parameter.

Reported-by: Yu Kunpeng <yu443940816@live.com>
Reported-by: Martin Heistermann <martin.heistermann@unibe.ch>
Author: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Noah Misch <noah@leadboat.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Etsuro Fujita <etsuro.fujita@gmail.com>
Security: CVE-2026-6477
Backpatch-through: 14

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e3a1f83eae4fc1d8281908322189d4f95de873a7
Author: Nathan Bossart <nathan@postgresql.org>

Modified Files
--------------
doc/src/sgml/libpq.sgml             | 11 ++++++++---
src/interfaces/libpq/fe-exec.c      | 16 +++++++++++++++-
src/interfaces/libpq/fe-lobj.c      | 12 ++++++------
src/interfaces/libpq/fe-protocol3.c | 14 +++++++++++++-
src/interfaces/libpq/libpq-int.h    |  6 +++++-
5 files changed, 47 insertions(+), 12 deletions(-)



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

* pgsql: Mark PQfn() unsafe and fix overrun in frontend LO interface.
@ 2026-05-11 12:19  Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2026-05-11 12:19 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Mark PQfn() unsafe and fix overrun in frontend LO interface.

When result_is_int is set to 0, PQfn() cannot validate that the
result fits in result_buf, so it will write data beyond the end of
the buffer when the server returns more data than requested.  Since
this function is insecurable and obsolete, add a warning to the top
of the pertinent documentation advising against its use.

The only in-tree caller of PQfn() is the frontend large object
interface.  To fix that, add a buf_size parameter to
pqFunctionCall3() that is used to protect against overruns, and use
it in a private version of PQfn() that also accepts a buf_size
parameter.

Reported-by: Yu Kunpeng <yu443940816@live.com>
Reported-by: Martin Heistermann <martin.heistermann@unibe.ch>
Author: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Noah Misch <noah@leadboat.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Etsuro Fujita <etsuro.fujita@gmail.com>
Security: CVE-2026-6477
Backpatch-through: 14

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8ac723b2bc992fd86b09ae73c7c610242c4c037e
Author: Nathan Bossart <nathan@postgresql.org>

Modified Files
--------------
doc/src/sgml/libpq.sgml             | 11 ++++++++---
src/interfaces/libpq/fe-exec.c      | 16 +++++++++++++++-
src/interfaces/libpq/fe-lobj.c      | 12 ++++++------
src/interfaces/libpq/fe-protocol3.c | 14 +++++++++++++-
src/interfaces/libpq/libpq-int.h    |  6 +++++-
5 files changed, 47 insertions(+), 12 deletions(-)



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


end of thread, other threads:[~2026-05-11 12:19 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-05-11 12:19 pgsql: Mark PQfn() unsafe and fix overrun in frontend LO interface. Noah Misch <noah@leadboat.com>
2026-05-11 12:19 pgsql: Mark PQfn() unsafe and fix overrun in frontend LO interface. Noah Misch <noah@leadboat.com>
2026-05-11 12:19 pgsql: Mark PQfn() unsafe and fix overrun in frontend LO interface. Noah Misch <noah@leadboat.com>
2026-05-11 12:19 pgsql: Mark PQfn() unsafe and fix overrun in frontend LO interface. Noah Misch <noah@leadboat.com>
2026-05-11 12:19 pgsql: Mark PQfn() unsafe and fix overrun in frontend LO interface. Noah Misch <noah@leadboat.com>
2026-05-11 12:19 pgsql: Mark PQfn() unsafe and fix overrun in frontend LO interface. Noah Misch <noah@leadboat.com>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox