Skip to content

crypto/tls: verifying certificate chains containing large RSA keys is slow [CVE-2023-29409] #61460

Closed

Description

@rolandshoemaker

Clients and servers which request and verify client certificates can be forced to expend a large amount of time verifying certificate chains which contain very large RSA keys during TLS handshakes.

Thanks to Mateusz Poliwczak for reporting this issue.

This is CVE-2023-29409.


This is a PRIVATE issue for CVE-2023-29409, tracked in http://b/282987216 and fixed by http://tg/1912161.

/cc @golang/security and @golang/release

Activity

  1. added this to the Go1.21 milestone on Jul 19, 2023
  2. added
    NeedsFixThe path to resolution is known, but the work has not been done.
    on Jul 20, 2023
  3. neild commented on Jul 25, 2023

    @neild
    Contributor

    @gopherbot please open backport issues

  4. gopherbot commented on Jul 25, 2023

    @gopherbot
    Contributor

    Backport issue(s) opened: #61579 (for 1.19), #61580 (for 1.20).

    Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.

  5. gopherbot commented on Aug 1, 2023

    @gopherbot
    Contributor

    Change https://go.dev/cl/514915 mentions this issue: [release-branch.go1.19] crypto/tls: restrict RSA keys in certificates to <= 8192 bits

  6. gopherbot commented on Aug 1, 2023

    @gopherbot
    Contributor

    Change https://go.dev/cl/514900 mentions this issue: [release-branch.go1.20] crypto/tls: restrict RSA keys in certificates to <= 8192 bits

  7. gopherbot commented on Aug 1, 2023

    @gopherbot
    Contributor

    Change https://go.dev/cl/515056 mentions this issue: [release-branch.go1.21] crypto/tls: restrict RSA keys in certificates to <= 8192 bits

  8. gopherbot commented on Aug 1, 2023

    @gopherbot
    Contributor

    Closed by merging a51957f to release-branch.go1.21.

  9. dmitshur commented on Aug 2, 2023

    @dmitshur
    Member

    This is fixed on release-branch.go1.21, but still needs to be fixed on the main branch for Go 1.22. Reopening for that.

    (CL 515056 said "Updates #​61460", not "Fixes #​61460", but this got closed ahead of time due anyway due to #29599.)

  10. 16 remaining items

  11. geofffranks commented on Aug 3, 2023

    @geofffranks

    We generally try to avoid introducing GODEBUG flags in security changes (and in minor releases in general), but if it is clear that there are people relying on this behavior in the wild, we can look into introducing a flag that configures this behavior in the next minor release.

    My point is that golang has allowed users to customize via code which ciphers and TLS versions to use (including less secure options to a point). It has allowed users to customers to customize via code timeouts and maximum request sizes. Why was this any different?

  12. FiloSottile commented on Aug 3, 2023

    @FiloSottile
    Contributor

    Some things in crypto/tls are configurable for legacy or compatibility reasons, but conversely there are a number of things that are not configurable in crypto/tls. In particular, we don't support testing and research use cases through the public API, encouraging instead forks like uTLS, zcrypto/ztls, and BoGo.

    To put the "extreme paranoia" angle in perspective, the NSA Commercial National Security Algorithm Suite requires 3072-bit keys all the way to Top Secret. The WebPKI root CAs have 4096-bit keys. Using keys larger than 8192 bits has no security justification, even in "extreme paranoia" threat models.

  13. Astaoth commented on Aug 22, 2023

    @Astaoth

    Hi,

    I would like to underline that 16k TLS keys is the standard upper limit in most OS for at least a decade. By making an arbitrary hardcoded limit to 8k keys breaks the standard compatibility. This should be a parameter and not hardcoded.

    Also, limiting the RSA key size is a weird way to fix this issue. It's like "your car AC sometime leaks ? Well I'll fix this by removing the AC of all the cars of the same brand. Now there is no AC leak anymore, but you can't have fresh air when it's warm outside.". It's not a fix at all, it's limiting/removing a functionality because for a large minority of users, sometime, it takes a "long time" (whatever this means) to check the RSA key.

    On a side note, qualifying 16k RSA keys of "extreme paranoia" is kind of condescendant with the users using them : you don't know the use cases, you can't make any kind of judgement.

    Kind regards

  14. mateusz834 commented on Aug 22, 2023

    @mateusz834
    Member
  15. Astaoth commented on Aug 22, 2023

    @Astaoth

    That's not really an answer. What you suggest can be done only at the building time and not at the execution time.

  16. Astaoth commented on Aug 31, 2023

    @Astaoth

    @mateusz834 @rolandshoemaker

    Well, as this issue isn't really fixed but only hidden, out of curiosity, how will you react when the same issue will be reported to you with RSA 8k keys and light servers ? Will you rull out RSA 8k keys as well and states that you don't support light hardware ?
    And next, when the same issue will be reported to you with IOT devices and RSA 4k keys, will you state that you don't support IOT devices and you will drop RSA support as well ?

    The way this issue is fixed is ridiculous and against good developpement and security pratices.

  17. heschi commented on Aug 31, 2023

    @heschi
    Contributor

    @Astaoth Please follow the Code of Conduct.

    For the record, you're incorrect: GODEBUGs can be applied at runtime.

  18. Astaoth commented on Aug 31, 2023

    @Astaoth

    Hi @heschi,

    Thank you for the information about the GODEBUG.

    Apologies but I fail to see how I've broken the code of conduct. The questions about 8k keys and IOT seem to be legitimate ones and their answers would allow me a better understanding of the GO team philosophy, especially about the security vision.

  19. ianlancetaylor commented on Aug 31, 2023

    @ianlancetaylor
    Contributor

    @Astaoth The code of conduct asks people to be charitable and respectful. There are ways to ask questions about Go development choices that do not predict what the response will be, and do not refer to what people are doing as ridiculous. Thanks.

  20. Astaoth commented on Aug 31, 2023

    @Astaoth

    @ianlancetaylor That's interresting : in this case how would judging people and organizations in a condescending manner without knowing the context or judging the people intents respect the Code of Conduct ? Or unwelcoming 15 char messages ?

    Also may I underline that I would haven't made any more noise than necessary here if an appropriate answer would have been provided in first place ?

  21. ianlancetaylor commented on Aug 31, 2023

    @ianlancetaylor
    Contributor

    I apologize on behalf of other open source contributors for making you feel condescended to or unwelcome. That is not a pleasant feeling, and I'm sorry that it happened. My only defense is that I'm sure it was not intended. The principle of charity applies here in particular: please assume that people responding to you have good intentions.

    Nobody is asking you to not make noise. We are asking you to make noise respectfully and charitably.

    Finally, note that this is not a support forum; for appropriate forums for questions about using Go please see https://go.dev/wiki/Questions.

  22. added a commit that references this issue on Feb 7, 2024
    2350afd
  23. gopherbot commented on Feb 10, 2024

    @gopherbot
    Contributor

    Change https://go.dev/cl/563136 mentions this issue: crypto/x509: document that Verify does not restrict key sizes

  24. locked and limited conversation to collaborators on Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions