VM script error in browser console

,

I noticed a script error in my Brave browser console in developer tools and there’s a chance it’s an intentional script built in to Brave but I’m concerned my device has been compromised due to the URLs in the script.

This is the script:

(function() {
let nextIndex = window.content_cosmetic.cosmeticStyleSheet.rules.length;
const selectors = ["a[onmousedown^="this.href='http://paid.outbrain.com/network/redir?\“][target=\”_blank\“]”, “a[href^="https://ab.advertiserurl.com/aff/\“]”, “a[href^="https://mediaserver.gvcaffiliates.com/renderBanner.do?\“]”, “div[data-contentexchange-widget]”, … there are lots more URLs here but I’m not allowed to post more than 4 links”]”, “div[data-ad-wrapper]”];
selectors.forEach(selector=>{
if ((typeof selector === ‘string’) && (window.content_cosmetic.hide1pContent || !window.content_cosmetic.allSelectorsToRules.has(selector))) {
let rule = selector + ‘{display:none !important;}’;
window.content_cosmetic.cosmeticStyleSheet.insertRule(${rule}, nextIndex);
if (!window.content_cosmetic.hide1pContent) {
window.content_cosmetic.allSelectorsToRules.set(selector, nextIndex);
window.content_cosmetic.firstRunQueue.add(selector);
}
nextIndex++;
}
}
);
if (!document.adoptedStyleSheets.includes(window.content_cosmetic.cosmeticStyleSheet)) {
document.adoptedStyleSheets = [window.content_cosmetic.cosmeticStyleSheet, …document.adoptedStyleSheets];
}
;
}
)();

And the error it produced in the console:

Uncaught DOMException: Failed to execute ‘insertRule’ on ‘CSSStyleSheet’: Failed to parse the rule ‘html[lang] > body#body > head" > div.cv-xwrapper > div.cvc > div.cv-inner{display:none !important;}’.
at :10:58
at Array.forEach ()
at :5:21
at :26:11

I’m using version 1.67.134 Chromium: 126.0.6478.186 (Official Build) (arm64)

I was using a private window (not Tor).

I’m currently on a Squarespace website but it seems to be happening on other sites like StackOverflow so I don’t think it’s related to the site I’m on.

I’m hoping it’s just the way the ad blocker works by using CSS to hide ads from those URLs, but just want to make sure, thanks.

1 Like

I’m seeing this too. The script is almost definitely built in to Brave, see their github https://github.com/brave/brave-core/blob/master/components/cosmetic_filters/renderer/cosmetic_filters_js_handler.cc (kHideSelectorsInjectScript)

But it’s not clear where or how the list of selectors is populated. Some of the urls in the selector list are clearly shady and/or porn sites. And I’ve noticed the console error doesn’t happen on all sites; google.com and apple.com are clean but it happens on yahoo.com for example.

I just updated to Version 1.68.134 Chromium: 127.0.6533.88 (Official Build) (arm64) but it was happening on the previous version which I failed to record. I hoped the update would take care of it.

1 Like

I believe that this is a known issue:

This should be resolved when the Brave Ad Block Updater is updated to v1.0.7178 or later.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.