Skip to content

fix: use checked arithmetic in bounds_check! to prevent overflow bypass#1263

Open
ludfjig wants to merge 1 commit intohyperlight-dev:mainfrom
ludfjig:harden_bound_check
Open

fix: use checked arithmetic in bounds_check! to prevent overflow bypass#1263
ludfjig wants to merge 1 commit intohyperlight-dev:mainfrom
ludfjig:harden_bound_check

Conversation

@ludfjig
Copy link
Contributor

@ludfjig ludfjig commented Feb 25, 2026

The bounds check silently wraps on usize overflow in release builds, bypassing the check entirely. Not exploitable today since callers validate offsets before reaching the macro, but any future caller that doesn't could trigger it.

The bounds check silently wraps on usize overflow in release builds,
bypassing the check entirely. Not exploitable today since callers
validate offsets before reaching the macro, but any future caller
that doesn't could trigger it.

Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
@ludfjig ludfjig added kind/bugfix For PRs that fix bugs area/security Involves security-related changes or fixes labels Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/security Involves security-related changes or fixes kind/bugfix For PRs that fix bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants