Skip to content

HTTPS Everywhere uses regular expressions which are not supported by re2 #23861

Open

Description

The HTTPS Everywhere ruleset appears to contain regular expressions that our parser (re2) doesn't support.

For example, these rules:

        {
          "from": "^http://advertisingcentral\\.yahoo\\.com/+(?=$|\\?)",
          "to": "https://advertising.yahoo.com/"
        },
        {
          "from": "^http://fantasysports\\.yahoo\\.com/(?=$|\\?)",
          "to": "https://sports.yahoo.com/fantasy"
        },

Steps to Reproduce

  1. Start Brave from a terminal.
  2. Type yahoo.ca in the URL and press Enter.

Actual result:

The following error messages are printed to the terminal:

../../third_party/re2/src/re2/re2.cc:205: Error parsing '^http://advertisingcentral\.yahoo\.com/+(?=$|\?)': invalid perl operator: (?=
../../third_party/re2/src/re2/re2.cc:205: Error parsing '^http://fantasysports\.yahoo\.com/(?=$|\?)': invalid perl operator: (?=

Expected result:

The rules should either be supported or ignored. We should not try to run the ones we don't support.

This could be fixed in code, or we could clean up the ruleset.

Reproduces how often:

100% reproducible.

Desktop Brave version:

Brave | 1.42.45 Chromium: 103.0.5060.70 (Developer Build) (64-bit)
Revision | 1543faf9f70e61c6f6e9c01ff20a2e3cf2ad55dc-refs/branch-heads/5060_53@{#4}
OS | Linux

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    OS/AndroidFixes related to Android browser functionalityOS/Desktopfeature/https-everywhereIssues related to the HTTPS Everywhere component of Shields

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions