TechnikEmpire / HttpFilteringEngine

Transparent filtering TLS proxy.
Mozilla Public License 2.0
60 stars 33 forks source link

HttpFilteringEngine::ProcessAbpFormattedRule(...) Doesn't handle selectors correctly #43

Closed TechnikEmpire closed 8 years ago

TechnikEmpire commented 8 years ago

ABP selectors are padded with "##" and "#@" to mark the following selector as an inclusion or exception selector (hide, or whitelist element respectively). However, the padding is not the same for global selectors and domain specific selectors.

Domain specific exception selectors, for example, are padded with "#@#", so a class exception filter for myclass on domain.com would look like:

domain.com#@#.myclass.

HttpFilteringEngine::ProcessAbpFormattedRule(...) does not presently factor this in, and thus winds up incorrectly trimming selectors out of rule strings before passing them off to the GQ library to be parsed fully.

TechnikEmpire commented 8 years ago

Woops, didn't realized I already had #36 open. This was ultimately the problem.