ExportXMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.20.2
    • Affects Version/s: None
    • Component/s: Security, TLS/SSL
    • None
    • None
    • Python 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

      Problem and impact

      PyMongo accepts a stapled OCSP response without verifying that it covers the presented TLS certificate. A revoked endpoint can therefore staple a genuine issuer-signed Good response for a different certificate from the same CA and complete the handshake. The client then volunteers credentials (PLAIN passwords, OIDC tokens) to the revoked endpoint.

      Detailed steps to reproduce the problem

      • Connect over TLS to a server presenting a revoked, must-staple certificate stapled with a Good response issued for a different certificate from the same CA (pymongo[ocsp] extra installed).
      • The connection succeeds and authenticates. Reproduce with the PoC attached to SECBUG-5809.

      Definition of done: what must be done to consider the task complete?

      • PyMongo rejects a stapled OCSP response that does not cover the presented certificate and ends the connection, per the MongoDB OCSP spec's suggested behavior #2.
      • Regression tests cover the rejection case.

      The exact version of PyMongo used, with patch level

      All releases from 3.11.0 up to the fix in 4.20.2 (3.11 < 4.20.2), including master. Only the synchronous driver with the pymongo[ocsp] extra is affected; the asynchronous driver is not.

      Security Vulnerabilities

      Tracked as SECBUG-5809 (embargoed HackerOne report; mirrored in SECBUG-5802). Keep this ticket restricted to MongoDB Internal and coordinate disclosure through Product Security.

            Assignee:
            Steve Silvester
            Reporter:
            Steve Silvester
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: