TencentOS Server 4: postgresql-odbc (TSSA-2026:1639)

high Nessus Plugin ID 391366

Synopsis

The remote TencentOS Server 4 host is missing one or more security updates.

Description

The version of Tencent Linux installed on the remote TencentOS Server 4 host is prior to tested version. It is, therefore, affected by multiple vulnerabilities as referenced in the TSSA-2026:1639 advisory.

Package updates are available for TencentOS Server 4 that fix the following vulnerabilities:

CVE-2026-136515:
psqlODBC rewrites statement text for keyset-driven cursors and ODBC escapes using positions it found in the text. These positions could lie outside the text or describe another statement: After SQLExecDirect() failed on a statement handle, the FROM and WHERE positions of the failed statement were applied to the next, shorter statement on that handle. The parser could record a FROM position with no text after it, and the rewrite then copied a negative length. An {fn ...} escape whose arguments contain FOR UPDATE, ; or INTO ... FROM made the driver remove a cursor prefix from the wrong buffer. {fn CONVERT(?, ...)} with an output parameter produced a negative argument length. An unclosed {fn ...} escape made the driver read past the statement, and a few thousand nested ones exhausted the stack. Translating @@identity in long statement text read an uninitialised pointer, and {? = call ...} with nothing bound for the return value dereferenced NULL. Whoever supplies the text of a statement that an application opens on a keyset-driven or dynamic cursor with a concurrency other than read-only, or calls with an output parameter, can corrupt the application's heap and end it. Code execution has not been demonstrated. Versions up to and including psqlODBC 18.00.0006 are affected.

CVE-2026-136514:
psqlODBC assumed that a table it reads keeps the definition it had when the statement was described or parsed. A database user who owns a table or view another user's application reads can crash that application, with an honest server and default options. Versions up to and including psqlODBC 18.00.0006 are affected.

CVE-2026-136513:
When Debug or CommLog is enabled and the log directory cannot be used, psqlODBC falls back to a directory under the user's home directory. It wrote that path with an unexpanded ~, which is resolved relative to the process's current directory. Another local user who controls a directory on that path can make the driver create the victim's mylog_*.log and psqlodbc_*.log files in any directory the victim can write to, or leave the victim's process blocked in open(). This completes the fix for CVE-2026-120066 in 18.00.0006.
Versions up to and including psqlODBC 18.00.0006 are affected.

CVE-2026-136512:
With SQL_C_DEFAULT, the C type of a bound column or parameter follows its SQL type. An application sizes its buffer from the type it was told when it described the statement. When the column had another type at fetch time, because the server reported another type, the table was altered, or an output parameter's result column had another type, psqlODBC wrote the larger type into the smaller buffer, causing buffer overflows. Versions up to and including psqlODBC 18.00.0006 are affected.

CVE-2026-136511:
psqlODBC mapped an SSLmode value in a connection string that it did not recognise, such as SSLmode=Require, SSLmode=Verify-Full, SSLmode={require} or SSLmode={verify-full}, to disable.
SQLDriverConnect() then returned SQL_SUCCESS with no diagnostic, and the connection was not encrypted. An attacker on the network path of such a connection can read and change its traffic. Versions up to and including psqlODBC 18.00.0006 are affected.

CVE-2026-136510:
A parameter-array execution that fails part-way leaves the rows it has already queued on the statement handle, and the next execution on that handle sends them. After a data-at-execution batch is abandoned, by SQLCancel or a rejected SQLPutData, the next SQLExecDirect sends the failed batch's rows and returns SQL_SUCCESS without sending its own statement. Versions from psqlODBC 12.02.0000 up to and including 18.00.0006 are affected.

CVE-2026-136509:
psqlODBC did not check that a server reply matches the query it sent: that a FETCH returns no more rows than it asked for, that each row has the described number of columns, that one query produces one result, and that a COPY, a transaction or the connection ends where the protocol says. By sending replies that do not match, a hostile or compromised server, or anyone on the network path of a connection that does not use sslmode=verify-full (the default is disable) can corrupt memory in the application. Versions up to and including psqlODBC 18.00.0006 are affected.

CVE-2026-136507:
psqlODBC parsed and built connection strings in ways that let a value end early:
- In a braced value, such as PWD={...}, a trailing byte 0x7d of a GBK, Big5 or SJIS character was taken for the closing brace.
- A braced value that ended right after an escaped }} was not reported as unterminated, and its contents were parsed as further keywords.
- SQLConnectW(), SQLDriverConnectW() and SQLBrowseConnectW() cut a connection string whose UTF-8 form is longer than 32767 bytes, which changes how the rest of it is parsed.
- On Windows with MSDTC, the password and user name were put into the XA open string without escaping, and the XA library copied each item of that string into a 64-byte stack buffer.
- Percent-encoding a long password wrote one byte past a 4096-byte stack buffer.

An end user who supplies a password, or another value the application puts into the connection string, can set other connection keywords, for example to connect the application to a server of their choosing. The MSDTC case can also overflow a stack buffer in the process that loads the XA library.

Versions up to and including psqlODBC 18.00.0006 are affected.

CVE-2026-136506:
psqlODBC builds queries of its own from names, and put these names into them without escaping or qualification: the database name in SQLForeignKeys(); the current schema name in catalog functions; the table name in the currtid2() call that re-reads rows of updatable cursors; column names in the inserts and updates of SQLSetPos() and SQLBulkOperations(); cursor names set with SQLSetCursorName() or returned as refcursors (FetchRefcursors=1); parameter names (SQL_DESC_NAME) in procedure calls; the = operator in an OID comparison in SQLColumns(), which the server resolves through search_path. A database user who can create a database, schema, table, column or operator with a crafted name, or an end user who supplies a cursor or parameter name to the application, can run SQL with the rights of the application's database role. Versions up to and including psqlODBC 18.00.0006 are affected.

CVE-2026-136504:
With the driver's debug log (MyLog) turned on, two paths write the database password to the log in clear text, both beside a line where the driver's own redaction masks it as PWD=xxxxx: Pressing Test in the Windows data source setup dialog (psqlsetup.dll) logs the whole connection string, which carries PWD= percent-encoded, which is reversible, and any password= or sslpassword= inside pqopt; The Unicode connect functions SQLDriverConnectW, SQLConnectW and SQLBrowseConnectW log their arguments as they convert them between UTF-16 and UTF-8, before the masking happens. The ANSI entry points are unaffected. Turning the log on takes an administrator, and MyLog is off by default. The exposure is the person who later reads the log, which in practice means a log attached to a bug report or handed to support. Making that safe is the purpose of the driver's redaction, and these two sites bypassed it. Versions up to and including psqlODBC 18.00.0006 are affected.

CVE-2026-136503:
psqlODBC frees memory that is still in use, frees it twice, or writes outside an application buffer in these cases: clean-up at commit/rollback re-entered by its own queries' replies; libpq notice callback running clean-up and closing connection while libpq still uses it; freeing a statement whose result holds several cursors (FetchRefcursors=1 or UseDeclareFetch=1) used the freed first result; with UseDeclareFetch=1 rollback-closed updatable cursor rows counted but not stored causing uninitialised pointer free and row write past keyset; SQLGetData() wrote past application buffer after multi-row fetch failed on non-first row; SQLProcedureColumns() double free on catalog query failure; in process named sqlservr server version below 8.4 double free in statement parser; failed SQLPutData mid SQLSetPos()/SQLBulkOperations() data-at-execution left operation pending with stale callback dereferencing NULL. Versions up to and including psqlODBC 18.00.0006 are affected.

CVE-2026-136502:
psqlODBC scans statement text itself to substitute parameters, translate ODBC escapes, join batched statements and rewrite queries for updatable cursors. Where it read the text differently from the server, text the driver took for data ran as SQL, or a positioned write went to another table. An end user who controls text the application puts into a statement, or a parameter value, can run SQL with the rights of the application's database role. Versions up to and including psqlODBC 18.00.0006 are affected.

CVE-2026-136501:
To build positioned updates and to describe columns, psqlODBC matches the names in a statement against the catalog. Where it matched differently from the server, it used another table or column: table and schema names compared case-insensitively in column-information cache (users could be taken for another user's Users table, driver evaluated that table's column default to answer @@IDENTITY); in FROM ONLY t, ONLY taken for table name; column names compared case-insensitively so with Parse=1 another column's type could decide buffer size and fetch overflowed; in single-byte encodings (LATIN1, SQL_ASCII) server folds accented letters of unquoted names by its locale while driver folded only A-Z, so TAT could be taken for another user's tat; on non-Windows systems in Turkish or Azeri locale an unquoted I did not fold to i;
without schema name SQLSpecialColumns() could report key columns of another user's same-named temporary table and SQLPrimaryKeys() could take another user's index for the primary key; after search_path changed other than by plain SET, positioned writes went to same-named table in previously current schema;
SQLBulkOperations() trusted ctid in application-supplied variable-length bookmark and ignored cursor WHERE clause, so a forged bookmark read/updated/deleted any row. A database user who can create a table in a schema on another user's search_path can redirect that user's positioned updates, inserts and deletes, or run an expression under the victim's role. Versions up to and including psqlODBC 18.00.0006 are affected.

CVE-2026-136500:
To escape a bound parameter, or a name passed to a catalog function, psqlODBC has to know where each multibyte character of the client encoding ends. It treated a client encoding named by an alias the server accepts, such as WIN950, Windows950 or big-5 for BIG5, as single-byte, and it accepted too narrow a range of lead bytes for JOHAB, EUC_TW, EUC_CN and EUC_KR. A quote byte that the server reads as part of such a character was then not doubled, or a quote the server reads on its own was taken for part of a character, and the literal ended early. An end user who controls one bound character parameter, or a name the application passes to a catalog function such as SQLTables(), can run SQL with the rights of the application's database role. This requires a connection that is not in UTF-8: the ANSI driver, or the ANSI entry points, with one of these client encodings. For bound parameters the driver must also be substituting parameters itself, as it does with UseServerSidePrepare=0 or a cursor type other than forward-only. Versions up to and including psqlODBC 18.00.0006 are affected.

CVE-2026-136499:
psqlODBC read memory it had not written, or memory past the end of an application buffer, and sent it to the server or returned it to the application (uninitialised heap/stack memory leak via SQL_C_CHAR large- object binding, truncated bytea/large-object values on positioned updates, hex text with NUL bound to binary parameter, RowVersioning=1 SQLColumns() on nonexistent table, UseDeclareFetch=1 block cursor bookmarks and ctid, UseServerSidePrepare=0 describe before execute, and heap addresses used in server-side object names). Versions up to and including psqlODBC 18.00.0006 are affected.

Tenable has extracted the preceding description block directly from the Tencent Linux security advisory.

Note that Nessus has not tested for these issues but has instead relied only on the application's self-reported version number.

Solution

Update the affected packages.

See Also

https://mirrors.tencent.com/tlinux/errata/tssa-20261639.xml

Plugin Details

Severity: High

ID: 391366

File Name: tencentos_TSSA_2026_1639.nasl

Version: 1.1

Type: Local

Published: 12/2/2026

Updated: 12/2/2026

Supported Sensors: Nessus

Risk Information

VPR

Risk Factor: High

Score: 7.7

Percentile: 98.78

CVSS v2

Risk Factor: Medium

Base Score: 6.4

Temporal Score: 4.7

Vector: CVSS2#AV:N/AC:L/Au:N/C:P/I:N/A:P

CVSS Score Source: CVE-2026-136499

CVSS v3

Risk Factor: High

Base Score: 8.1

Temporal Score: 7.1

Vector: CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Temporal Vector: CVSS:3.0/E:U/RL:O/RC:C

CVSS Score Source: CVE-2026-136507

Vulnerability Information

CPE: cpe:/o:tencent:tencentos_server:4, p-cpe:/a:tencent:tencentos_server:postgresql-odbc

Required KB Items: Host/local_checks_enabled, Host/cpu, Host/etc/os-release, Host/TencentOS/rpm-list

Exploit Ease: No known exploits are available

Patch Publication Date: 12/1/2026

Vulnerability Publication Date: 11/19/2026

Reference Information

CVE: CVE-2026-136499, CVE-2026-136500, CVE-2026-136501, CVE-2026-136502, CVE-2026-136503, CVE-2026-136504, CVE-2026-136506, CVE-2026-136507, CVE-2026-136509, CVE-2026-136510, CVE-2026-136511, CVE-2026-136512, CVE-2026-136513, CVE-2026-136514, CVE-2026-136515