GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Apply certificate list size floor by arnabnandy7 · Pull Request #17674 · netty/netty

Conversation

@arnabnandy7

@arnabnandy7 arnabnandy7 commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Motivation:

BoringSSL enforces a 16 KiB minimum certificate-list limit. Passing a smaller positive MAX_CERTIFICATE_LIST_BYTES value unchanged can cause compressed certificates to be rejected with UNCOMPRESSED_CERT_TOO_LARGE, even though the effective lower bound for certificate processing is 16 KiB.

Modification:

  • Clamp positive MAX_CERTIFICATE_LIST_BYTES values below 16 KiB to 16 KiB.
  • Preserve zero and negative values unchanged.
  • Document the effective minimum in OpenSslContextOption.
  • Add focused tests covering values below, at, and above the boundary, as well as zero and negative values.

Result:

Certificate-list size limits are consistent with BoringSSL's effective 16 KiB minimum, including when processing compressed certificates.

Fixes #17673.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@arnabnandy7
Apply certificate list size floor
707e964
Signed-off-by: Arnab Nandy <[email protected]>
allthingssecurity
allthingssecurity reviewed Oct 2, 2026
View reviewed changes

@allthingssecurity allthingssecurity left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I checked this against BoringSSL's source and with real handshakes (netty-tcnative-boringssl-static 2.0.84,
TLS 1.3, osx-aarch_64).

Why the floor exists. In BoringSSL (and AWS-LC), the handshake message limit is
max(16384, max_cert_list) (ssl_max_handshake_message_len, ssl/handshake.cc), but a compressed certificate is
rejected when uncompressed_len > ssl->max_cert_list (ssl/tls13_both.cc) with no floor. So a small limit is
silently raised to 16 KiB for a normal Certificate message and applied exactly for a compressed one.

Handshakes. Server certificate padded to about 6.8 KB or 20.8 KB, client MAX_CERTIFICATE_LIST_BYTES as shown,
certificate compression negotiated or not:

Client limit Cert size Compression 4.2 This PR
not set 6.8 KB yes OK OK
4096 6.8 KB no OK (16 KiB floor) OK
4096 6.8 KB yes fails (rejected before decompression) OK
1 6.8 KB yes fails OK
0 6.8 KB no OK OK
0 6.8 KB yes fails still fails
16384 6.8 KB yes OK OK
4096 20.8 KB no / yes fails / fails fails / fails
65536 20.8 KB no / yes OK / OK OK / OK

So the PR does what it says, and limits above 16 KiB are still enforced in both modes.

Nits:

  1. Zero. 0 is passed through, so it keeps the inconsistency: an uncompressed certificate is accepted (16 KiB
    floor) and every compressed one is rejected. If 0 has no intended meaning here, >= 0 (or rejecting values <= 0
    when the option is set) would make it consistent too. Negative values are cast to a huge size_t and capped by
    BoringSSL at its maximum handshake size, so they effectively mean "no limit"; that might be worth a sentence in the
    javadoc as well.
  2. Test. ReferenceCountedOpenSslContextTest only checks maxCertificateListBytes(int). A handshake test with
    compression and a small limit would cover the actual behaviour; it can sit next to
    testMaxCertificateListSmallLimitAccept in OpenSslEngineTest or in OpenSslCertificateCompressionTest
    (my harness: a pass-through compression algorithm, limit 4096, a 6.8 KB certificate; it fails on 4.2 and passes
    with the PR).
  3. OpenSSL. The option is reported as supported only for BoringSSL / AWS-LC (OpenSsl.isOptionSupported), but
    ReferenceCountedOpenSslContext still applies it with any tcnative flavour. OpenSSL enforces max_cert_list
    exactly (ossl_statem_client_max_message_size returns s->max_cert_list for the Certificate message), so with
    OpenSSL the clamp would raise a user's limit. Gating the floor on OpenSsl.isBoringSSL() || OpenSsl.isAWSLC() would
    leave OpenSSL alone. Minor, since the option is documented as BoringSSL-only.

The failing macos-x86_64-java11-boringssl job fails in KQueueDatagramUnicastIPv6MappedTest, unrelated (#17715 hits
the same failure). 4.1 passes the value unchanged at the same place (ReferenceCountedOpenSslContext.java:458), so
this applies there too.

Prepared with Claude Code on behalf of allthingssecurity.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

arnabnandy7 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
arnabnandy7 and others added 3 commits October 3, 2026 14:14
@arnabnandy7
Merge branch '4.2' into fix/certificateListFloor
8df17e0
@arnabnandy7
Merge branch '4.2' into fix/certificateListFloor
e7382fe
@normanmaurer
Add handshake tests for MAX_CERTIFICATE_LIST_BYTES floor with certifi…
5a490ff
…cate compression

Motivation:

BoringSSL rejects a compressed certificate whose uncompressed length exceeds
max_cert_list without applying the 16 KiB floor it applies to regular
handshake messages. The unit test for ReferenceCountedOpenSslContext only
verifies the clamping helper, not that a real handshake with certificate
compression and a small limit succeeds.

Modification:

- Add OpenSslCertificateCompressionTest.testMaxCertificateListSmallLimitWithCompression
  which uses a 4096 byte limit and a ~6 KiB certificate with compression
  negotiated and expects the handshake to succeed.
- Add OpenSslCertificateCompressionTest.testMaxCertificateListLimitAboveFloorWithCompression
  to ensure certificates larger than the 16 KiB floor are still rejected.

Result:

The effective 16 KiB minimum for MAX_CERTIFICATE_LIST_BYTES is covered by
handshake tests for compressed certificates.
@normanmaurer

normanmaurer commented Oct 15, 2026

Copy link
Copy Markdown
Member

Pushed an extra test as @allthingssecurity suggested.

arnabnandy7 reacted with thumbs up emoji arnabnandy7 reacted with heart emoji
All reactions
  • 👍 1 reaction
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer normanmaurer added this to the 4.2.20.Final milestone Oct 15, 2026
@normanmaurer normanmaurer added needs-cherry-pick-4.1 This PR should be cherry-picked to 4.1 once merged. needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. labels Oct 15, 2026
normanmaurer
normanmaurer approved these changes Oct 15, 2026
View reviewed changes
@testlens-app

testlens-app Bot commented Oct 15, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 5a490ff
▶️ Tests: 143177 executed
⚪️ Checks: 30/30 completed


Learn more about TestLens at testlens.app/docs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer
normanmaurer merged commit fcac457 into netty:4.2 Oct 16, 2026
31 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@netty-project-bot

netty-project-bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Could not create auto-port PR.
Got conflicts when cherry-picking onto 5.0.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@netty-project-bot

netty-project-bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Could not create auto-port PR.
Got conflicts when cherry-picking onto 4.1.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer

normanmaurer commented Oct 16, 2026

Copy link
Copy Markdown
Member

Port for 4.1 #17861

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer

normanmaurer commented Oct 16, 2026

Copy link
Copy Markdown
Member

Port for 5.0 #17862

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer normanmaurer removed needs-cherry-pick-4.1 This PR should be cherry-picked to 4.1 once merged. needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. labels Oct 16, 2026
normanmaurer added a commit that referenced this pull request Oct 16, 2026
@normanmaurer @arnabnandy7
Port 4.1: Apply certificate list size floor (#17674) (#17861)
9cf1e64
Motivation:

BoringSSL enforces a 16 KiB minimum certificate-list limit. Passing a
smaller positive MAX_CERTIFICATE_LIST_BYTES value unchanged can cause
compressed certificates to be rejected with UNCOMPRESSED_CERT_TOO_LARGE,
even though the effective lower bound for certificate processing is 16
KiB.

Modification:

- Clamp positive MAX_CERTIFICATE_LIST_BYTES values below 16 KiB to 16
KiB.
- Preserve zero and negative values unchanged.
- Document the effective minimum in OpenSslContextOption.
- Add focused tests covering values below, at, and above the boundary,
as well as zero and negative values.

Result:

Certificate-list size limits are consistent with BoringSSL's effective
16 KiB minimum, including when processing compressed certificates.

Fixes #17673.

---------

Signed-off-by: Arnab Nandy <[email protected]>
Co-authored-by: Norman Maurer <[email protected]>

Signed-off-by: Arnab Nandy <[email protected]>
Co-authored-by: Arnab Nandy <[email protected]>
normanmaurer added a commit that referenced this pull request Oct 16, 2026
@normanmaurer @arnabnandy7
Port 5.0: Apply certificate list size floor (#17674) (#17862)
b2f9c98
Motivation:

BoringSSL enforces a 16 KiB minimum certificate-list limit. Passing a
smaller positive MAX_CERTIFICATE_LIST_BYTES value unchanged can cause
compressed certificates to be rejected with UNCOMPRESSED_CERT_TOO_LARGE,
even though the effective lower bound for certificate processing is 16
KiB.

Modification:

- Clamp positive MAX_CERTIFICATE_LIST_BYTES values below 16 KiB to 16
KiB.
- Preserve zero and negative values unchanged.
- Document the effective minimum in OpenSslContextOption.
- Add focused tests covering values below, at, and above the boundary,
as well as zero and negative values.

Result:

Certificate-list size limits are consistent with BoringSSL's effective
16 KiB minimum, including when processing compressed certificates.

Fixes #17673.

---------

Signed-off-by: Arnab Nandy <[email protected]>
Co-authored-by: Norman Maurer <[email protected]>

---------

Signed-off-by: Arnab Nandy <[email protected]>
Co-authored-by: Arnab Nandy <[email protected]>
lltopk pushed a commit to lltopk/netty that referenced this pull request Oct 24, 2026
@normanmaurer @arnabnandy7 @lltopk
Port 4.1: Apply certificate list size floor (netty#17674) (netty#17861)
fe7f6e5
Motivation:

BoringSSL enforces a 16 KiB minimum certificate-list limit. Passing a
smaller positive MAX_CERTIFICATE_LIST_BYTES value unchanged can cause
compressed certificates to be rejected with UNCOMPRESSED_CERT_TOO_LARGE,
even though the effective lower bound for certificate processing is 16
KiB.

Modification:

- Clamp positive MAX_CERTIFICATE_LIST_BYTES values below 16 KiB to 16
KiB.
- Preserve zero and negative values unchanged.
- Document the effective minimum in OpenSslContextOption.
- Add focused tests covering values below, at, and above the boundary,
as well as zero and negative values.

Result:

Certificate-list size limits are consistent with BoringSSL's effective
16 KiB minimum, including when processing compressed certificates.

Fixes netty#17673.

---------

Signed-off-by: Arnab Nandy <[email protected]>
Co-authored-by: Norman Maurer <[email protected]>

Signed-off-by: Arnab Nandy <[email protected]>
Co-authored-by: Arnab Nandy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@normanmaurer normanmaurer normanmaurer approved these changes
+1 more reviewer
@allthingssecurity allthingssecurity allthingssecurity left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

4.2.20.Final

Development

Successfully merging this pull request may close these issues.

Apply BoringSSL's 16 KiB certificate-list floor to compressed certificates

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@arnabnandy7 @normanmaurer @netty-project-bot @allthingssecurity
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.