Fix for PSIRT PTK0008456 - #468
Closed
keerthimuvva52 wants to merge 1 commit into
Closed
Conversation
keerthimuvva52
force-pushed
the
PSIRT_8456
branch
from
July 16, 2026 05:48
cd404cf to
362004d
Compare
keerthimuvva52
requested review from
DetiPrudvi08,
alexanderintc,
Copilot,
nirint and
shubhangi-shrivastava
July 16, 2026 05:48
There was a problem hiding this comment.
Pull request overview
This PR introduces additional deserialization-time validation for Rose/LimEx bytecode to mitigate a reported PSIRT issue (PTK0008456) by preventing out-of-bounds access during scan-time execution.
Changes:
- Added
db_validate_limex_reach_map()to validate LimExreachMap[]/reachSizemetadata. - Integrated the new LimEx reachMap validation into
db_validate_rose_offsets().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+318
to
+337
| const char *limex_base = (const char *)getImplNfa(nfa); | ||
| u32 limex_len = nfa->length - (u32)sizeof(struct NFA); | ||
|
|
||
| /* Ensure we can read reachMap[256] and reachSize. */ | ||
| const u32 reach_prefix_end = | ||
| (u32)(N_CHARS + sizeof(u32)); /* reachMap + reachSize */ | ||
| if (unlikely(limex_len < reach_prefix_end)) { | ||
| DEBUG_PRINTF("LimEx[%u] too small for reachMap\n", qi); | ||
| return HS_INVALID; | ||
| } | ||
|
|
||
| const struct LimExNFA32 *limex = | ||
| (const struct LimExNFA32 *)limex_base; | ||
| const u32 reachSize = limex->reachSize; | ||
|
|
||
| if (unlikely(reachSize == 0)) { | ||
| DEBUG_PRINTF("LimEx[%u] reachSize is zero\n", qi); | ||
| return HS_INVALID; | ||
| } | ||
|
|
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.
No description provided.