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

Buffer::readUTF8String in bson_validate.cpp should validate utf8

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Won't Do
    • None
    • None
    • Stability
    • Security 2020-02-24, Security 2020-03-09, Security 2020-03-23

    Description

      Currently it does not. readCString probably should too, but at least UTF8 isn't part of it's name.

      Example failing test:

          TEST(BSONValidateFast, InvalidUTF8) {
              BSONObj x = BSON("invalidUTF8" << "\xFF"); // this byte should never be in well-formed utf8.
              ASSERT_NOT_OK(validateBSON(x.objdata(), x.objsize()));
          }
      

      Attachments

        Issue Links

          Activity

            People

              spencer.jackson@mongodb.com Spencer Jackson
              mathias@mongodb.com Mathias Stearn
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: