ExportXMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.1.14, 8.0.14
    • Affects Version/s: 8.1.12, 8.0.12
    • Component/s: None
    • None
    • None
    • Fully Compatible
    • Ruby Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      On 8.0 and 8.1, Mongoid::Contextual::Memory#distinct reads
      field values with doc.send(field) when the deprecated legacy_pluck_distinct
      option is enabled:

      def distinct(field)
        if Mongoid.legacy_pluck_distinct
          documents.map{ |doc| doc.send(field) }.uniq
        else
          pluck(field).uniq
        end
      end
      

      This is a security concern as it allows arbitrary method execution (e.g. distinct(:destroy)
      will invoke destroy on each document rather than reading a field – not good).

            Assignee:
            Jamis Buck
            Reporter:
            Jamis Buck
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: