postgresql/src
Tom Lane c30f082d27 Make json{b}_populate_recordset() use the right tuple descriptor.
json{b}_populate_recordset() used the tuple descriptor created from the
query-level AS clause without worrying about whether it matched the actual
input record type.  If it didn't, that would usually result in a crash,
though disclosure of server memory contents seems possible as well, for a
skilled attacker capable of issuing crafted SQL commands.  Instead, use
the query-supplied descriptor only when there is no input tuple to look at,
and otherwise get a tuple descriptor based on the input tuple's own type
marking.  The core code will detect any type mismatch in the latter case.

Michael Paquier and Tom Lane, per a report from David Rowley.
Back-patch to 9.3 where this functionality was introduced.

Security: CVE-2017-15098
2017-11-06 10:29:38 -05:00
..
backend Make json{b}_populate_recordset() use the right tuple descriptor. 2017-11-06 10:29:38 -05:00
bin Translation updates 2017-11-05 17:00:29 -05:00
common Update copyright in recently added files 2017-07-26 18:17:18 -04:00
fe_utils Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
include Always require SELECT permission for ON CONFLICT DO UPDATE. 2017-11-06 09:17:44 +00:00
interfaces Add a temp-install prerequisite to "check"-like targets not having one. 2017-11-05 18:51:15 -08:00
makefiles Always use -fPIC, not -fpic, when building shared libraries with gcc. 2017-06-01 13:32:55 -04:00
pl Allow parallel query for prepared statements with generic plans. 2017-10-29 20:48:51 +05:30
port Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
template Remove "sco" and "unixware" ports. 2016-10-11 11:26:04 -04:00
test Make json{b}_populate_recordset() use the right tuple descriptor. 2017-11-06 10:29:38 -05:00
timezone Update time zone data files to tzdata release 2017c. 2017-10-23 18:15:42 -04:00
tools Improve gendef.pl diagnostic on failure to open sym file 2017-10-26 10:04:45 -04:00
tutorial Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Remove redundant coverage target 2017-02-17 08:56:57 -05:00
Makefile.global.in Be more thorough about cleaning out gcov litter. 2017-08-11 17:39:27 -04:00
Makefile.shlib Remove support for bcc and msvc standalone libpq builds 2017-04-11 15:22:21 +02:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00