phanx-wow / PhanxChat

WoW AddOn — Removes chat frame clutter and adds some functionality.
Other
2 stars 3 forks source link

[6.1] Attempt to access forbidden object from code tainted by an AddOn #3

Closed Gethe closed 8 years ago

Gethe commented 9 years ago

I got this error on the PTR when clicking on a twitter screenshot link.

1x ...rface\Blizzard_SocialUI\Blizzard_SocialUI-1.0.lua:119: Attempt to access forbidden object from code tainted by an AddOn
[C]:: in function 'Show'
...rface\Blizzard_SocialUI\Blizzard_SocialUI-1.0.lua:119: in function 'SocialPostFrame_ShowScreenshot'
FrameXML\ItemRef.lua:249: in function <FrameXML\ItemRef.lua:1>
(tail call): ?
...ace\Blizzard_CombatLog\Blizzard_CombatLog.lua:3602: in function 'SetItemRef'
FrameXML\ChatFrame.lua:3374: in function <FrameXML\ChatFrame.lua:3373>
(tail call): ?
[C]:: in function 'ChatFrame_OnHyperlinkShow'
PhanxChat\Modules\LinkURLs.lua:58: in function <PhanxChat\Modules\LinkURLs.lua:52>
[C]:: in function 'ChatFrame_OnHyperlinkShow'
[string "*:OnHyperlinkClick"]:1: in function <[string "*:OnHyperlinkClick"]:1>

Locals:
index = 1

Here is the taint log stack:

2/21 13:39:11.889  Execution tainted by PhanxChat while reading ChatFrame_OnHyperlinkShow - ChatFrame1:OnHyperlinkClick()
2/21 13:39:12.005  Execution tainted by Bugger while reading LibStub - Interface\AddOns\Bugger\Bugger.lua:165 ?()
2/21 13:39:12.005      Interface\AddOns\Bugger\Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:145 method()
2/21 13:39:12.005      safecall Dispatcher[2]:4
2/21 13:39:12.005      xpcall()
2/21 13:39:12.005      safecall Dispatcher[2]:13 ?()
2/21 13:39:12.005      Interface\AddOns\Bugger\Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:90 Fire()
2/21 13:39:12.005      Interface\AddOns\!BugGrabber\BugGrabber.lua:149 triggerEvent()
2/21 13:39:12.005      Interface\AddOns\!BugGrabber\BugGrabber.lua:386
2/21 13:39:12.005      SocialPostFrame:Show()
2/21 13:39:12.005      Interface\AddOns\Blizzard_SocialUI\Blizzard_SocialUI.lua:119 SocialPostFrame_ShowScreenshot()
2/21 13:39:12.005      Interface\FrameXML\ItemRef.lua:249 oldSetItemRef()
2/21 13:39:12.005      Interface\AddOns\Blizzard_CombatLog\Blizzard_CombatLog.lua:3602 SetItemRef()
2/21 13:39:12.005      Interface\FrameXML\ChatFrame.lua:3374
2/21 13:39:12.005      ChatFrame_OnHyperlinkShow()
2/21 13:39:12.005      Interface\AddOns\PhanxChat\Modules\LinkURLs.lua:58 ChatFrame_OnHyperlinkShow()
2/21 13:39:12.005      ChatFrame1:OnHyperlinkClick()
2/21 13:39:13.560  Execution tainted by PhanxChat while reading ChatFrame_OnHyperlinkShow - ChatFrame1:OnHyperlinkClick()
Phanx commented 9 years ago

Well, I make no promises as to when this will get fixed, since I find Twitter absolutely useless and have no intention of ever using it in-game or anywhere else, but I'll at least take a look after 6.1 goes live this week.

berwyn commented 9 years ago

Getting the same error, got this stack:

1x ...rface\Blizzard_SocialUI\Blizzard_SocialUI-1.0.lua:114: Attempt to access forbidden object from code tainted by an AddOn
[C]:: in function 'Show'
...rface\Blizzard_SocialUI\Blizzard_SocialUI-1.0.lua:114: in function 'SocialPostFrame_ShowItem'
FrameXML\ItemRef.lua:259: in function <FrameXML\ItemRef.lua:1>
(tail call): ?
...ace\Blizzard_CombatLog\Blizzard_CombatLog.lua:3602: in function 'SetItemRef'
FrameXML\ChatFrame.lua:3374: in function <FrameXML\ChatFrame.lua:3373>
(tail call): ?
[C]:: in function 'ChatFrame_OnHyperlinkShow'
PhanxChat\Modules\LinkURLs.lua:58: in function 'ChatFrame_OnHyperlinkShow'
[string "*:OnHyperlinkClick"]:1: in function <[string "*:OnHyperlinkClick"]:1>
[C]:: ?

Locals:
itemID = "35573"
creationContext = "dungeon-normal"
earned = true

Would love to use this functionality if you wouldn't mind fixing it :)

Phanx commented 9 years ago

It'll be fixed eventually. More comments will not affect how quickly it gets fixed, so unless you can provide a patch, there's no need to keep posting "me too" comments.

berwyn commented 9 years ago

I figured as much, but the goal was more to provide (what might be) additional info for persons who wanted to take a stab at fixing it :)

ldaptv commented 9 years ago

Prat had the same issue... here is their solution. Not Apples to Apples to PhanxChat, but might point to a work around. Rather use PhanxChat since it is lightweight.

Updated 2015-02-28: Solution works

I had the same issue in my own addon(s) dealing with custom weblinks (LinksInChat + IfThen).

However; i think i found a solution that works based on a DBM crash i saw. DBM handles this by pre-hooking the ItemRefTooltip:SetHyperlink() function and basically making it ignore their own "DBM:" type hyperlinks. Source: (DBM-Core.lua:2031)

In my own workaround i did this:

Pre-hook ItemRefTooltip:SetHyperlink(). Make it return nil if the hyperlink type matches what i use in my addon. Use a hooksecurefunc("ChatFrame_OnHyperlinkShow"... This way the path from ChatFrame_OnHyperlinkClick to the Blizzard_SocialUI is not tainted.