News for hackers. Stuff that matters.
Re:Electron apps cannot be submitted to the Apple store by creatornator on Sunday November 03, 2019 @07:36PM (#21437904)
Dependencies of your dependencies! Imagine installing a library that depends on a couple dozen libraries in its own right. You may not have time to inspect every single node in the dependency graph.
Re:Electron apps cannot be submitted to the Apple store by geofft on Sunday November 03, 2019 @09:12PM (#21438409)
As an end user, can I just say how uncomfortable I am at the idea that some app on the App Store includes some node.js dependency where the app developer has no idea what's in it? What if it's event-stream?

If you're sending me code to run on my computer—especially if I'm paying for it—you either need to have glanced at the code yourself or have some reason to trust what's in there (it's from a company you have a business relationship with, it's a major library from a known author that other apps on the store are also using, etc.). Otherwise you're being irresponsible. If you don't have the time to look at the library, don't use it.

Re:Electron apps cannot be submitted to the Apple store by lostmyoldone on Monday November 04, 2019 @12:05AM (#21439179)
I'm a developer, and knowing how this is the default is not something I particularly like, but it's really only in the most security/mission critical code that dependencies get thoroughly wetted.

You can fully expect that less then 1% of the apps in any app store has a transitive dependency chain that is fully known and understood by the author to any meaningful extent.

Most of that code is however understood by someone, although not necessarily the app developer. The sandboxing and app permission dialogue boxes are unfortunately a critical part of the defense against malicious code, although not a perfect one by any stretch of the imagination.

Re:Electron apps cannot be submitted to the Apple store by tracker1 on Sunday November 03, 2019 @11:03PM (#21438945)
So never run Linux?
Re:Electron apps cannot be submitted to the Apple store by geofft on Monday November 04, 2019 @05:39AM (#21440400)
I get Linux from people I trust to verify source code and the source code of dependencies and to push back against dependency sprawl (Debian, in my case, and I'm on debian-devel and I happen to see every email sent for every new package; there's an overhead there). Others get Linux from a vendor they have a commercial relationship with (Red Hat, Canonical, even Oracle, etc.)

So, can you expand on why you think one should never run Linux?

Re:Electron apps cannot be submitted to the Apple store by rmgraham on Monday November 04, 2019 @12:44AM (#21439303)
Or only run Linux? *

* (any source available OS)

Re:Electron apps cannot be submitted to the Apple store by tracker1 on Monday November 04, 2019 @01:59AM (#21439500)
GP says not to run anything you haven't looked at yourself for the most part, paraphrasing. I doubt anyone has self audited all the software and drivers going into a desktop Linux distro.

The point is, at some point you stop digging

Re:Electron apps cannot be submitted to the Apple store by geofft on Monday November 04, 2019 @05:42AM (#21440414)
> GP says not to run anything you haven't looked at yourself for the most part, paraphrasing.

That is a highly inaccurate paraphrase of what I said. You can tell it's inaccurate because I'm specifically suggesting that end users should be able to trust apps on the App Store without auditing the apps ourselves, as long as we trust the app authors, and that app authors should bear responsibility for what they redistribute.

Re:Electron apps cannot be submitted to the Apple store by de_watcher on Monday November 04, 2019 @03:03AM (#21439733)
Desktop Linux distros have package maintainers and companies behind them like RedHat or Canonical.
Re:Electron apps cannot be submitted to the Apple store by toast0 on Monday November 04, 2019 @03:19AM (#21439817)
GP says not to publish anything you haven't looked at (or OKed by appeal to authority). Publishing should be a higher standard than running.
Re:Electron apps cannot be submitted to the Apple store by Scapeghost on Sunday November 03, 2019 @10:08PM (#21438697)
> Dependencies of your dependencies! Imagine installing a library that depends on a couple dozen libraries in its own right. You may not have time to inspect every single node in the dependency graph.

Excuse me, are you, the developer, telling me, a user, that you don't know what you're giving me to run on my computer?

Re:Electron apps cannot be submitted to the Apple store by michaelmrose on Sunday November 03, 2019 @11:20PM (#21439012)
Hi my name is node_modules have you met me? If you invite me to a party I bring my 500 closest friends as my plus one!

I just looked at the node_modules folder for a project that runs user configured code when your imap server gets a new mail via imap idle. It's called imapnotify and inside its node_modules dir I see it pulls in 549 js files.

The majority are under 100 lines per file dozens are between 1 and 30.

Cutting just the last segment so that /foo/bar/baz.js and /bam/baz.js both appear as baz.js and removing dupes reduced the number of unique filenames to 383.

Basically every js dev is either telling you or not telling you that they don't know what they are giving you to run on your computer.

Re:Electron apps cannot be submitted to the Apple store by catalogia on Monday November 04, 2019 @04:01AM (#21439964)
There are reasons forums known for being less diplomatic than HN often take delight in heaping scorn and ridicule on js devs. This is one of those reasons.
Re:Electron apps cannot be submitted to the Apple store by JohnFen on Monday November 04, 2019 @12:32PM (#21443987)
> If you invite me to a party I bring my 500 closest friends as my plus one!

That sort of thing is a big red flag that perhaps you should reconsider using that package.

But even if you do use it, that in no way reduces the fact that it's your responsibility to know what you're shipping.

Re:Electron apps cannot be submitted to the Apple store by michaelmrose on Monday November 04, 2019 @12:55PM (#21444281)
That is every javascript package ever incidentally. Do you have an alternative suggestion as far as connecting to an imap server and responding to events? Not a library to write such a thing but an actual implementation.
Re:Electron apps cannot be submitted to the Apple store by JohnFen on Monday November 04, 2019 @01:11PM (#21444489)
No, I don't, but even if there are no such alternate packages, that doesn't mean it's OK to use one that you can't sufficiently understand.

If you can't find an acceptable package, then I'd absolutely recommend writing that functionality yourself. connecting to an IMAP server and responding to events aren't complicated tasks, after all.

Re:Electron apps cannot be submitted to the Apple store by michaelmrose on Monday November 04, 2019 @02:11PM (#21445235)
This is entirely feasible but what percentage of people can write replacements for problematic tools and what tools can they afford to replace time?
Re:Electron apps cannot be submitted to the Apple store by JohnFen on Monday November 04, 2019 @03:37PM (#21446228)
Among software engineers? I would expect (hope?) that the percentage that could do this approaches 100.
Re:Electron apps cannot be submitted to the Apple store by michaelmrose on Tuesday November 05, 2019 @04:14AM (#21450847)
How much extra time do you have to reimpliment things that work because you disagree with how they are written?
Re:Electron apps cannot be submitted to the Apple store by JohnFen on Tuesday November 05, 2019 @11:11AM (#21453632)
You misunderstand what I'm saying. This isn't about disagreeing with how anything is written, this is about the responsibility of developers to know what they're shipping.

If devs can't do things like be able to tell what dependencies a module/library has, then they shouldn't use that module/library.

Re:Electron apps cannot be submitted to the Apple store by concerned_user on Monday November 04, 2019 @02:32AM (#21439610)
With NPM as an example to fully know every dependency is a highly time-intensive and complicated task due to following:

* you can't be sure code in package is same you see on github as npm doesn't do signatures

* code already in node_modules is usually minified and obfuscated

So only real way to be sure is to make own repository, copy every dependency, check code, build own packages and only use packages from your repo. Repeat process when versions are updated.

So to answer your question, yes, 99% of apps, they don't know.

Re:Electron apps cannot be submitted to the Apple store by JohnFen on Monday November 04, 2019 @12:33PM (#21444002)
That's an excellent reason to avoid using apps.
Re:Electron apps cannot be submitted to the Apple store by wpietri on Sunday November 03, 2019 @11:37PM (#21439086)
I think that ship sailed a long time ago. Right now I'm building an app with Google's mobile toolkit, Flutter. Flutter itself is a few hundred kloc. And on top of that, I'm using a bunch of libraries; I wouldn't be shocked if it were the same amount of code again. Assuming I can properly code review a few hundred lines per hour, reviewing all that will take me a year or so. Which is maybe 5x what it will take me to ship an MVP.
Re:Electron apps cannot be submitted to the Apple store by concerned_user on Monday November 04, 2019 @02:40AM (#21439634)
You are missing the fact that dependency tree is constantly changing as dependencies get bug fixes and security patches, so in the middle of your review you will be forced to re-check.

Unless you are willing to freeze whole tree until review is done but then you don't get bug fixes and security updates for period of initial review + review of updated packages.

Re:Electron apps cannot be submitted to the Apple store by root_axis on Sunday November 03, 2019 @11:27PM (#21439044)
Is that a joke? Surely you aren't suggesting that developers should have full knowledge of all transitive dependencies that compose their application stack.
Re:Electron apps cannot be submitted to the Apple store by bildung on Monday November 04, 2019 @03:12AM (#21439786)
> Is that a joke? Surely you aren't suggesting that developers should have full knowledge of all transitive dependencies that compose their application stack.

This will be borderline impossible for a nodejs developer, but a perfectly realistic expectation for e.g. a Django project.

Re:Electron apps cannot be submitted to the Apple store by ryandrake on Monday November 04, 2019 @03:59AM (#21439953)
Honestly, it boggles the mind to think that a responsible developer would just pull in some 3rd party dependency without auditing what it does/calls and what other sub-dependencies it has, and then ship it as their product that their business relies on.

Everywhere I’ve ever worked, adopting a dependent library was a HUGE DEAL. You don’t do it lightly. You have to know what’s in it, know what it calls, know what the license is, understand the increased security attack surface, measure how much bigger it makes your binary, measure any performance deltas, and so on. In bigger companies, you need to get all sorts of approvals... Who the heck are these companies where you just hook up the git submodule and wing it?

Re:Electron apps cannot be submitted to the Apple store by watermelon0 on Tuesday November 05, 2019 @02:13AM (#21450349)
Can you even know every transitive dependency in an average Node.js project? I just looked at a simple web service we have, which doesn't use any framework or such, and it's 5 dependencies pull in 75 dependencies altogether.

Since most applications nowadays are server side, you would usually already pull 1 GB+ of Docker layers, before you even add application + libraries.

Facebook on iOS seems to be around 400 MB of size (first result from quick googling, might be wrong), and average Electron app is 120 MB+, so I don't think the size is a huge concern.

Re:Electron apps cannot be submitted to the Apple store by josefx on Monday November 04, 2019 @07:22AM (#21440942)
For licensing reasons alone, almost got hit by one dependency switching from LGPL 2 to GPL 3 and one project we bought dropped dead once someone went over its dependency tree and noticed the mess of highly incompatible licenses, it would have taken years to get to a point where we could legally publish anything. Not knowing about all of your dependencies is a liability.
Re:Electron apps cannot be submitted to the Apple store by flukus on Monday November 04, 2019 @01:54AM (#21439488)
Not full knowledge. But you should know about every single dependency, know what they do and if they're from a trustworthy source. Being able to say with confidence that you aren't installing malware on your customers machines is the least you can do.

On the developer side there's more though, you should know what their release cycles are like, how they manage compatibility, how long they support older releases etc. You don't what your app stuck in a 3 month upgrade cycle just because a transitive dependency needed an update.

There's a reason dependencies are there own form of technical debt and need to be minimized.

Re:Electron apps cannot be submitted to the Apple store by root_axis on Monday November 04, 2019 @02:55AM (#21439694)
Knowing every transitive dependency in your application stack is totally unrealistic and is pretty much impossible for any modern commercial software outside of specialized/embedded systems.

Having knowledge of every dependency explicitly linked into your application is a basic tenet of software development that literally every software professional would endorse as a necessary best practice, but it's not what we're talking about here. I am 100% certain that every developer with a commercial Electron app is aware that they are relying on Electron as a dependency and Github as a trustworthy software vendor.

Re:Electron apps cannot be submitted to the Apple store by flukus on Monday November 04, 2019 @04:51AM (#21440178)
> outside of specialized/embedded systems.

I think you're conflating platforms and dependencies. The OS it runs on is a platform that the the user already trusts, left-pad is a dependency the developers are responsible for. There's some grey area like electron or the JVM but even there electron sticks out as a huge binary blob the user isn't explicitly asked to install.

Re:Electron apps cannot be submitted to the Apple store by root_axis on Monday November 04, 2019 @11:23AM (#21443066)
I never brought up operating systems in the context of this discussion on dependencies. Electron is not an operating system, so I am not sure what your point is.
Re:Electron apps cannot be submitted to the Apple store by rdevnull on Monday November 04, 2019 @07:48PM (#21448494)
Chromium and also Electron are trustable sources. Besides that any Mac OS X App from 10.15.1 (Catalina) has to be notarized. I got the dmg notarized so I know that the malware is not the issue. Now asking every ElectronJS developer to know every single part of Chromium or even electron itself is a bit unreasonable.
Re:Electron apps cannot be submitted to the Apple store by ivan_gammel on Monday November 04, 2019 @12:22AM (#21439233)
as CTO I know all the dependencies in the application stack of our company and I require developers to have sufficient understanding of their purpose, licensing model etc. There are tools to simplify this task. It’s much harder to do for TypeScript than for Java, mostly because NPM ecosystem is a huge pile of junk, but it’s still important part of developer's job.
Re:Electron apps cannot be submitted to the Apple store by root_axis on Monday November 04, 2019 @12:36AM (#21439281)
> as CTO I know all the dependencies in the application stack of our company

You know all of the transitive dependencies in the application stack of your company? Out of curiosity, what is the ballpark figure on the total number of transitive dependencies in your application?

Re:Electron apps cannot be submitted to the Apple store by ivan_gammel on Monday November 04, 2019 @08:02AM (#21441210)
Hundreds, mostly because of the JS nonsense. Our Java microservices are lean and strictly controlled.
Re:Electron apps cannot be submitted to the Apple store by nl on Monday November 04, 2019 @07:12AM (#21440875)
as CTO I know all the dependencies in the application stack of our company

I'm a few years out of the Java world these days, but you've vetted every line in every one of those Apache commons projects that gets pulled in? Because that's a lot of reading...

Over 10 years ago I went through every single Java RSS parsing library and all their forks (I think there were 5) to fix Xml eXternal Entity (XXE) attacks (eg[1]) and submitted fixes for them all.

That was a huge amount of work, because they all used random version of different XML parsers, all of which required external entity processing to be turned off in different ways.

None of the authors of the packages were aware of the issue, and as far I could determine at the time I was the only person in the entire Java ecosystem who knew all the different parsers arguments.

This was a critical, remotely exploitable vulnerability. I'd never claim to know about it now, and it was only for a few weeks back in 2006 that I really knew it then.

So when you say you "know" all the dependencies in your stack, what do you mean exactly?

[1] https://rometools.jira.com/browse/ROME-46

Re:Electron apps cannot be submitted to the Apple store by ivan_gammel on Monday November 04, 2019 @08:01AM (#21441196)
We barely have any of the Apache commons dependencies - in most cases use of them is not justified in modern Java. If there’s anything like that we are ready to support such dependency on source code level, patching and setting up own build pipeline if necessary. Free software cannot be trusted if you are not ready to own it. Commercial software cannot be trusted either, but there are other ways to manage the risks there.
Re:Electron apps cannot be submitted to the Apple store by fookitty on Monday November 04, 2019 @01:10PM (#21444473)
I can't believe you check all the source code, dependencies source code and the rest of the shit show that npm brings to the party, that's very cool, all CTOs should be like you. As a CTO should you have to do this though? I'm not sure.
Re:Electron apps cannot be submitted to the Apple store by ivan_gammel on Tuesday November 05, 2019 @01:08AM (#21450082)
We are growing startup and it’s important to have this culture of understanding what and how you build from the very beginning. This responsibility is now transferred to technical leads, but I’m still aware of what’s going on and spend some time on the code reviews.
Re:Electron apps cannot be submitted to the Apple store by imtringued on Tuesday November 05, 2019 @07:44AM (#21451842)
How much time does it take to read through the millions of lines of code?
Re:Electron apps cannot be submitted to the Apple store by diggan on Thursday November 07, 2019 @06:48AM (#21472319)
Usually you don't write a project and then sit down to read through all dependencies, but it's a process that happens when you do add a dependency.

So, the process would be something like: have a problem that a library might solve, find a library that could solve the problem, verify it can solve the problem, look through the implementation, look through it's dependencies, then actually include it in the build. If anything doesn't look nice at each step, rollback and find something else or start writing your own implementation.

Do this from beginning of the project and you'll always have a full understanding of the system.

Re:Electron apps cannot be submitted to the Apple store by DagAgren on Monday November 04, 2019 @05:03AM (#21440232)
I do know just that for apps I ship.

I will never in a million year ship anything on, for instance, node.js, for exactly this reason.

Re:Electron apps cannot be submitted to the Apple store by JohnFen on Monday November 04, 2019 @12:36PM (#21444030)
I think that's not an unreasonable thing to expect at all. If the libraries you're using make that impossible, then you shouldn't use those libraries. You should know what you're shipping.

As a developer, I'm honestly and utterly stunned to see other developers arguing otherwise.

Re:Electron apps cannot be submitted to the Apple store by saagarjha on Sunday November 03, 2019 @07:38PM (#21437915)
It's going to sound uncharitable, but if you're clearly being rejected for something that your dependencies is doing wrong you should make time to figure out which one it is.
Re:Electron apps cannot be submitted to the Apple store by Fr0styMatt88 on Sunday November 03, 2019 @08:15PM (#21438123)
Is it really difficult to find private API usage? Can they be searched for through static or dynamic analysis?

I don’t develop for iOS so I’m genuinely curious. Do they provide automated tools for developers to use? Or a flag that fails your build if you’re trying to call private APIs: For that matter, how are the reviewers catching these API usages?

I find it strange that a private API can be used accidentally, without something notifying the developer before they’ve gotten to the stage of submitting their app.

Re:Electron apps cannot be submitted to the Apple store by saagarjha on Sunday November 03, 2019 @08:24PM (#21438160)
> I find it strange that a private API can be used accidentally, without something notifying the developer before they’ve gotten to the stage of submitting their app.

It's difficult to use private API accidentally. However, it is possible to use a dependency that purposefully uses private API, which is what happened here.

> Do they provide automated tools for developers to use?

No.

> Or a flag that fails your build if you’re trying to call private APIs

Kinda, but that doesn't help you if your dependency is trying really hard to use that API and has been precompiled.

> For that matter, how are the reviewers catching these API usages?

They're running somewhat stupid static analysis and possibly some dynamic analysis? They don't tell you what they do but they're not very good at it and don't generally catch even basic obfuscation. However, if a human finds your private API usage and you look like you're trying to obfuscate it, they won't be nearly as lenient.

Re:Electron apps cannot be submitted to the Apple store by aaronbrager on Sunday November 03, 2019 @09:05PM (#21438380)
Yes, as indicated in the OP you can use otool to see which private APIs are being called.
Re:Electron apps cannot be submitted to the Apple store by abjKT26nO8 on Sunday November 03, 2019 @08:25PM (#21438170)
Your dependencies (including the transitive ones) are your responsibility. If you can't keep track of them, perhaps you fucked up. https://queue.acm.org/detail.cfm?id=3344149
Re:Electron apps cannot be submitted to the Apple store by JohnFen on Monday November 04, 2019 @12:28PM (#21443949)
> You may not have time to inspect every single node in the dependency graph.

You may not have time to do your job properly?

If you're using libraries in your project, it's normal and expected that you know what those libraries are doing and what those libraries depend on. You should know this stuff regardless of what Apple (or anyone else) may require.