Skip to content

Sorting: fix crash from secret unit GUIDs used as cache keys#143

Open
Krathe82 wants to merge 1 commit into
DanderBot:mainfrom
Krathe82:pr/sort-secret-guid-crash
Open

Sorting: fix crash from secret unit GUIDs used as cache keys#143
Krathe82 wants to merge 1 commit into
DanderBot:mainfrom
Krathe82:pr/sort-secret-guid-crash

Conversation

@Krathe82

@Krathe82 Krathe82 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Problem

UnitGUID can return a secret value in 12.0 (e.g. M+ encounters), and a secret value cannot be used as a Lua table key — using one throws attempted to perform indexed assignment on a table that cannot be indexed with secret keys. Two sort caches keyed by GUID were unguarded:

  • Sort.UnitCache (role cache)
  • SecureSort.inspectQueue

This is the same crash class as the AFK-cache fix in #141, in a different code path.

Fix

  • Sort.UnitCache — fall back to the unit token when the GUID is inaccessible (canaccessvalue(guid) and guid or unit), mirroring the StatusIcons AFK-cache fix. The token is a plain string and stable for the session.
  • SecureSort.inspectQueue — skip queuing/handling units whose GUID is secret. The queue is matched back against the GUID delivered by INSPECT_READY, so a unit-token fallback would never match and would leak entries; skipping is the correct guard there.

UnitGUID can return a secret value in 12.0 (e.g. M+ encounters), and a
secret cannot be used as a Lua table key. Two sort caches keyed by GUID
were unguarded and could throw "cannot be indexed with secret keys":

- Sort.UnitCache (role cache): fall back to the unit token when the GUID
  is inaccessible, mirroring the StatusIcons AFK-cache fix.
- SecureSort.inspectQueue: skip queuing/handling units whose GUID is
  secret. The queue is matched back against the INSPECT_READY GUID, so a
  unit-token fallback would never match and would leak entries.
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.

1 participant