CVE-2026-136509
Desbordamiento de memoria en psqlODBC
En resumen
Un atacante remoto, sin usuario ni contraseña, podría tomar el control del sistema afectado si engaña a alguien para que abra un archivo o un enlace.
Cómo se ataca
- Se puede atacar por la red, incluso desde internet si el servicio está expuesto.
- Requiere condiciones particulares que el atacante no siempre controla.
- No necesita usuario ni contraseña.
- Necesita que alguien haga algo, como abrir un archivo, visitar una página o hacer clic en un enlace.
Qué puede lograr el atacante
- Leer información confidencial: datos, archivos o credenciales.
- Modificar información o el sistema; en los casos graves, ejecutar sus propios programas.
- Dejar el servicio o el equipo sin funcionar.
Cómo corregirla
- Revise si usa alguno de los productos y versiones de la lista «A qué afecta».
- Aplique la actualización o la mitigación que indica el fabricante.
- Si no puede actualizar ya, reduzca la exposición: que el servicio no sea accesible desde internet, o desactive la función afectada.
Recomendaciones para este tipo de fallo
- Aplicar la actualización del fabricante: es la única corrección real para quien usa el producto.
- Mientras tanto, limitar quién llega al servicio vulnerable (firewall, no exponerlo a internet, desactivar la función afectada).
- Para quien desarrolla: comprobar tamaños antes de copiar, usar funciones con límite, compilar con protecciones (ASLR, DEP, canarios, FORTIFY_SOURCE) y considerar lenguajes con memoria segura (Rust, Go, C#, Java).
A qué afecta
PostgreSQL · psqlODBC
hasta 18.00.0006 inclusive
Qué es: Escritura fuera de los límites de memoria (desbordamiento de búfer)
El programa escribe más datos de los que caben en un espacio de memoria y pisa lo que hay al lado, lo que permite a un atacante cerrar el programa o ejecutar su propio código.
En lenguajes como C y C++ el programador decide cuánto mide cada espacio de memoria. Si copia un dato recibido sin comprobar su tamaño, el exceso sobrescribe otras variables o direcciones de retorno. Un atacante que controla esos bytes puede desviar el programa a su código. Afecta sistemas operativos, navegadores, firmware de equipos y cualquier programa que procese archivos o tráfico de red.
Guía completa: dónde aparece, cómo se corrige y qué evitarDescripción oficial (en inglés)
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: - A FETCH reply with more rows than requested overflows the row cache. - Extra results in reply to a FETCH, or to the queries of a keyset-driven cursor, are freed while still in use. - A key query of a keyset-driven cursor answered with extra columns, or a re-read row with fewer columns, overflows the row cache. - Replies without columns or rows, or with NULL values, to the driver's internal queries at connect time and in catalog functions are dereferenced. - A malformed relacl value in SQLTablePrivileges() makes the driver write past a buffer. - On Windows with MSDTC, a long transaction name returned by the server overflows a buffer during recovery. - Values in replies to the driver's internal queries are used without checking their range: an empty column name, a parameter count, a large-object size, a function's or trigger's argument count, and a result of exactly 32767 columns. They are dereferenced, read past, returned to the application or sent back to the server as stack memory, or make the driver loop forever. - A reply that ends a COPY, the connection or the transaction at an unexpected point leaves freed results, keysets or table information in use: a CopyOutResponse followed by a lost connection, a ROLLBACK command tag under UseDeclareFetch=1, or a lost connection while a cursor with positioned updates is closed. Eight extra bytes in a reply also make the driver wait forever for a COPY to end. - On Windows, a start-up reply without client_encoding crashes the driver, and with MSDTC a failed connection makes the XA library use a connection it has already freed. - An error message ending in the first byte of a multibyte character leaves the SQLSTATE returned by SQLGetDiagRecW() unterminated. - When a string value did not fit the application's buffer, eight Unicode entry points filled the buffer and wrote no null terminator, so a caller that reads to the terminator, as ODBC allows, read past the end of its own buffer. This continues the fixes for CVE-2026-120058 and CVE-2026-120060, which covered other replies. The demonstrated results are crashes and heap corruption; code execution has not been demonstrated. Versions up to and including psqlODBC 18.00.0006 are affected.