Skip to content

rustls: cap maximum allowed CRL file size to 8MB #16716

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

Closed
wants to merge 2 commits into from

Conversation

bagder
Copy link
Member

@bagder bagder commented Mar 14, 2025

Allowing 4GB on a 32-bit system is just asking for problems and could in theory cause integer overflow in the dynbuf code.

The dynbuf now has an assert to catch code trying to set a max larger than 100MB, as it seems large enough for most buffers.

Reported-by: Rinku Das

Allowing 4GB on a 32-bit system is just asking for problems and could in
theory cause integer overflow in the dynbuf code.

The dynbuf now has an assert to catch code trying to set a max larger
than 100MB, as it seems large enough for most buffers.

Reported-by: Rinku Das
@bagder bagder added the TLS label Mar 14, 2025
@bagder bagder closed this in 116f490 Mar 14, 2025
@bagder bagder deleted the bagder/rustls-crlfile branch March 14, 2025 08:12
@cpu
Copy link
Contributor

cpu commented Mar 14, 2025

Was 8mb picked based on any particular logic? I suspect it might be too small.

I have some tooling leftover from when I was implementing CRL support in the webpki crate that downloaded every CRL I could find referenced in ccadb (without doing any special filtering for defunct CAs/CRLs mind you) and found CRLs that spanned the range from very small (<1mb), to medium sized (11 .. 22mb) to very large (100mb).

@bagder
Copy link
Member Author

bagder commented Mar 14, 2025

No, it was completely picked out of the air. Let me bump it to... 400MB instead.

bagder added a commit that referenced this pull request Mar 14, 2025
Ref: #16716 (comment)

> I have some tooling leftover from when I was implementing CRL support
> in the webpki crate that downloaded every CRL I could find referenced
> in ccadb (without doing any special filtering for defunct CAs/CRLs
> mind you) and found CRLs that spanned the range from very small
> (<1mb), to medium sized (11 .. 22mb) to very large (100mb).

Reported-by: Daniel McCarney
@bagder
Copy link
Member Author

bagder commented Mar 14, 2025

#16724

bagder added a commit that referenced this pull request Mar 14, 2025
Follow-up to 00fc556

Ref: #16716 (comment)

> I have some tooling leftover from when I was implementing CRL support
> in the webpki crate that downloaded every CRL I could find referenced
> in ccadb (without doing any special filtering for defunct CAs/CRLs
> mind you) and found CRLs that spanned the range from very small
> (<1mb), to medium sized (11 .. 22mb) to very large (100mb).

Reported-by: Daniel McCarney
Closes #16724
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
Allowing 4GB on a 32-bit system is just asking for problems and could in
theory cause integer overflow in the dynbuf code.

The dynbuf now has an assert to catch code trying to set a max larger
than half SIZE_T_MAX.

Reported-by: Rinku Das
Closes curl#16716
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
Follow-up to 00fc556

Ref: curl#16716 (comment)

> I have some tooling leftover from when I was implementing CRL support
> in the webpki crate that downloaded every CRL I could find referenced
> in ccadb (without doing any special filtering for defunct CAs/CRLs
> mind you) and found CRLs that spanned the range from very small
> (<1mb), to medium sized (11 .. 22mb) to very large (100mb).

Reported-by: Daniel McCarney
Closes curl#16724
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants