Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-71049

crypt_shared emits log messages to stdout when loaded by libmongocrypt

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.3.0-rc0, 6.0.5
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v6.2, v6.0
    • Security 2022-11-28

      Several drivers have noticed unexpected output when running some CSFLE tests with crypt_shared on the "latest" server version (6.2-dev). From my own tests related to PHPC-2156, I observed several log emitted to stdout when libmongocrypt was initialized (and crypt_shared linked) and once again when the process terminated.

      Consider the following script:

      <?php
      
      define('CSFLE_LOCAL_KEY', base64_decode('Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk'));
      
      $driverOptions = [
        'autoEncryption' => [
          'keyVaultNamespace' => 'encryption.__keyVault',
          'kmsProviders' => ['local' => ['key' => new MongoDB\BSON\Binary(CSFLE_LOCAL_KEY, 0)]],
          'extraOptions' => ['cryptSharedLibPath' => getenv('CRYPT_SHARED_LIB_PATH')],
        ],
      ];
      
      echo "A\n";
      new MongoDB\Driver\Manager(getenv('MONGODB_URI'), [], $driverOptions);
      echo "B\n";
      

      Executing this against 6.2.0-dev produced the following output:

      A
      {"t":{"$date":"2022-11-03T09:11:38.035Z"},"s":"I",  "c":"NETWORK",  "id":4648601, "ctx":"main","msg":"Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize."}
      B
      {"t":{"$date":"2022-11-03T09:11:38.037Z"},"s":"I",  "c":"ASIO",     "id":6529201, "ctx":"main","msg":"Network interface redundant shutdown","attr":{"state":"Stopped"}}
      {"t":{"$date":"2022-11-03T09:11:38.037Z"},"s":"I",  "c":"ASIO",     "id":22582,   "ctx":"main","msg":"Killing all outstanding egress activity."}
      

      The exact version of mongod and crypt_shared used to reproduce this is as follows:

      Specific version info from the mongod's buildInfo:

      version: '6.2.0-alpha-1387-g2e4717a',
      gitVersion: '2e4717ad14a2d6ce480c34d262476dd6cc11759c',
      

            Assignee:
            erwin.pe@mongodb.com Erwin Pe
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: