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

Out-of-bounds heap read in get_compression_info()

    XMLWordPrintable

Details

    Description

      In libmariadb/mariadb_rpl.c, the mariadb_rpl_fetch() function calls get_compression_info(ev, &algorithm, &header_size) inside the compressed rows-event branch prior to verifying whether sufficient bytes remain in the allocated event buffer (ev_end - ev).

      Inside get_compression_info(), after testing the buf[0] marker byte, the pointer is incremented (buf++) and reads the uncompressed length field without taking ev_end into account.

      If a compressed rows event contains a row-data section shorter than expected by the compression header, an out-of-bounds heap read occurs. The caller's existing length check (header_size >= (ev_end - ev)) only executes after the out-of-bounds read has already taken place (a check-after-use pattern).

      Attachments

        Activity

          People

            georg Georg Richter
            georg Georg Richter
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.