Repository navigation
Validate event stream header lengths and fixed-width values in encoder - #3459
Merged
Merged
Conversation
ashishdhingra
force-pushed
the
eventstream-header-validation
branch
from
October 20, 2026 18:10
3645cd7 to
afdbee9
Compare
Contributor
Author
|
Dry-run triggered: {
"buildId": "5714428c-1b1e-4328-bcf8-8d4374e5305b",
"buildType": "DRY_RUN",
"stage": "PROD",
"overrides": {
"sources": [
{
"sourceId": "aws-sdk-ruby",
"sourceReference": "eventstream-header-validation"
}
]
}
} |
jterapin
approved these changes
Oct 20, 2026
|
|
||
| # Minimum `aws-sdk-core` version for new gem builds | ||
| MINIMUM_CORE_VERSION = "3.258.0" | ||
| MINIMUM_CORE_VERSION = "3.259.0" |
Contributor
There was a problem hiding this comment.
Please recheck the bump after release today.
|
|
||
| describe '#encode header length validation' do | ||
|
|
||
| def message_with_header(key, value) |
There was a problem hiding this comment.
Non-blocking: message_with_header is defined the same way in both new describe blocks here and on L182. Could it move up one level so it's shared?
sankettangade
approved these changes
Oct 20, 2026
Reject header names over 255 encoded bytes and string/bytes values over 32,767 encoded bytes before serialization, instead of truncating the length field into the protocol's 8-bit/16-bit length. Adds regression tests and a changelog entry.
Reject uuid header values that are not exactly 16 bytes, which would otherwise misalign the header block, and range-check byte, short, integer, long and timestamp values against their signed width instead of letting pack silently truncate them. Adds tests and a changelog entry.
Core 3.259.0 was released before this change merged, so the aws-eventstream dependency bump ships in 3.260.0.
ashishdhingra
force-pushed
the
eventstream-header-validation
branch
from
October 20, 2026 23:11
afdbee9 to
eefbaee
Compare
Contributor
Author
|
New dry-run started after changing {
"buildId": "2785026d-e3d3-4d6a-8fa1-25d04d1a7dda",
"buildType": "DRY_RUN",
"stage": "PROD",
"overrides": {
"sources": [
{
"sourceId": "aws-sdk-ruby",
"sourceReference": "eventstream-header-validation"
}
]
}
} |
dscpinheiro
approved these changes
Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Description
The
aws-eventstreamencoder now validates header fields against the event stream protocol limits before serializing a message, and raises an error instead of writing a value that doesn't fit its field.aws-eventstreamEventHeaderNameLengthExceedError.stringandbytesheader values longer than 32,767 encoded bytes raiseEventHeaderValueLengthExceedError.EventHeaderValueWidthError:uuidvalues must be exactly 16 bytes, andbyte,short,integer,long, andtimestampvalues must fit their signed width.aws-sdk-coreaws-eventstream>= 1.4.1.MINIMUM_CORE_VERSIONfor newly built service gems is bumped to3.259.0.Changelog entries are under Unreleased Changes for both gems.
Testing
aws-eventstreamspecs: 46 examples, 0 failures. New cases cover 255/256-byte names; 32,767/32,768/65,536-byte string and bytes values; multibyte values whose character count is within the limit but whose byte length exceeds it; valid and invalid widths for each fixed-width type; and failure atomicity.Generated by AI tools (Claude Code), and reviewed by Ashish Dhingra.