Skip to content

security: reject ACE with AceSize below minimum header size#24

Open
Jah-yee wants to merge 1 commit intomandiant:mainfrom
Jah-yee:fix-ace-parsepanic
Open

security: reject ACE with AceSize below minimum header size#24
Jah-yee wants to merge 1 commit intomandiant:mainfrom
Jah-yee:fix-ace-parsepanic

Conversation

@Jah-yee
Copy link
Copy Markdown

@Jah-yee Jah-yee commented May 5, 2026

When AceSize is less than 8, the fixed 4-byte header plus 4-byte Mask are not contained in the ACE. The existing check passes (len(data) may be >= 8) but later slices like and panic with 'slice bounds out of range'.

This adds a simple bounds check: if , return an error immediately after reading the AceSize field.

Fixes #23

When AceSize is less than 8, the fixed 4-byte header plus 4-byte Mask
are not contained in the ACE.  The existing len(data) < aceSize check
passes (len(data) may be >= 8) but later slices like data[4:8] and
data[offset:aceSize] panic with 'slice bounds out of range'.

Fixes mandiant#23.
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.

pkg/security: ParseACE panics on attacker-controlled AceSize field (slice bounds out of range)

1 participant