Opened on 11/13/2014 at 12:43:48 PM

Last modified on 12/21/2017 at 11:28:41 AM

#1564 new change

Fix FilterEngine::Matches for allowing request which is whitelisted in the ascendant node

Reported by: sergz Assignee: sergz
Priority: Unknown Milestone:
Module: Libadblockplus Keywords:
Cc: fhd, oleksandr Blocked By: #1585
Blocking: Platform: Unknown
Ready: no Confidential: no
Tester: Verified working: no
Review URL(s):

Description

Background

Let's say we have page A which loads resource B which loads resource C, thus A->B->C and the filter @@||C$SOME_TYPE,domain=A, where SOME_TYPE is not document. When we load resource C, the referer is B. We should not block C if the type of request for C is SOME_TYPE.

Let's consider the real example, in the method FilterEngine::Matches(url, contentType, documentUrls) the parameters are

url = http://news.bbcimg.co.uk/shared/swf/bbccom/0.3.289/bbcdotcom/SmpAds.swf
contentType = OBJECT_SUBREQUEST
documentUrls[0] = http://www.bbc.com/news/world-europe-29105979
documentUrls[1] = http://emp.bbci.co.uk/emp/SMPf/1.9.45/StandardMediaPlayerChromelessFlash.swf

and filters

/SmpAds.
@@||bbcimg.co.uk^*/SmpAds.swf$object-subrequest,domain=bbc.com

BTW, in FF it's not blocked.

What to change

Take a look at FilterEngine::Matches. We need to check whether there is some whitelisting entry for <url, contentType> and any page in the referer chain, thus CheckFilterMatch(url, contentType, documentUrls[i]); and we need to check the whitelisting entry for all CheckFilterMatch(documentUrls[i], "DOCUMENT", documentUrls[j]); where i <= j. It's not strong, i < j, because we also can whitelist the everything from the root page, for example @@||example.org^$document, because document — the page itself.

Attachments (0)

Change History (5)

comment:1 Changed on 11/13/2014 at 01:09:21 PM by sergz

  • Blocking 1565 added

comment:2 Changed on 11/13/2014 at 02:27:39 PM by trev

The problem here isn't the matching - that one works correctly, both in Firefox and libadblockplus. It's rather that StandardMediaPlayerChromelessFlash.swf isn't a document - it's merely a Flash object inside a document. So the document URL for SmpAds.swf should still be world-europe-29105979. In other words, libadblockplus wants to get a frame structure - what it gets are referrers however, not quite the same thing...

comment:3 Changed on 11/19/2014 at 04:39:42 PM by sergz

  • Blocked By 1585 added

comment:4 Changed on 03/16/2015 at 12:31:49 PM by oleksandr

  • Blocking 1565 removed

comment:5 Changed on 12/21/2017 at 11:28:41 AM by fhd

  • Cc trev removed

Add Comment

Modify Ticket

Change Properties
Action
as new .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from sergz.
Next status will be 'reviewing'.
 
Note: See TracTickets for help on using tickets.