Skip to content

[9.5] [ML] Fail gracefully when restoring a categorizer with an out-of-range token ID (#3143) - #3152

Merged
elastic-vault-github-plugin-prod[bot] merged 1 commit into
9.5from
backport/9.5/pr-3143
Aug 13, 2026
Merged

[9.5] [ML] Fail gracefully when restoring a categorizer with an out-of-range token ID (#3143)#3152
elastic-vault-github-plugin-prod[bot] merged 1 commit into
9.5from
backport/9.5/pr-3143

Conversation

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 9.5:

Questions ?

Please refer to the Backport tool documentation

…e token ID (#3143)

An inconsistent or truncated categorizer state document can leave a
restored category referencing a token ID at or beyond the end of the
restored token ID lookup. That ID was later used to index the token ID
lookup unchecked (for example when building a reverse search), which is
an out-of-bounds access that can crash the autodetect process with a
SIGSEGV inside libc rather than failing the restore.

Validate, at the end of CTokenListDataCategorizerBase::acceptRestoreTraverser,
that every token ID referenced by a restored category exists in the
restored token ID lookup, and fail the restore gracefully if not. This is
consistent with the graceful invalid-state handling added in #2895/#2898.

Relates to #2875

Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit 0f41e80)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated approval: clean backport of an already-reviewed change. Auto-merge is armed and will merge once the required CI checks are green.

@elastic-vault-github-plugin-prod
elastic-vault-github-plugin-prod Bot merged commit 1753441 into 9.5 Aug 13, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically merge backport PRs when CI passes backport >bug :ml v9.5.2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants