Skip to content

Implement fragment size validation#39

Merged
gafferongames merged 2 commits into
mas-bandwidth:mainfrom
SegersJorn:patch-1
Mar 4, 2026
Merged

Implement fragment size validation#39
gafferongames merged 2 commits into
mas-bandwidth:mainfrom
SegersJorn:patch-1

Conversation

@SegersJorn
Copy link
Copy Markdown
Contributor

A heap-based buffer overflow vulnerability exists here due to insufficient validation of fragment size values. A specially crafted packet with malformed fragment headers can cause negative or oversized fragment_bytes values to be passed to memcpy(), resulting in out-of-bounds memory writes. This vulnerability may allow remote attackers to cause a denial of service or potentially achieve arbitrary code execution.

A heap-based buffer overflow vulnerability exists here due to insufficient validation of fragment size values. A specially crafted packet with malformed fragment headers can cause negative or oversized fragment_bytes values to be passed to memcpy(), resulting in out-of-bounds memory writes. This vulnerability may allow remote attackers to cause a denial of service or potentially achieve arbitrary code execution.

Signed-off-by: Jorn Segers <131166816+SegersJorn@users.noreply.github.com>
Copy link
Copy Markdown
Collaborator

@gafferongames gafferongames left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

Please adjust to match coding standard in the file surrounding it. Also, it shouldn't be an error (according to log policies in reliable) because it's not something the user controls. It should be a debug log (off by default), because it is a handled attack that is out of control of the user writing the software. -- thanks!

Signed-off-by: Jorn Segers <131166816+SegersJorn@users.noreply.github.com>
@gafferongames gafferongames merged commit d560f5e into mas-bandwidth:main Mar 4, 2026
@gafferongames
Copy link
Copy Markdown
Collaborator

Thank you!

@SegersJorn
Copy link
Copy Markdown
Contributor Author

I'm glad to help! For context, I came across this bug by fuzzing with AFL++ for my ongoing masters thesis on fuzzing multiplayer video games.

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.

2 participants