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

Make a new shared_ptr to avoid use after free

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0, 7.0.13, 8.0.0-rc14
    • Affects Version/s: None
    • Component/s: None
    • None
    • Server Security
    • Fully Compatible
    • ALL
    • v8.0, v7.0
    • Security 2024-07-22
    • 200

      When running the JWK background refresh job, a client could call the refreshKeys command at the same time.

      This could cause a use after free if the refreshKeysCommand function deletes the 
      _keyManager just after JWKSetRefreshJob grabs a reference to compare its keys.
       
      One solution could be to instead of grabbing a reference to the keys, make a copy to avoid use after free if _keyManager gets deleted in the process.

      Other solution could be to make a new shared_ptr to keep the underlying object from being destroyed.

            Assignee:
            adrian.gonzalez@mongodb.com Adrian Gonzalez Montemayor
            Reporter:
            adrian.gonzalez@mongodb.com Adrian Gonzalez Montemayor
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: