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

Mongocryptd is willing to mark single-valued types for encryption

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 4.1.11
    • 4.1.12
    • Querying
    • None
    • Fully Compatible
    • ALL
    • Query 2019-06-03

    Description

      As an example:

      MongoDB Enterprise > db.runCommand({insert: "c", documents: [{foo: null}], jsonSchema: {type: "object", properties: {foo: {encrypt: {algorithm: "AEAD_AES_256_CBC_HMAC_SHA_512-Random", keyId: [UUID()]}}}}})
      {
          "hasEncryptionPlaceholders" : true,
          "schemaRequiresEncryption" : true,
          "result" : {
              "insert" : "c",
              "documents" : [
                  {
                      "foo" : BinData(6,"ACgAAAAQYQACAAAABWtpABAAAAAEZmnmqwnBSdWUoZ2vHYphTwp2AAA=")
                  }
              ],
              "lsid" : {
                  "id" : UUID("b9389483-7de4-44b8-a832-e4e264e5c1bc")
              }
          },
          "ok" : 1
      }
      

      This should be illegal, since the client-side encryption system should not permit either random or deterministic encryption of null, undefined, minKey, and maxKey per SERVER-40516.

      The flaw is that we make these checks when analyzing the JSON schema, but not when we're actually producing intent-to-encrypt markings. The same validity checks need to be made in both places.

      Attachments

        Issue Links

          Activity

            People

              david.storch@mongodb.com David Storch
              david.storch@mongodb.com David Storch
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: