Skip to content

Fix to send record_overflow alert#10795

Open
embhorn wants to merge 2 commits into
wolfSSL:masterfrom
embhorn:gh10791
Open

Fix to send record_overflow alert#10795
embhorn wants to merge 2 commits into
wolfSSL:masterfrom
embhorn:gh10791

Conversation

@embhorn

@embhorn embhorn commented Jun 26, 2026

Copy link
Copy Markdown
Member

Description

Removed the #ifdef HAVE_MAX_FRAGMENT guard so the alert is always sent, matching the unconditional record_overflow and the VERSION_ERROR alert directly above. Also corrected a pre-existing flush-left default: indentation in that block.

Fixes #10791

Testing

New test_tls_record_overflow_alert with three sub-cases that all exercise the fixed line:

  1. TLS 1.2 server, pre-handshake — injects a 5-byte oversized record header, asserts the exact cleartext record_overflow alert bytes on the wire.
  2. TLS 1.3 server, pre-handshake — same, cleartext byte-exact.
  3. TLS 1.3 client, post-handshake — the reported scenario; the encrypted alert is decoded by letting the server read it and checking wolfSSL_get_alert_history returns record_overflow / alert_fatal.

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@embhorn embhorn self-assigned this Jun 26, 2026
Copilot AI review requested due to automatic review settings June 26, 2026 16:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a TLS protocol compliance issue where wolfSSL could terminate on an oversized TLS record without sending the required record_overflow alert, and adds API tests to validate the alert is emitted in both TLS 1.2 and TLS 1.3 scenarios (including post-handshake TLS 1.3 client behavior).

Changes:

  • Always send a fatal record_overflow alert when GetRecordHeader() returns LENGTH_ERROR (removes the HAVE_MAX_FRAGMENT guard).
  • Add test_tls_record_overflow_alert to validate on-the-wire cleartext alerts pre-handshake and alert history for encrypted alerts post-handshake.
  • Register the new test in the API test list.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tests/api/test_tls.h Adds prototype/registration for the new TLS record overflow alert test.
tests/api/test_tls.c Adds test_tls_record_overflow_alert with TLS 1.2 + TLS 1.3 pre-handshake cleartext checks and TLS 1.3 post-handshake encrypted alert verification.
src/internal.c Ensures record_overflow alert is sent on LENGTH_ERROR from record header parsing in all builds.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/api/test_tls.c
Comment thread src/internal.c Outdated

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #10795

Scan targets checked: wolfcrypt-rs-bugs, wolfssl-bugs, wolfssl-src

No new issues found in the changed files. ✅

@embhorn embhorn marked this pull request as ready for review June 26, 2026 18:41
@github-actions

Copy link
Copy Markdown

retest this please

@github-actions

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: RFC 8446 violation: WolfSSL TLS 1.3 client does not send record_overflow on receipt of an oversized record

3 participants