Uploaded image for project: 'MariaDB Connector/C'
  1. MariaDB Connector/C
  2. CONC-844

OOB read and integer underflow in init_read_hdr() via untrusted dynamic column header

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Blocker
    • Resolution: Unresolved
    • 3.3.19, 3.4.9
    • 3.3, 3.4
    • Dynamic Columns
    • None

    Description

      In libmariadb/mariadb_dyncol.c, init_read_hdr() derives pointer offsets (hdr->nmpool, hdr->dtpool) and computes hdr->data_size without validating that fixed_hdr + header_size + nmpool_size <= str->length.

      A malformed dynamic column blob with inconsistent header fields causes:

      • nmpool and dtpool pointers to extend past str->str + str->length, leading to out-of-bounds reads in downstream functions like mariadb_dyncol_get_named().
      • hdr->data_size to underflow, wrapping around to a large size and bypassing downstream length checks.

      This check already exists in mariadb_dyncol_check() (line 3689) but is missing from init_read_hdr(), affecting all public API entry points.

        if (fmt->fixed_hdr + header.header_size + header.nmpool_size > str->length)
        {
          goto end;
        }
      

      originally reported by AISLE research

      Attachments

        Issue Links

          Activity

            People

              georg Georg Richter
              georg Georg Richter
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.