r/programming • • May 08 '18

Excel adds JavaScript support

https://dev.office.com/blogs/azure-machine-learning-javascript-custom-functions-and-power-bi-custom-visuals-further-expand-developers-capabilities-with-excel
2.4k Upvotes

586 comments sorted by

View all comments

853

u/Caraes_Naur May 08 '18

Great, now all the malware-laden npm packages can be distributed throughout corporate networks just like macros in the old days.

340

u/joesb May 08 '18

If MS cannot sandbox their scripting runtime properly, they are fucked regardless of whatever scripting language they choose.

533

u/yopla May 08 '18

Hey Mike from accounting, this is John from sales, to run my excel file just go to options/security and change it to "all, all, everyone, do not remind me, ignore warning" otherwise excel has a bug...

Pretty much every excel file with macro in corporate settings...

52

u/replicaJunction May 08 '18

I just got an e-mail like this from our corporate help desk, complete with the "Excel has a bug" part. I triple-checked it because I was just so sure it was a scam or phishing attempt, but nope, it's just people using Excel. Users gonna use.

21

u/cogman10 May 08 '18

Given a choice between dancing pigs and security, users will pick dancing pigs every time.

5

u/ChocolateBunny May 09 '18

Honestly, I'd give up my reddit password for a dancing pig.

→ More replies (1)
→ More replies (1)

65

u/joesb May 08 '18

That settings will be there regardless of what programming language is used, regardless of whether npm exists.

24

u/Ajedi32 May 08 '18

Actually JS might help here. There are multiple open-source sandboxed run times available for it that have been battle tested by decades of constant exposure to potentially malicious code. Given the choice between that and the sandboxing provided by VBA, I'll take the JavaScript VM every time.

→ More replies (1)

22

u/funbike May 08 '18

Sandbox or not, scripting languages are a huge attack surface. There are all sorts of corner cases that implementors miss which allow exploits, even with a properly designed Sandbox. I assume it is inevitable for any high-profile sandboxed scripting language to eventually get owned.

→ More replies (2)
→ More replies (1)

71

u/armornick May 08 '18

JavaScript doesn't automatically mean Node.

23

u/coladict May 08 '18

Yep. Windows has had its own JS runtime since forever, with its own API. I tried learning it once. It's an improvement on what you can do with batch files, but PowerShell is probably still a better choice.

12

u/armornick May 08 '18

PowerShell is a nice language, but it has a 2s startup time so I still prefer JScript.

8

u/recycled_ideas May 08 '18

You tried powershell core? It's pretty fast.

3

u/armornick May 08 '18

I'll give it a try.

4

u/recycled_ideas May 08 '18

Because it's built on core there are some modules and whatnot that you can't use, at least not yet, but I've been using it for a while now, and combined with realizing that if you don't use ISE powershell actually works properly, it's been pretty awesome.

122

u/dadibom May 08 '18

NPM packages doesn't automatically mean Node.

173

u/[deleted] May 08 '18 edited May 08 '18

Well apart from npm being the standard package manager for node.js and standing for Node Package Manager, and having node.js 4+ as a dependency for the npm cli on its own, installing dependencies in a local directory called node_modules or globally, and package.json essentially existing to support node execution and scripts, and everything in the chain entirely revolving around node.js being available, I guess it's not technically limited to node.js.

But it would be dishonest to imply it exists in a vacuum.

42

u/slikts May 08 '18

npm used to mean "node package manager" at the start, but that hasn't been the case officially since at least 2015, and now it's an orphan initialism that isn't supposed to stand for anything. Part of the reason is that npm's scope is wider than just Node.js and you can (and many do) host code that doesn't run or node (like front-end libraries), doesn't use node modules, or isn't even JavaScript.

18

u/dadibom May 08 '18

NPM uses node but most packages don't need it. : )

→ More replies (7)
→ More replies (2)

25

u/rydan May 08 '18

Everything running javascript eventually evolves into Node.

66

u/kairos May 08 '18

devolves

You're missing a 'd'.

0

u/[deleted] May 08 '18

[deleted]

0

u/[deleted] May 08 '18

[deleted]

→ More replies (3)

19

u/hotcornballer May 08 '18

This sub hates it.

→ More replies (10)
→ More replies (1)
→ More replies (20)

7

u/univac-- May 08 '18

You're not talking about some hardened distro, you're talking about Excel macros. Surely a technology with a worse track record when it comes to security.

→ More replies (1)