Stanzilla / WoWUIBugs

World of Warcraft UI Bug Tracker
166 stars 7 forks source link

LFG advertisement reports can be blocked by taint #237

Open Meorawr opened 2 years ago

Meorawr commented 2 years ago

With a recent mainline build (9.2.5.44127) it's possible for taint on the LFG frame can prevent the submission of reports for advertisements in the group listing. This may also prevent normal reports once tainted, however this hasn't yet been tested.

This affects a large number of LFG related addons. The taint they're causing may be related to workarounds implemented due to C_LFGList.GetPlaystyleString() being a hardware-protected function (#195). In the case of the addon used in the steps below, the taint is caused by it just sorting the search results via table.sort.


To reproduce the issue, perform the following steps:

  1. Install Premade Sort.
  2. Open the group finder, search for a group, and report it for advertising.
  3. Receive "addon action blocked" error. Oops.

The specific issue occurs in LFGFrame_ReportAdvertisement() where two calls are made to set the minor category flags and the major type of the report. The assignments made by these calls taint fields on the ReportFrame.

When execution trips through the ReportFrame:InitiateReport() function the auto-submit flag takes us to ReportFrame:SendReport() which reads the tainted major type and minor category flags fields prior to calling C_ReportSystem.SendReport(), which will fail with an addon action blocked error.


For now, addons can work around this issue by replacing the original report function to not set the problematic fields - this obviously isn't ideal as the reports then cannot be automatically submitted, however it does at least keep the system usable.

function LFGList_ReportAdvertisement(searchResultID, leaderName)
    local reportInfo = ReportInfo:CreateReportInfoFromType(Enum.ReportType.GroupFinderPosting);
    reportInfo:SetGroupFinderSearchResultID(searchResultID);

    local sendReportWithoutDialog = false; 
    ReportFrame:InitiateReport(reportInfo, leaderName, nil, nil, sendReportWithoutDialog); 
end
Numynum commented 2 months ago

as mentioned in #595 , the new TWW menu can also taint advertisements now, simply with /run Menu.ModifyMenu('MENU_LFG_FRAME_SEARCH_ENTRY', function(owner, rootDescription) rootDescription:CreateTitle('foo') end)