Skip to content

Fix offset maths bug in InetAddress parsing#139420

Merged
elasticsearchmachine merged 2 commits intoelastic:mainfrom
romseygeek:bug/ip-array-index-oob-exception
Dec 12, 2025
Merged

Fix offset maths bug in InetAddress parsing#139420
elasticsearchmachine merged 2 commits intoelastic:mainfrom
romseygeek:bug/ip-array-index-oob-exception

Conversation

@romseygeek
Copy link
Contributor

InetAddress parsing can look at arbitrary sections of a byte array
indexed by offset and length. We adjust the length to remove scope
IDs, but were not taking into account the offset, so parsing operations
that examined the end of a byte array could inadvertently try and read
past the end.

InetAddress parsing can look at arbitrary sections of a byte
array indexed by offset and length.  We adjust the length to
remove scope IDs, but were not taking into account the offset,
so parsing operations that examined the end of a byte array
could inadvertently try and read past the end.
@romseygeek romseygeek self-assigned this Dec 12, 2025
@romseygeek romseygeek requested a review from a team as a code owner December 12, 2025 09:47
@romseygeek romseygeek added >bug :StorageEngine/Mapping The storage related side of mappings v9.3.0 v9.2.4 labels Dec 12, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

@elasticsearchmachine
Copy link
Collaborator

Hi @romseygeek, I've created a changelog YAML for you.

@romseygeek romseygeek added auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) auto-backport Automatically create backport pull requests when merged labels Dec 12, 2025
@elasticsearchmachine elasticsearchmachine merged commit 348e1e8 into elastic:main Dec 12, 2025
34 checks passed
@romseygeek romseygeek deleted the bug/ip-array-index-oob-exception branch December 12, 2025 10:58
romseygeek added a commit to romseygeek/elasticsearch that referenced this pull request Dec 12, 2025
InetAddress parsing can look at arbitrary sections of a byte array 
indexed by offset and length.  We adjust the length to remove scope 
IDs, but were not taking into account the offset, so parsing operations 
that examined the end of a byte array could inadvertently try and read 
past the end.
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
9.2
elasticsearchmachine pushed a commit that referenced this pull request Dec 12, 2025
InetAddress parsing can look at arbitrary sections of a byte array 
indexed by offset and length.  We adjust the length to remove scope 
IDs, but were not taking into account the offset, so parsing operations 
that examined the end of a byte array could inadvertently try and read 
past the end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) >bug :StorageEngine/Mapping The storage related side of mappings Team:StorageEngine v9.2.4 v9.3.0

4 participants