Google Optimize

ID: bhdplaindhdkiflmbfbciehdccfhegci

Could be malicious

Supported Languages

๐Ÿ‡ง๐Ÿ‡ฌBulgarian
๐Ÿ‡ช๐Ÿ‡ธCatalan
๐Ÿ‡ญ๐Ÿ‡ทCroatian
๐Ÿ‡จ๐Ÿ‡ฟCzech
๐Ÿ‡ฉ๐Ÿ‡ฐDanish
๐Ÿ‡ณ๐Ÿ‡ฑDutch
๐Ÿ‡บ๐Ÿ‡ธEnglish
๐Ÿ‡ต๐Ÿ‡ญFilipino
๐Ÿ‡ซ๐Ÿ‡ฎFinnish
๐Ÿ‡ซ๐Ÿ‡ทFrench
๐Ÿ‡ฉ๐Ÿ‡ชGerman
๐Ÿ‡ฌ๐Ÿ‡ทGreek
๐Ÿ‡ฎ๐Ÿ‡ณHindi
๐Ÿ‡ญ๐Ÿ‡บHungarian
๐Ÿ‡ฎ๐Ÿ‡ฉIndonesian
๐Ÿ‡ฎ๐Ÿ‡นItalian
๐Ÿ‡ฏ๐Ÿ‡ตJapanese
๐Ÿ‡ฐ๐Ÿ‡ทKorean
๐Ÿ‡ฑ๐Ÿ‡ปLatvian
๐Ÿ‡ฑ๐Ÿ‡นLithuanian
๐Ÿ‡ณ๐Ÿ‡ดNorwegian
๐Ÿ‡ต๐Ÿ‡ฑPolish
๐Ÿ‡ท๐Ÿ‡ดRomanian
๐Ÿ‡ท๐Ÿ‡บRussian
๐Ÿ‡ท๐Ÿ‡ธSerbian
๐Ÿ‡ธ๐Ÿ‡ฐSlovak
๐Ÿ‡ธ๐Ÿ‡ฎSlovenian
๐Ÿ‡ช๐Ÿ‡ธSpanish
๐Ÿ‡ธ๐Ÿ‡ชSwedish
๐Ÿ‡น๐Ÿ‡ญThai
๐Ÿ‡น๐Ÿ‡ทTurkish
๐Ÿ‡บ๐Ÿ‡ฆUkrainian
๐Ÿ‡ป๐Ÿ‡ณVietnamese

Extension Info & Metadata

Status
Removed
Version
0.44.2
Size
0.13 MB
Rating
4.3/5
Reviews
68
Users
537,465
Type
Extension
Updated
Jan 27, 2022
Category
11_web-development
Price
Free
Featured
No
Visibility
Unlisted
Mature
No
By Google
No
Trusted
No

Publisher Contextual Analysis

Author
https://optimize.google.comView Profile
MX records exist
Yes
Domain exists
Yes
Is disposable
No
Is role-based
No
Mailbox exists
Yes
Total Extensions
1
Active
0
Obsolete
1
Listed
0
Unlisted
1
Total Users
537,465

Facilitates editing content with Google Optimize.

The Optimize extension helps you test and personalize your site with Google Optimize. Create better site experiences with Optimize. Once the extension is downloaded, use our visual editor to change just about anything on your site โ€“ text, images, layouts and more โ€“ and then preview how these new experiences will look on various devices before launching your site experiment. Learn more about Optimize at g.co/optimize. By installing this item, you agree to use it in accordance with your applicable Optimize terms, if any. Otherwise, you agree to the Google Terms of Service and Privacy Policy at https://policies.google.com/privacy

Item
Type
Severity
Description
debugger
Permission
Critical
This permission grants the extension ability to debug and control other extensions and browser tabs. Rated Critical because it can access and modify other extensions' internal state, inject code, and access sensitive data from any tab.
webRequest
Permission
Critical
This permission enables the extension to monitor and analyze all web requests made by the browser. Rated Critical because it can observe all network traffic including sensitive data, track browsing behavior, and gather authentication tokens.
webRequestBlocking
Permission
Critical
This permission allows the extension to intercept, modify, or block any web request in real-time before it reaches its destination. Rated Critical because it can modify sensitive data (like passwords, credit cards) before encryption, redirect traffic to malicious sites, or block security updates.
Dangerous Permission Combination
Risk Factor
Critical
This extension can intercept, modify, and block web requests in real-time.
Contextual Risk Factors
Risk Factor
High
The following context increases the overall risk:โ€ข 10% increase: Early script execution enables pre-emptive content manipulationโ€ข 15% increase: Older manifest version lacks modern security controls
storage
Permission
Medium
This permission allows storing data locally in the browser. Rated Medium because it can persist sensitive user data, track user activities over time, and potentially store malicious payloads.
tabs
Permission
Medium
This permission enables tab management and monitoring. Rated Medium because it can track open tabs, access tab metadata, and monitor user browsing patterns.
Early Content Script Execution
Risk Factor
Medium
This extension runs content scripts at document_start.
Older Manifest Version
Risk Factor
Medium
This extension uses Manifest Version 2
http://*/
Permission
Unknown
No classification available for this permission.
https://*/
Permission
Unknown
No classification available for this permission.

When a token is present, the content script constructs a remote script URL by concatenating a `host` value (retrieved from chrome.storage, originally supplied via an external message from optimize.google.com) with `/optimize/inject/inject.js`, then injects a `<script>` element pointing to that URL into the current page's `<head>`. This gives the remote server the ability to execute arbitrary JavaScript in the context of any page the user visits while the editor is active. Although constrained to the Google Optimize editing session, the host value is controlled by an external party and the injected script runs with full page access.

content.js (Line 38)
var h = e + "optimize/inject/inject.js",  l = Sa(b.authUser),  q = Ta(b.language);db(function() {  var m = g || "",    n = Za(),    p = ha();  p && n.setAttribute("nonce", p);  a.R(n, ab, {    N: h,    U: "goptedit",    token: c,    authUser: l,    language: q,    deviceType: m,    L: {      da: a.getMessage("internal_error"),      aa: a.getMessage("failed_to_load"),      Y: a.getMessage("check_network")    },    nonce: p  });  document.head ? document.head.appendChild(n) : document.insertBefore(n, document.body)})

The `ab` Soy template generates an IIFE string (injected as a `<script>` tag into the target page) that dynamically creates another script element whose `src` is the remote inject URL with auth token and user credentials appended as query parameters. The auth token and authUser values flow from chrome.storage directly into the injected page's DOM, potentially exposing session credentials to the page's JavaScript environment and any XSS vulnerability present on the host page.

content.js (Line 36)
var ab = function(a) {    // ...    return V("\n    (function() {\n  var injectSrc = '" + W(b) + "?" + W(c) + "=" + W(f) +      ("" + "" == e ? "" : "&authuser=" + W(e)) + ("" + "" == d ? "" : "&devicetype=" + W(d)) +      ("" + "" == k ? "" : "&hl=" + W(k)) + "'; var nonce = '" + W(a) + "';\n      " +      "if(window['_google_opt_edit']) {\n        return;\n      }\n" +      "window['_google_opt_edit'] = {};\n" +      "var injectScript = document.createElement('script');\n" +      "injectScript.type = 'text/javascript';\n" +      "injectScript.src = injectSrc;\n" +      "if (nonce) {\n        injectScript.setAttribute('nonce', nonce);\n      }\n" +      "if (document.head) {\n        document.head.appendChild(injectScript);\n" +      "} else {\n        document.insertBefore(injectScript, document.body);\n      }...")

The extension uses the `chrome.debugger` API to attach to arbitrary browser tabs and send Chrome DevTools Protocol commands including `Network.enable` (full network traffic visibility), `Network.setUserAgentOverride` (spoofs the browser's network-level User-Agent), and `Page.setDeviceMetricsOverride` (alters viewport geometry). CDP attachment grants near-complete control of the tab including the ability to intercept responses and read network traffic, far beyond what is strictly needed for device preview.

background.js (Line 20)
var qa = function(a, b, c) {  if (a.runtime.lastError)    alert(a.i18n.getMessage("emulation_failure", [a.runtime.lastError.message]));  else {    var d = {        tabId: b      },      e = C[c];    a.I.attach(d, "1.1", function() {      a.I.sendCommand(d, "Network.enable");      a.I.sendCommand(d, "Page.enable");      a.I.sendCommand(d, "Page.setTouchEmulationEnabled", {        enabled: !0      });      a.I.sendCommand(d, "Page.setDeviceMetricsOverride", {        width: e.A,        height: e.u,        deviceScaleFactor: e.v,        mobile: !0,        fitWindow: !0      });      a.I.sendCommand(d, "Network.setUserAgentOverride", {        userAgent: e.o      });      a.I.sendCommand(d, "Page.reload", {})    })  }};

A blocking `onBeforeSendHeaders` listener is registered against `<all_urls>` for the active tab. It intercepts every outgoing HTTP/HTTPS request and rewrites the `User-Agent` header before the request is sent. Running in blocking mode on all URLs means the extension acts as a full request-level man-in-the-middle for the tab, and any future change to the listener callback could trivially add header injection or request cancellation.

background.js (Line 21)
var ua = function(a, b, c) {    ra(a);    c && (a.g = sa(c),      a.g && a.webRequest.onBeforeSendHeaders.addListener(        a.g, {          urls: ["<all_urls>"],          tabId: b        },        ["blocking", "requestHeaders"]      ))  },  ra = function(a) {    a.g && a.webRequest.onBeforeSendHeaders.removeListener(a.g);    a.g = null  };function sa(a) {  a = C[a];  if (!a) return null;  var b = a.o;  return b ? function(c) {    if (c.requestHeaders) {      for (var d = 0; d < c.requestHeaders.length; ++d) {        var e = c.requestHeaders[d];        if ("user-agent" === e.name.toLowerCase()) {          e.value = b;          break        }      }      return {        requestHeaders: c.requestHeaders      }    }  } : null}

A blocking `onBeforeRequest` listener intercepts all script loads matching `optimize.js` or `gtm/js` URLs and redirects them by appending authentication and experiment parameters (`gtm_auth`, `gtm_preview`, `gtm_experiment`, `gtm_debug`). This silently modifies how Google Tag Manager and Optimize scripts are loaded, injecting auth credentials into third-party script requests without the page's knowledge. The redirect is opaque to the page and could be leveraged to point at attacker-controlled script variants if the stored `containerPublicId` is tampered with.

background.js (Line 19)
var pa = function(a, b) {    a.g && a.webRequest.onBeforeRequest.removeListener(a.g);    a.g = oa(a, b);    a.webRequest.onBeforeRequest.addListener(      a.g, {        types: ["script"],        urls: ["*://*/*optimize.js*", "*://*/*gtm/js*"],        tabId: b.tabId      },      ["blocking"]    )  },  oa = function(a, b) {    return function(c) {      if (144E5 <= a.ca() - b.startTimeMs) a.storage.remove(["containerParams"]), D(a);      else if (c.url &&        (-1 !== c.url.indexOf("/gtm/js?id=" + b.containerPublicId) ||          -1 !== c.url.indexOf("/optimize.js?id=" + b.containerPublicId))) {        var d = "";        b.resourceKey && (d += "&gtm_preview=" + encodeURIComponent(b.resourceKey));        b.auth && (d += "&gtm_auth=" + encodeURIComponent(b.auth));        b.experiment && (d += "&gtm_experiment=" + encodeURIComponent(b.experiment));        b.debug && (d += "&gtm_debug=" + b.debug);        if (-1 === c.url.indexOf(d)) return {          redirectUrl: c.url + d        }      }    }  };

The `bb` template generates a script that overrides `window.navigator.userAgent` via `Object.defineProperty` and this script is injected into the `<head>` of every iframe when the editor tab is active. Spoofing the User-Agent in the page's JavaScript context can deceive analytics, fraud-detection, or bot-mitigation scripts running on the visited page, and the injection runs inside iframes on third-party origins.

content.js (Line 37)
var bb = function(a) {  a = X("string" === typeof a.userAgent, "userAgent", a.userAgent, "string");  return V("\n    (function() {\n  var userAgent = '" + W(a) + "';\n" +    "      Object.defineProperty(window.navigator, 'userAgent', {\n" +    "        get: function () {\n          return userAgent;\n        }\n      });\n    })()\n  ")};// ...(function() {  var a = cb;  a.runtime.sendMessage({    command: "get",    isFrame: !0  }, function(b) {    if (b && b.success && b.editorTab) {      var c = (b = b.deviceType) && S[b];      if (b && c) {        b = c.a;        c = Za();        c.classList.add("opt-user-agent-script");        var f = ha();        f && c.setAttribute("nonce", f);        a.R(c, bb, {          userAgent: b        });        document.head.appendChild(c);      }    }  })})();

The external message handler (reachable from `https://optimize.google.com/optimize/*`) accepts a `"set"` command that stores a `host`, `token`, `modelUrl`, and `authUser` into chrome.storage and immediately activates a blocking webRequest header listener. These stored values directly control which remote URL is injected as a script on visited pages. If the `externally_connectable` origin were ever compromised or if the Google Optimize domain served attacker-controlled content, an adversary could redirect the injected script to a malicious endpoint.

background.js (Line 41)
var x = "host token modelUrl editorTab authUser checkRedirect deviceType language containerParams".split(" ");c.onMessageExternal.addListener(function(g, m, p) {  var l = {    success: !1,    version: n()  };  if ("set" === g.command) {    var t = {      host: g.host,      token: g.token,      modelUrl: g.modelUrl,      authUser: g.authUser,      deviceType: g.deviceType,      language: g.language,      editorTab: m.tab.id,      checkRedirect: !0    };    if (g.containerPublicId) {      var ta = {        containerPublicId: g.containerPublicId,        experiment: "edit",        tabId: m.tab.id,        startTimeMs: h()      };      pa(f, ta);      t.containerParams = ta;    }    ua(a, m.tab.id, g.deviceType);    e.set(t).then(function() {      l.success = !0;      p(l)    }, function() {      l.success = !1;      p(l)    });    return !0  }  // ..."preview" command also accepted});

The content script runs at `document_start` in every frame on every HTTP/HTTPS page. Combined with the `debugger`, `webRequestBlocking`, and broad host permissions, the extension has the capability to observe and modify virtually all web activity in the browser. Running at `document_start` in `all_frames` means the script executes even inside sandboxed iframes and before any page JavaScript, giving it the earliest possible access to page state.

manifest.json (Line 9)
{  "content_scripts": [    {      "run_at": "document_start",      "matches": [        "http://*/*",        "https://*/*"      ],      "all_frames": true,      "js": [        "content.js"      ]    }  ],  "permissions": [    "storage",    "debugger",    "webRequest",    "webRequestBlocking",    "tabs",    "http://*/",    "https://*/"  ]}

By severity

Critical2
High5
Medium6
Low0

Versions scanned

Showing 2 of 2 scanned versions with more than one unique finding. Counts are unique findings that include each version.

Extension VersionCode Review Findings
0.44.35
0.44.28

Files with findings

3 distinct paths โ€” top paths by unique finding count:

  • background.js7
  • content.js5
  • manifest.json1
S.No.
Category
Severity
File
Summary
Found in Version
1Remote Code Loading
critical
content.js (line 949)This content script constructs a remote script URL from runtime-supplied parameters and injects it into the page context on arbitrary sites. Because the extension runs on all HTTP/HTTPS pages, this is effectively remoโ€ฆ
2Remote Code Loading
critical
content.js (line 38)When a token is present, the content script constructs a remote script URL by concatenating a `host` value (retrieved from chrome.storage, originally supplied via an external message from optimize.google.com) with `/oโ€ฆ
3Network Interception
high
background.js (line 21)A blocking `onBeforeSendHeaders` listener is registered against `<all_urls>` for the active tab. It intercepts every outgoing HTTP/HTTPS request and rewrites the `User-Agent` header before the request is sent. Runningโ€ฆ
4Network Interception
high
background.js (line 19)A blocking `onBeforeRequest` listener intercepts all script loads matching `optimize.js` or `gtm/js` URLs and redirects them by appending authentication and experiment parameters (`gtm_auth`, `gtm_preview`, `gtm_experโ€ฆ
5Privilege Escalation
high
background.js (line 20)The extension uses the `chrome.debugger` API to attach to arbitrary browser tabs and send Chrome DevTools Protocol commands including `Network.enable` (full network traffic visibility), `Network.setUserAgentOverride` โ€ฆ
6Remote Code Loading
high
background.js (line 1272)The extension accepts externally supplied `host`, `token`, `modelUrl`, and device settings from a web page and persists them without validating the destination. In combination with the injected loader in `content.js`,โ€ฆ
7Remote Code Loading
high
content.js (line 36)The `ab` Soy template generates an IIFE string (injected as a `<script>` tag into the target page) that dynamically creates another script element whose `src` is the remote inject URL with auth token and user credentiโ€ฆ
8Network Interception
medium
background.js (line 737)This blocking `webRequest` handler rewrites matching script requests by appending preview, auth, experiment, and debug parameters. It is a clear network interception pattern that alters page resource loading behavior โ€ฆ
9Network Interception
medium
background.js (line 792)This code installs a blocking header-rewrite hook on `<all_urls>` and replaces the `User-Agent` header for the target tab. Modifying request headers across arbitrary destinations is a powerful interception capability โ€ฆ
10Other
medium
content.js (line 664)The content script directly reads and writes page cookies and manages a `__TAG_ASSISTANT` cookie from a script injected into every page at `document_start`. While this appears tied to preview state, cookie manipulatioโ€ฆ
11Other
medium
content.js (line 37)The `bb` template generates a script that overrides `window.navigator.userAgent` via `Object.defineProperty` and this script is injected into the `<head>` of every iframe when the editor tab is active. Spoofing the Usโ€ฆ
12Other
medium
background.js (line 41)The external message handler (reachable from `https://optimize.google.com/optimize/*`) accepts a `"set"` command that stores a `host`, `token`, `modelUrl`, and `authUser` into chrome.storage and immediately activates โ€ฆ
13Unauthorized Data Collection
medium
manifest.json (line 9)The content script runs at `document_start` in every frame on every HTTP/HTTPS page. Combined with the `debugger`, `webRequestBlocking`, and broad host permissions, the extension has the capability to observe and modiโ€ฆ
URLs
18
IPv4
0
IPv6
0

URLs

View the external URLs this extension communicates with to understand its network activity and data interactions.

Gain full insight into all external connections.

Upgrade for full visibility.

support.google.com/optimize/answer/7388531https://support.google.com/optimize/answer/7388531
www.about.to.redirect.com-http://www.about.to.redirect.com/
redirect.result.com-http://redirect.result.com/
www.google.com-https://www.google.com/
clients2.google.com/service/update2/crxhttps://clients2.google.com/service/update2/crx
*-http://*/
*-https://*/
*/*http://*/*
*/*https://*/*
optimize.google.com/optimize/*https://optimize.google.com/optimize/*
Showing 1 to 10 of 20 rows
Rows per page:

Gain full insight into all external connections.

Upgrade for full visibility.

No IP addresses found
Version
Size
Is Malicious
Findings
Permhash
0.44.2
Latest
0.13 MB
Malicious
8
0.44.3
0.13 MB
Malicious
5
Showing 1 to 2 of 10 rows
Rows per page:

Code Diff

Compare extension code between any two versions.

0 changed files (scanned top 25 shared text files)

No comparable text files found between these versions.

Browse and explore files within this extension package

Gain full insight into all external connections.

Upgrade for full visibility.