LiteBag

271k Downloads

Action blocked when right-clicking item in bags / UseContainerItem

arcadepro opened this issue · 19 comments

commented
[string "@!BugGrabber/BugGrabber.lua"]:480: in function <!BugGrabber/BugGrabber.lua:480>
[string "=[C]"]: ?
[string "=[C]"]: in function `UseContainerItem'
[string "@FrameXML/ContainerFrame.lua"]:1409: in function `ContainerFrameItemButton_OnClick'
[string "@FrameXML/ContainerFrame.lua"]:1461: in function <FrameXML/ContainerFrame.lua:1448>

Used right click to open said item. Error triggered. Got the usual addon blocked pop up window. Worked fine after a reload ui.

commented

Did you get the printed message about SetBagID when that happened (assuming you were running 10.0.7)?

Something in an insecure path must be modifying part of the button in a way that UseContainerItem is not happy with, but there's no way to figure out what (/console taintlog 11 which would expose it is only in beta and ptr builds). As far as I can see bagID is the only candidate.

I still haven't had it happen to me again (only once since release day). I don't know how to get closer to an answer. :(

commented

For my own reference, this is the failing line (ContainerFrame.lua:1409)

C_Container.UseContainerItem(self:GetBagID(), self:GetID(), nil, BankFrame:IsShown() and (BankFrame.selectedTab == 2));

  • self:GetBagID() is known to cause taint issues if .bagID has been set
  • self:GetID() is using the frame GetID call and isn't tainted
  • nil is not tainted
  • last arg is a local boolean which I don't think inherits taint from anything

Very hard to see anything that isn't GetBagID()

commented

I don't know what exactly I did. I joined and left some groups maybe mid combat.

12/7 02:22:51.860  Global variable ToggleAllBags tainted by LiteBag - Interface/AddOns/LiteBag/Core.lua:147 ReplaceGlobals()
12/7 02:22:51.860      Interface/AddOns/LiteBag/Core.lua:199 LiteBagManager:ReplaceBlizzard()
12/7 02:22:51.860      Interface/AddOns/LiteBag/Core.lua:239
12/7 02:22:51.860  Execution tainted by LiteBag while reading ToggleAllBags - OPENALLBAGS:1
12/7 02:22:51.860  An action was blocked because of taint from LiteBag - 
12/7 02:22:51.860      UseContainerItem()
12/7 02:22:51.860      Interface/FrameXML/ContainerFrame.lua:1409 ContainerFrameItemButton_OnClick()
12/7 02:22:51.860      Interface/FrameXML/ContainerFrame.lua:1461
commented

Nope that was all there was. Quite odd. The on screen Blizzard warning popup mentioned LiteBag but nothing in the BugSack window. Possibly some kind of taint from elsewhere.

commented

Were there more errors than that? That doesn't seem to say anything useful. Or anything that mentions LiteBag.

commented

There is definitely taint, I just can't figure out where it's coming from.

commented

There is a related Blizzard bug, Stanzilla/WoWUIBugs#310

I'm completely replacing OpenAllBags so it's not that, but the second commment that says:

Slightly related: by using your own ItemButton frames and building your own bag, you can workaround this taint, unless you call SetBagID() on the ItemButton, at which point the taint applies. This means this taint, if intentional, is not comprehensive and can be worked around trivially.

could be related, if there's some weird rare case where re-using the Blizzard code is calling SetBagID on something in LiteBag. I can't see where though, so it could be totally unrelated.

commented

When that happened, were all the bag slots "broken" in the same way, or just one?

commented

I cant tell for sure but i think all slots were. I couldnt move items around.

commented

I started getting this error recently, looks similar

1x [ADDON_ACTION_BLOCKED] AddOn 'LiteBag' tried to call the protected function 'PickupContainerItem()'.
[string "@!BugGrabber/BugGrabber.lua"]:480: in function <!BugGrabber/BugGrabber.lua:480>
[string "=[C]"]: in function `PickupContainerItem'
[string "@FrameXML/ContainerFrame.lua"]:1341: in function <FrameXML/ContainerFrame.lua:1318>
[string "=[C]"]: in function `ContainerFrameItemButton_OnClick'
[string "@FrameXML/ContainerFrame.lua"]:1461: in function `OnClick'
[string "@FrameXML/ContainerFrame.lua"]:1577: in function `OnDragStart'
[string "@FrameXML/ContainerFrame.lua"]:1581: in function <FrameXML/ContainerFrame.lua:1580>
commented

Same problem for sure, but I have no idea what's causing taint. It's not something in the normal LiteBag code, and may not even be LiteBag.

I've been playing pretty solidly since xpac release and haven't had it happen to me (although it did happen once in the pre-patch time).

If you find a way to reproduce it, that would be awesome.

commented

Sadly i do not. It happens randomly. Playing with Bartender and thats causing taint sometimes, maybe its spreading until it hit this function?

commented

I wish I knew. I honestly thought it would happen to me again and I'd be able to look at the taintlog, but it hasn't.

commented

Im currently tracking ingame taint logs as well, this is the log from there

12/3 21:12:49.099  Execution tainted by LiteBag while reading INTERFACE_ACTION_BLOCKED_SHOWN - Interface/FrameXML/UIParent.lua:5234 DisplayInterfaceActionBlockedMessage()
12/3 21:12:49.099      Interface/FrameXML/UIParent.lua:1831
12/3 21:12:49.099      PickupContainerItem()
12/3 21:12:49.099      Interface/FrameXML/ContainerFrame.lua:1341
12/3 21:12:49.099      ContainerFrameItemButton_OnClick()
12/3 21:12:49.099      Interface/FrameXML/ContainerFrame.lua:1461 LiteBagBackpackPanelBag4Item19:OnClick()
12/3 21:12:49.099      Interface/FrameXML/ContainerFrame.lua:1577 LiteBagBackpackPanelBag4Item19:OnDragStart()
12/3 21:12:49.099      Interface/FrameXML/ContainerFrame.lua:1581
12/3 21:12:49.099  An action was blocked in combat because of taint from LiteBag - PickupContainerItem()
12/3 21:12:49.099      Interface/FrameXML/ContainerFrame.lua:1341
12/3 21:12:49.099      ContainerFrameItemButton_OnClick()
12/3 21:12:49.099      Interface/FrameXML/ContainerFrame.lua:1461 LiteBagBackpackPanelBag4Item19:OnClick()
12/3 21:12:49.099      Interface/FrameXML/ContainerFrame.lua:1577 LiteBagBackpackPanelBag4Item19:OnDragStart()
12/3 21:12:49.099      Interface/FrameXML/ContainerFrame.lua:1581
commented

Yeah unfortunately that's not the relevant part. Clearly the button itself has been tainted at some point earlier and is no longer considered a SecureActionButton, hence why the action fails. The click handler is from the Blizzard ContainerFrameItemButtonTemplate code - I can't touch it or the click actions stop working, because UseContainerItem() and other such functions can't be called from addon code.

commented

I've added an override for SetBagID() in 10.0.7, if it ever prints the warning message please let me know what you were doing to cause it!

commented

Did you get the printed message about SetBagID when that happened (assuming you were running 10.0.7)?

No message about SetBagID, I was already on 10.0.7.

commented

I think there might be taint from CloseAllBags returning a value. Later when I don't have COVID I should check it.

commented

I'm fairly sure this (particular) taint is fixed now as of de0b50e. Closing.