GitHub Has a Permission Problem
games.greggman.com
games.greggman.com
But this tidbit struck me as hilariously out of touch:
> Let's imagine your bank let you sign in to 3rd party services in a similar manner. How many people would click through on "Let ACME corp act on your behalf on your Citibank Account". I think most people would be super scared of permissions like that. Instead they'd want very specific permission like, only permission to deposit money, or only permission to read the balance, or only permission to read transactions, etc...
It is so, so much worse than that. Most banks don’t even provide OAuth APIs, so to hack around this third parties just straight up ask for your bank username and bank password so that they can turn around and log into that site and scrape the HTML UIs that come back from logging in.
“I think most people would be super scared of that.” No doubt these people exist (hello!) but like, there’s a whole industry built around this.[1] Possibly the banking example is not the best piece of supporting evidence for the article’s claim.
It seems like there's a significant disconnect between what people believe is good security practice.
Bad cyber security is almost but not quite like sleeping around behind your partners back. If you get burned you both suffer.
I guess acceptance of that crazy scheme is regional thing. Paypal tried to pull that over here but they backed out after a week of extensive backlash. And EU mandates that banks provide APIs in PSD2 directive.
As far as I recall this article is accurate. They send two small amounts and ask you to type it in to confirm it came through.
https://www.paypal.com/au/smarthelp/article/how-do-i-confirm...
I kid you not, their own account linking flow used Plaid to collect my Chase(!) personal credentials and verify my Chase(!!!) personal account, within their own web UI while actively signed into my account.
Granted, there is capability in that UI to link any external account, so you can sign into other banks. But I mean come on...at least implement something secure for your own damn accounts!
(I'd love to know the reason, I'm sure someone here knows the details)
https://lolware.net/2016/11/17/requesting_bank_login.html
Everybody single person who provided feedback on this blog argued I was "being pedantic about nothing", "throwing your fedora at them", and even at American Express they took very seriously the "get your money back" angle but seemed confused as to why I didn't want to hand passwords out.
And then flies right back in once you report the fraud. The system works not by making it hard to steal money, but by making it easy to get back.
This is like credit cards... yes, a shady store can steal money from you.... but then you get it back and they go to jail.
In other countries the system works by making it hard to steal money: I'm in New Zealand, and you can't do really anything with my account number, except pay me. Direct debit does exist, but it's a lot harder to setup (I have to send the bank original signed documents if I want to setup a direct debit from my account) to the point that I think many people don't even use it.
I'd rather take the occasional having to wait a few days to sort out a fraud charge than have to be inconvenienced every time I want to send or receive money.
Bank of New Zealand online banking doesnt seem that inconvenient, or different, from the American system. add payee, enter amount, click pay then confirm.
https://www.bnz.co.nz/support/internet-banking/payments/addi...
In America this is so much more complicated. I have a hard time depositing money to my partner outside of my credit union’s calling hours, even though we literally share each other’s accounts.
Get yourself formally added as an authorized user of the account and you won’t have this problem anymore.
I'm looking at you, NZTA.
Can't wait for the PaymentsNZ [2] effort to be fully implemented and widely adopted, so I can finally use real APIs to access this data, with low privilege throwaway tokens.
The banks' suggestion? Close the account, open a new one, and never give anyone the account and routing numbers. Never write a check from that account. Use the bank's web site to initiate bill payments – they'll get checks from the bank's account.
You would report the fraud, and you would get your money back.
In the case of plaid almost every bank has somewhere in their terms of service that you are responsible for protecting your online banking password, and they are not liable if you have a loss as a result of a third party getting your password from you.
Which means if Plaid is a bad actor, or if they lose your password on accident, and your money is taken, the bank will disclaim all liability, and will not be obligated to make you whole.
So, while it might be easier for money to flow out of your account due to ACH fraud, it'll be a lot harder to get that money to come back if it's due to your own password handling mistakes.
Only half-correct if you're talking about SEPA. Legally, the customer has to fill out a "SEPA direct debit mandate" - but the company initiating the direct debit transfer only has to keep it on file.
I have a business account at my bank, I can theoretically file a direct debit for as much money as I want against any SEPA-reachable bank account (in practice, most banks including mine limit that amount until you can prove, e.g. via presenting a bill, that this is a correct amount) - but if someone disputes it or, worse, files a legal complaint that causes police to investigate and I can't produce that mandate signed/authorized by the customer, I'm in extremely hot water.
My only point is that on the payment side, the technology doesn't provide any security, but the legal framework does. But from the password management side, you're in a technology danger-zone for security, and the legal framework says "caveat emptor", so I think that one is the "worse" problem of the too.
But, I agree, the payment side should be improved
E.g. with e-Invoicing in Sweden, your electricity company, credit card company etc send the bill to your bank, it shows up as a PDF in your online banking, and you confirm or deny it there. If you want it to be auto-confirmed (e.g. utility bills), that's a setting on the bank end of things, not the utility end of things.
A more recent innovation is banks exposing this more directly to consumers. I can create a "payment request" in my banking app which generates an iDeal url which I can send by email/text/facebook/whatsapp/qr code/carrier pidgeon to someone who can then pay me. No exchange of account numbers required and the amount paid is deposited in your account within seconds.
So yes, an oauth-like flow definitely is the way to go. It's more secure and more convenient, which is a pretty unusual combination.
There's a time limit on this, though, right? So if you're not checking your account every N days, you could still get screwed?
For non-authorized transactions, you have 13 months to recover the money. Since it will have cleared after eight weeks, the whole procedure takes considerably longer and most bank employees will not be too familiar with it.
I had recently experienced that when somebody used my bank account to sign up for Netflix. I only caught it after three months (I mostly blame my bank for not providing a "new ACH transactions" report). Netflix wasn't helpful (and apparently has no interest in stopping this, their fraud detection allowed for creating an account with the legal name "f f", a German bank account and a none-German IP) and my bank immediately reversed the last two transactions (still within eight weeks window). The first one took about three months, but I don't know who or what was responsible for the delay.
You can still get ACH deposits. You can still use the bank's bill pay and they will send the payments over ACH (so you can push funds over ACH from the account). But someone else can't _pull_ funds over ACH from that account.
Certainly the banks I use have this as an option, and it's useful sometimes. As long as you remember and don't try to pull yourself from one of your other accounts, of course.
As a UK citizen who's lived in the states for the last 4 years, the permissions that Venmo and other financial apps require is even more horrifying than the rest of the US financial system ("tell us what tax you think that you owe, and if you're wrong, you go to prison" // "you have to build up credit in order to be able to afford anything - but if you ever fail to pay it off, you'll be in debt for the rest of your life").
https://bankovni-identita.cz/o-projektu/
Security of this project is anyone's guess. They certainly have a lot of flashy websites to lure people in, but actual documentation is behind a signup wall. Each bank will create its own independent IdP infrastructure, so this is gonna be a lot of fun for security researchers to be sure.
After this is done, it seems like I'll already be registered with 6 online IdPs (not all of these are banks) that will be able to identify me enough to allow online communication with the government services.
This proliferation of IdPs is getting quite scary...
I agree the way Plaid/Yodlee/etc ask for passwords is insane. I've "closed the tab" several times when I hit that. Just the other day I got asked for my bank passwords for a mortgage refinance. I refused and they said I could send them bank statements instead.
On the other hand, if I want to access a customer's CI pipeline there's no one at Semaphore I can email to find a more-secure workaround. I have to grant access to my whole Github account. As a freelancer with a lot of clients, that's a big problem for me.
This is the permission you grant apps using GitHub for SSO, that allows GitHub to know what account you're logged in as. The information itself is public (anyone could scrape it from your public GitHub profile); but the fact that you are logged into that account is not public.
If any website could ask GitHub "is the current user logged into GitHub right now, and if so, as what account", without the user's consent, then that'd be considered a CSRF fingerprinting/permacookie vulnerability in GitHub.
The “public” there is GitHub distinguishing which of the email addresses associated with your account it is exposing to the app. One of a GitHub account’s email addresses can be set to be publicly shown on your GitHub profile. Other email addresses can also be associated with your account (for login/recovery), but these are private. The permission only allows the app access to the public one, not the private one.
Really, it’s not the “email address” in the grant description that would properly be qualified by “private.” It’s the “your.”
But granting the app permission to know the logged-in GitHub user’s numeric ID, isn’t part of any of the permission scopes, but is instead the base permission the app gets when you click “Accept” on the app binding request. The only thing the “view your email address” permission allows is for the app to look up the primary public email address (if one exists!) for the GitHub account with the ID it now already knows, given a successful OAuth callback.
Technically, just having the GitHub ID is enough to SSO you against GitHub, in the oldschool OpenID sense of SSO (or to track you across the internet.) The implicit default scope of an app grant already breached the privacy of “your.” So the additional permission about emails doesn’t have to qualify anything, because it’s not giving anything still private away. It’s just protecting something actually public from being mapped to from the private credential the app, at that point, already has access to. It’s putting up a roadblock in one direction of a lookup that could be done entirely without the API (by scraping user’s profile pages for internal user IDs + email addresses, and building a table indexed by user ID.)
When my teammates asked me to provide internationalization support for all our projects via Crowdin, I gave them a detailed list of all the permissions Crowdin’s app requires to sync data back and forth via the GitHub integration. The answer from the product manager, —No way! Build that yourself. We are not giving full access to all our public and private repositories to a third-party company to have translation capabilities.— As a result, I spend a couple of weeks writing a custom Gettext parser to allow my teammates to provide translations via PO files.
Similarly, when my teammates wanted to use a popular CI/CD service called Travis CI, I also gave them a list of all the permissions required to offer most, if not all, their features. Again, a product manager told me to stop and use something that we could self-host, so I went with GitLab CI.
I could continue telling stories, but the point is, thanks to GitHub’s extreme and ambiguous API permissions, I can continue working at a bit company and earn a lot of money. Other people probably spend five minutes integrating third-party services they blindly trust and then move on to more exciting work. But as my father used to say, work to live, not the contrary, so if I can get FAANG money by writing simple programs to replicate what a SaaS has to offer, I feel accomplished and can move on with my life.
Thank you, GitHub, for creating an app integration experience so bad that I can keep my job.
Banking is a terrible example because it's literally how it works. Try to link a bank account to PayPal or TransferWise, they'll ask you your username and password for your online account to that bank, and the next screen asks for the verification text you got as they literally log in as you. And ACH, the system your employer uses to direct deposit your salary also allows for withdrawals.
Hopefully security is better where the author is writing from...
I don't remember having to do that for paypal. I do remember them asking for the routing and account number and that they asked me to verify the cash amount of a deposit they made in order to confirm the account.
I went through a similar procedure when I added my bank account as an external account to my E-trade account. I never had to provide my online banking credentials (though it was an option, I opted to verify deposit amounts instead).
When I see Plaid on something, I'm Noping out of there
Without repo-specicific permissions at least, it sort of requires me to have separate github accounts for personal stuff, work stuff, contract stuff (per client) etc, doesn't it?
Even if I'm willing to risk Some Serivce(tm) having write access to all my repos cause I want it for a personal project, I can't ethically give it access to work/client repos too.
And yet, I must. Or have a bunch of different accounts. Who can keep track of that? I think most people just end up, dangerously and arguably unethically, giving a service access to all their client/work projects, when they wanted it on only one of them.
In some cases github via Oauth or whatever is going on seems to give more granular access. I've seen it look entirely different (like entirely different screens) in different contexts I"m auth'ing some third party service. Maybe it's different historical APIs all still in use? I can't keep track of what's going on, it just all confuses me -- which makes it even harder to know if a service is asking for appropriate permissions or not, I'm not really sure what the possiblities are, they seem very inconsistent.
I swear I have seen flows that ask me to give them that, and don't let me even limit to certain organizations.
But I may be misunderstanding, for sure.
The real problem is that i just don't understand github's auth model for third-party api access. So I have trouble understanding what the possiblities are, what permissions I"m granting, and if they were the minimum permissions the app could have asked for or not. Every time I go through it, it seems to be different than the time before.
Ironically the newer apps system does have fine grained permissions, but seems more intrusive because of the strange wording
[2] https://github.community/t/why-does-this-forum-need-permissi...
Here's another GitHub forum thread asking about it:
https://github.community/t/enable-you-to-trigger-actions-in-...
A trivial wording change would go a long way toward fixing this problem. Unfortunately according to GitHub Support (post 15 in that thread) "The current wording is not considered a bug."
:-(
https://goo.gl/maps/Nbt1kNe4gZ8oyH1F8
It has been there for something like 10 years as far as I can tell and there are more than one (go up the hill and you'll see the others). It's pretty amazing that someone has taken what I would consider prime advertising space for privacy ads in the world's biggest city for ~10 years.
It's a meme (and a bit annoying when it's the only angle anyone takes on Japan), but Japan is indeed weird.
Having project-scoped tokens would open up GH as a storage layer for personal data apps as well. Like a bookmarking app that syncs to your GitHub.
1: https://docs.gitlab.com/ee/user/project/settings/project_acc...
You do NOT have to give access to your entire account/organization to a well-built app.
Their problem (refined permissions / permission to a single repo) can seemingly be solved by migrating to GitHub Apps but, at the time they launched, there was no way for them to ask for permission to a single repo.
So now there are two problems: - GitHub Apps is a bit of a mess in terms of user experience from both the product side and user-facing side - Forestry has probably looked at this problem and said “we will make more money by losing out on customers who don’t sign up due to code access vs spending months refactoring the core concepts of our product”.
Eventually, GitHub will become more strict in OAuth vs GHA and then become more strict with what it allows on its platform (similar to what Google has done with Chrome extensions recently).
But at the end of the day, GitHub probably doesn’t care THAT much. If you don’t agree with the permissions, don’t install the app and/or put pressure on the product to refine their permissions. It’s tough to know the lost revenue due to these issues so give them incentive to change.
Oauth is better than the previous state of the art (either app-specific passwords that can do anything you can do or else literally just your own username and password), but it has a huge UX problem around least privilege.
In general it's very opaque what the requested permissions can be used to do. Some companies get this pretty right but there are tons that don't.
Let's say the requested permission is very straightforward like "append rows to your existing spreadsheets". It's also generally impossible to grant access using oauth to just a subset of whatever resource it is, like only spreadsheets A, B, and C, but not X.
I wish sandstorm had caught on much bigger than it had, it brings a fine-tune grained capabilities-based auth system.
I stopped using Slackware when I got married / got a job / had kids, because debian made all my day to day management tasks easier and I no longer cared about knowing deep details about every single package that lived on my system.
I'll still install it and toy with it, but I'm not going to push my kids towards using a sandstorm word processor over google docs etc.
The author would probably have himself professionally disbarred if he knew what Disqus was doing with his blog. Which is why I think we should be more forgiving of mistakes than what his tone proposes. GitHub obviously has room to improve, but ultimately the system runs on trust, and sometimes the best we can do when it's violated is react to solve the problem and then write a postmortem.
If somebody wants to just shovel other organization's code into their silo then they are not incentivized to attack the current state of affairs; on the contrary, they are benefiting from them, why would they say anything at all?
> The author would probably have himself professionally disbarred if he knew what Disqus was doing with his blog.
I agree that we should be conscious of security in all things and apply universal standards but your comment comes off as a whataboutism and a discussion stopper.
We can and should address the security issues one by one. That a lot of things are broken does not mean we should throw our hands in the air and give up, no?
> With the help of GitHub’s GUI, any individual can make such changes to anyone’s codebase in under a minute.
Sigh, so yet again the load falls on the normal working programmers' free time. And yet again the effort is vastly underestimated. Sure it took 5-10 minutes (I doubt it took one, as article claims) this time but what about the next 50 times? The article even supports this:
> As more work was completed, it was apparent that the problem was bigger than we had initially realized.
I am glad several Googlers decided to help. I wish it happened more often with them and other corporations. The normal working programmers are overworked enough already.
So I'll always disagree that such initiatives must be in one's free time.
Guess I am only looking at this as a job now. I do want to work on certain things but nobody is willing to pay for them, AFAIK at least.
I'm on his side - I think the copy is bad - but he was pretty unhelpful in the thread and ended up getting it locked.
For me, this was a full stop dealbreaker. A work around was to create a separate GitHub org just to use with the dockerhub build service, but frankly that’s a terrible hack that just masks the larger problem.
I need to create repo specific tokens. If I integrate with some 3rd party CI tool, why must I grant access to all repos? Or can’t I grant read only instead of write and full control.
I have access to lots of repos and orgs, I don’t want to worry about everything getting hosed if a single token is compromised.
I also don’t like that for an org, I have to approve apps for anyone to use for anything. I’d like more fine grained controls to approve what they want to do, for the fewest repos necessary.
SaaS CI/CD permissions are a bit of a mess too; not sure what the ratio of blame on that is though TBH.
[0] https://en.wikipedia.org/wiki/Principle_of_least_privilege
Overbroad OAuth scopes are one example of this, yes. Here's another: consider all the dependencies you use in your applications as a developer. Any single one of those (perhaps hundreds of) dependencies can typically do anything you can do; it can rifle through your ~/.ssh directory looking for private keys, it can add stuff to your .bashrc, it can make arbitrary network connections, it can edit your browser settings. Likely most of them don't need to be able to do any of this. And yet that's what we accept in our computing environments, every single day.
Yes, it's incredibly dangerous.
Though MAC schemes in the Linux world are incredibly fragmented these days and containers have just made that worse.
Some day we'll move to capability based systems, and I hope this means we can finally ditch the false idea that you can enumerate all the bad programs, and write ones that never go wrong, nor get confused.
You an run it on a cheap server and get collaboration, wiki, tickets all packed into a single sqlite file. The single fossil executable has the server in it.
Sadly, integrations for workflows are another story yet to be written.
If you want to see another way to do it, check out the "guest pass" that Flickr lets you hand out... you can grant permission to read an otherwise private folder, and you can revoke it at any time, just like a read capability in a multilevel secure OS.
Then, when your devs log into whatever with GitHub, they're not forking over (access to) your org's source code to every random website.
I'm not just annoyed by the title. The "problems" are generally feature requests sold as bugs.
And it's compounded by many years of users being trained to blindly accept the "Authorize user to do X Y Z" prompts all over the Internet.
Parent seems to have confused "private" and "secret".
Given that private repositories used to be a paid-only feature and that gists as a feature haven't been substantially updated in the last 8 years, I'm not all that surprised that there isn't a "private" gist type.
https://docs.github.com/en/github/writing-on-github/creating...
> Secret gists don't show up in Discover and are not searchable. Secret gists aren't private. If you send the URL of a secret gist to a friend , they'll be able to see it. However, if someone you don't know discovers the URL, they'll also be able to see your gist. If you need to keep your code away from prying eyes, you may want to create a private repository instead.
The TL"TL;DR";DR is: "Thousands of developers are giving 3rd parties write access to their github repos (...) The tokens given to 3rd parties are just like passwords"