Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GODRIVER-2869 Two protocol validations to reduce client denial of service risks #1291

Merged
merged 4 commits into from
Jun 22, 2023

Commits on Jun 9, 2023

  1. bsoncore.readLengthBytes handle invalid lengths

    The length by definition needs to include the 4 bytes for the size.
    If a size of zero is provided this can result in an infinite loop as providing the zero to `src[l:]` will result in the slice not being consumed.  Allowing the zero length to be read for infinity.
    jentfoo committed Jun 9, 2023
    Configuration menu
    Copy the full SHA
    c01377d View commit details
    Browse the repository at this point in the history
  2. compression.go: Fix for DoS condition when snappy defines a larger ou…

    …tput
    
    In addition tot he MongoDB protocol Snappy also has an encoded size.
    If the Snappy payload is larger (or at least claims to be larger), the Snappy module will allocate a new byte slice to match the needed size.
    This could result in memory exhaustion.
    jentfoo committed Jun 9, 2023
    Configuration menu
    Copy the full SHA
    8cf68b7 View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2023

  1. Update x/mongo/driver/compression.go

    Co-authored-by: Alan Parra <[email protected]>
    jentfoo and codingllama committed Jun 12, 2023
    Configuration menu
    Copy the full SHA
    e5d91a6 View commit details
    Browse the repository at this point in the history
  2. Apply suggestions from code review

    Co-authored-by: Qingyang Hu <[email protected]>
    jentfoo and qingyang-hu authored Jun 12, 2023
    Configuration menu
    Copy the full SHA
    6b177de View commit details
    Browse the repository at this point in the history