News for hackers. Stuff that matters.
Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by rachelbythebay on Wednesday February 10, 2021 @04:33AM (#26087172)
I’m cackling at how great this is. This is what happens when you trust the internet forever and just scarf down any old thing at build time. Of course it’ll get exploited! That’s what evil people do.
Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by CaptArmchair on Wednesday February 10, 2021 @05:23AM (#26087487)
There are a lot of expensive things you can outsource. Responsibility isn't among those.

Free software / open source propels engineering as you can share and leverage the results of collective efforts. However, at no point did the concept come with inherent guarantees about concerns such as security.

esr defined 19 points for "good" open source software development in his seminal essay "The Cathedral and the Bazaar". I feel some of those are sometimes easily thrown out of the window for the sake of "efficiency" or "cost-effectiveness".

This issue resonates with bullet point 17 in particular:

> A security system is only as secure as its secret. Beware of pseudo-secrets.

I think this issue has less to do with package managers, and a lot with companies rushing into the convenience of public code platforms such as Github without properly vetting whether or not they might be inadvertently leaking internal information through packaging manifests.

https://en.wikipedia.org/wiki/The_Cathedral_and_the_Bazaar

Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by iib on Wednesday February 10, 2021 @06:13AM (#26087788)
Offtopic, but I found nowhere to actually ask this question. Does anybody know if ESR is still alive? His blog [1] has not been updated in months--and looking at his post dates, this seems really out of character--, he hasn't posted anything on twitter, or his usual channels.

[1] http://esr.ibiblio.org/

Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by knowhy on Wednesday February 10, 2021 @06:44AM (#26087998)
Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by tyingq on Wednesday February 10, 2021 @12:58PM (#26092550)
https://github.com/eric-s-raymond

Scroll down to contribution activity. Forked a repo, created a pull request, etc, on Feb 1st 2021.

Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by syshum on Wednesday February 10, 2021 @07:50AM (#26088420)
>>There are a lot of expensive things you can outsource. Responsibility isn't among those.

That is not true at all, the industry both Development and even more so in Operations has been outsourcing responsibility for a long time, they is why we have support contracts, SLA's and other very expensive services we pay many many times more than the cost of hardware for...

To outsource responsibility... Network down -- Call Cisco... Storage Down Call EMC or Nimble... etc

Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by CaptArmchair on Wednesday February 10, 2021 @08:12AM (#26088607)
I disagree.

A support contract allows you to hold a sub-contractor accountable. But that's the extent of what an SLA does. What it doesn't do is diminish your responsibility towards anyone who relies on the services you provide yourself. These are distinct things.

Put more succinctly, if the network's down: that's still very much your problem. Especially if you over-promised 100% availability to the end users of your services. Your end users do not care about Cisco, EMC or Nimble. They don't have contracts with any of those. They have a contract with you and they can and will hold you accountable if you don't deliver on what you sold them.

Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by syshum on Wednesday February 10, 2021 @08:41AM (#26088851)
I guess this is where we need to define our anology

for a sysadmin the customer is "the employer" and they do not really have a contract with the sysadmin, rather the employer has contract with Cisco, or Nimble, etc. the sysadmin has "outsourced" his/her responsibility in that context.

For example instead of rolling your own storage device using linux, or freenas or something else, you buy an expensive 3rd party solution with expensive support contracts to outsource their responsibility. If it goes down "I have a support ticket open with vendor" instead of "I am attempting to merge the lastest kernel patch I have downloaded from github"

That is the source of the phrase "No one ever got fired for buying Cisco" or insert name of other large vendor. They do not get fired for it because they have outsourced their responsibility

Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by CaptArmchair on Wednesday February 10, 2021 @10:36AM (#26090541)
That's a fair point. And it's a good point. There's a difference in types of contracts and the relationships they represent. An employee/employer relationship is distinct from a customer/vendor relationship.

An employee/employer relationship is defined by a few key properties. As an employee, you sell your time and your expertise to your employer, and you agree to submit to the authority of your employer in exchange for a salary. The extent of your responsibility - and this is absolutely key - is captured in your contract.

It also means that many things simply aren't your responsibility to begin with, even though you deal with them on a day-to-day basis.

As a systems administrator you, quite likely, won't get fired for failing Cisco gear or services because you're not the one who ultimately signs off on the contract with Cisco on behalf of your employer. Responsibility has always resided with the executives who cover and sanction your actions and decisions.

An executive, though, usually won't get fired over failing Cisco gear/services itself, but they will get fired over any ensuing loss of revenue, damage to brand/image, litigation over exposed liabilities,...

A great example of this is President Harry S. Truman who famously had a sign on his desk stating "The buck stops here".

https://en.wikipedia.org/wiki/Buck_passing

As for the systems administrator, your role is to actively engage in day-to-day operations. You're basically hired "to keep the lights on". Whether the proverbial "light" was procured from Cisco or handcrafted in-house is inconsequential to your employer as far as your individual role as an employee is concerned.

Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by greggman3 on Wednesday February 10, 2021 @05:09AM (#26087395)
There's more coming.... tons of github integrations ask for blanket access to your account vs Oauth, (https://github.com/marketplace). Tons of github users give that access, the access_tokens are only a password type breach away. If you have these access_tokens you can edit the repos they are for all you want.
Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by prepend on Wednesday February 10, 2021 @07:59AM (#26088494)
I wish GitHub would create a proper auth design. I won’t grant blanket permissions to tokens because there’s too much risk of something going wrong.

It seems dumb that they don’t have per repo tokens. I think the issue is with their licensing as if they made proper tokens users could abuse it by giving tokens to their friends. But this should be detectable in a friendly (please don’t do that) way.

I want to be able to give read-only access to private repos.

I want to be able to give fine grained function level and repo level access.

If I’m an admin on multiple repos, I want to be able to issue a token for just a single repo so I can give that to a CI job without worrying if every single repo I admin is at risk.

They allow ssh keys with some similar functionality, but ssh keys can’t be used as much as tokens.

I’ve been waiting for a story about how some third party app granted access to my whole org gets taken over and wreaks havoc. Eventually this will probably be the attack that alters real packages instead of these name overloading packages.

Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by 0xbadcafebee on Wednesday February 10, 2021 @10:21AM (#26090307)
> It seems dumb that they don’t have per repo tokens.

Technically you can create one new GitHub account per repo and generate a token for that... But that is highly annoying :)

They need to support IAM / RBAC style policies and tie every authn+z method to those policies, but my guess is they have different auth methods strung all throughout their codebase so implementing it will take a few years. Then of course they have to make it "user friendly" as we all know how painful IAM can be...

Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by prepend on Wednesday February 10, 2021 @05:13PM (#26095516)
Comically, that’s why my GitHub recommended. Of course that’s a nightmare for a user to manage, violates our sso requirement, and GitHub charges per user.
Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by leetrout on Wednesday February 10, 2021 @09:27PM (#26097539)
We do this at work. And you pay per user per team so we’re paying double or triple in some cases by managing access via teams.
Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by gardaani on Wednesday February 10, 2021 @05:32AM (#26087540)
At the moment, there's a story about github1s.com on the front page of HN and people are asking how to give it access to their company private repos [1][2]. Scary.

[1] https://news.ycombinator.com/item?id=26087017

[2] https://news.ycombinator.com/item?id=26086789

Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by leetrout on Wednesday February 10, 2021 @05:27AM (#26087514)
Apparently the Oauth scopes are much worse than GitHubs apps. Only GitHub apps allow read only access to the “metadata” by default whereas Oauth apps get access to the code, deploy keys, etc with no way to limit that access per repo.

https://docs.github.com/en/developers/apps/scopes-for-oauth-...

https://docs.github.com/en/rest/reference/permissions-requir...

Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by PartiallyTyped on Wednesday February 10, 2021 @05:26AM (#26087505)
Different access tokens have different permissions, you can't just do whatever you want.
Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by tomashubelbauer on Wednesday February 10, 2021 @05:34AM (#26087557)
Yeah, but at least with PATs (not sure about other token types), you can't scope them to a particular repo, so whenever you need to allow something to even see a private repo or write to a public repo, the token you supply to allow that can do that for all repos and that alone is potentially really destructive. I am not sure if there is a good reason for why PATs can't be scoped to a repository, because if they were allowed to be, it would do a lot for security I think.
Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by RyJones on Wednesday February 10, 2021 @05:39AM (#26087582)
Worse: you can’t even scope it to an org, and some integration points are only available to org owners!

GitHub is terrible.

Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by seg_lol on Wednesday February 10, 2021 @06:38AM (#26087957)
That explains why at a place I worked we had multiple github orgs for different subteams, and/or they were really cheap ... yeah confused now.
Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by RyJones on Wednesday February 10, 2021 @06:43AM (#26087987)
We also have multiple orgs, but we hit the requirement that you only have one bot account. It would be super nice if GitHub allowed much tighter scoping for PATs.

I don’t know how many GitHub orgs the Linux Foundation has, but... hundreds? Having one bit account with wide permissions is a non starter

Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by greggman3 on Thursday February 11, 2021 @01:21AM (#26098814)
Most integrations just ask for blanket all permissions. They do this because it means they can give you a list of repos and let you choose which ones to integrate their service into with no work on your part except "click yes to give us permission to do everything for you and ... we'll do everything for you"
Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by christophilus on Wednesday February 10, 2021 @12:20PM (#26092019)
Honestly, it’s one of the things that makes me nervous about running Linux on all of my computers. At least with Windows (and probably OSX), my updates come from a single vendor who has strict internal code audits and security requirements. With Linux (I’m using Pop), my updates come from a package manager with a crapload of packages, each maintained by a different team / group with no central policy. There’s no way the small team at Pop can review and audit all of the things in the apt package system, and there have to be plenty of maintainers of popular packages who get sweet offers to sell out.

Anyway. I’m sticking with Pop / Linux. But it does make me nervous!

Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by danhor on Wednesday February 10, 2021 @05:49PM (#26095886)
At least with windows, the drivers aren't checked that much and accordingly, have had some serious issues.

I'd guess distros are generally better off in that respect, but kernel space & user space aren't that different nowadays, when caring about your own security

Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by jonny_eh on Wednesday February 10, 2021 @12:36PM (#26092229)
For Linux, it's about choosing a distro you can trust. Most manage their own repos, some more carefully than others.
Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by tyingq on Wednesday February 10, 2021 @12:51PM (#26092452)
Also happy.

I'm very happy to finally have a real world example to motivate all the folks that eye-rolled me every time I've raised it in the past. It just resonates better, especially with less technical leadership folks.

Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by walrus01 on Wednesday February 10, 2021 @05:30AM (#26087534)
Hey let's just sudo curl | bash

what could possibly go wrong?

Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by thombles on Wednesday February 10, 2021 @06:08AM (#26087743)
Not sure if serious, but I will point out this is significantly different. If I'm installing an application like homebrew or the Rust toolchain then I am explicitly giving them the right to code execution. It doesn't much matter whether they get it through the script on their website or the binaries downloaded from that website.

Random libraries, possibly pulled in by a dependency of a dependency of a dependency... not so much.

Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by hda2 on Wednesday February 10, 2021 @10:03PM (#26097789)
I know this is besides the point, but rust can be installed - without piping the output of a public-facing server into a privileged shell - by using their offline installer: https://forge.rust-lang.org/infra/other-installation-methods...

They offer PGP signatures too!

Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by beermonster on Wednesday February 10, 2021 @10:04AM (#26090057)
You even see Microsoft offering those types of install one-liners. e.g.

curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin <additional install-script args>

See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-in...

There are other examples I've seen from time to time.

Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by da_big_ghey on Wednesday February 10, 2021 @06:08AM (#26087744)
That's curl | sudo bash smh what an amateur
Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by beermonster on Wednesday February 10, 2021 @09:59AM (#26089994)
And wonder how long it will take for similar repeats on other repos such as dockerhub, apt, nuget, homebrew etc etc.
Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by geek_at on Wednesday February 10, 2021 @05:10AM (#26087406)
I'm more amazed by the fact that they got bounties because the attack wouldn't be (easily) possible without insider knowledge on which dependencies their internal build system used
Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by knowhy on Wednesday February 10, 2021 @05:17AM (#26087447)
> To test this hypothesis, Birsan began hunting for names of private internal packages that he could find in manifest files on GitHub repositories or in CDNs of prominent companies but did not exist in a public open-source repository.

If I'm not mistaken insider knowledge wasn't necessary.

Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by geek_at on Wednesday February 10, 2021 @06:58AM (#26088089)
my mistake
Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by peteretep on Wednesday February 10, 2021 @05:21AM (#26087470)
You say this, but I feel like in the 20-odd years I’ve been using package managers I’ve seen very very few real world exploits?
Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by dspillett on Wednesday February 10, 2021 @06:00AM (#26087693)
While the risk is low, the potential impact of a successful exploit is massive so the matter should be taken seriously.

Remember how much was temporarily broken in the leftPad event? Imagine if all that had been silently back-doored instead?

Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by Cthulhu_ on Wednesday February 10, 2021 @05:32AM (#26087542)
Consider yourself lucky I guess? I mean in the 20-odd years I've been driving I've never had an accident either.
Re:Dependency Confusion: How I Hacked Into Apple, Microsoft ... by hanselot on Wednesday February 10, 2021 @05:26AM (#26087504)
Why would the ones getting away with it bother publishing articles about it? Rather, 20 years is a plenty long enough time to cover your tracks.