Skip to content

Fix secret-string taint error on aura sourceUnit compare#39

Open
hausec wants to merge 1 commit into
TULOA:mainfrom
hausec:fix-sourceunit-secret-taint
Open

Fix secret-string taint error on aura sourceUnit compare#39
hausec wants to merge 1 commit into
TULOA:mainfrom
hausec:fix-sourceunit-secret-taint

Conversation

@hausec

@hausec hausec commented Apr 17, 2026

Copy link
Copy Markdown

Summary

Fixes a runtime Lua error on Retail (Midnight secure-aura API) when a non-player aura passes through the blizzard-cooldowns path in AuraButtonOnShow:

attempt to compare local 'sourceUnit' (a secret string value tainted by 'TPerl_PlayerBuffs')

auraData.sourceUnit from C_UnitAuras.GetAuraDataByIndex is sometimes returned as a "secret" (tainted) string that throws when compared directly with ==. The error can fire hundreds of times per second while any such aura is visible.

Change

In TPerl/TPerl.lua AuraButtonOnShow:

  • Also capture isFromPlayerOrPlayerPet from auraData (the boolean replacement for the == "player" heuristic).
  • Compute isPlayerSource safely: prefer isFromPlayerOrPlayerPet when accessible; fall back to the old sourceUnit == "player" compare only after TPerl_CanAccess(sourceUnit) confirms the value isn't secret; default to false otherwise.
  • Pass the resulting boolean to TPerl_CooldownFrame_SetTimer in place of the raw compare.

Net diff is 12 additions / 2 deletions, all inside one function. The classic UnitAura path is untouched.

Test plan

  • Retail: reload with a non-player HoT/buff active on the player frame (e.g. a priest PW:S from a raid healer) — error no longer fires.
  • Retail: player-cast buffs still get the cooldown swipe + countdown text (i.e. isPlayerSource still resolves to true via isFromPlayerOrPlayerPet).
  • Classic: path is unchanged; UnitAura returns a plain string for sourceUnit and takes the old comparison branch.

In Midnight/Retail, auraData.sourceUnit can be returned as a "secret"
(tainted) string. Comparing it with == directly throws:

  attempt to compare local 'sourceUnit' (a secret string value tainted...)

The error fires from the blizzard-cooldowns path inside AuraButtonOnShow
when an aura from a non-player source shows up on the player buff frame.

Fix: prefer the boolean isFromPlayerOrPlayerPet field from auraData, and
fall back to the existing sourceUnit compare only after TPerl_CanAccess
confirms the value is not secret. Existing Classic/UnitAura path is
unaffected.
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