CSRF in Doorkeeper OAuth2 gem
homakov.blogspot.com
homakov.blogspot.com
Example:
I open a new tab with example.com, and with this a new session would be created which only contains data relevant to example.com. Anything I open later on in this tab won't see anything else. I can always open link in a new tab to start a "relevant" session (though that would require browser that can work with tabs, i.e. not Chrome).
You can use multiple profiles in Firefox. There is even an addon to make the switch easy: https://addons.mozilla.org/en-us/firefox/addon/profileswitch....
It's the simultaneous different 'users' (ie, cookie stores, mostly) in different windows that is exciting to me.
It lets you have different users in different windows simultaneously, or it makes you switch the entire environment all together?
Thanks!
You can set this up easily in Firefox [1] and Chrome [2]. It will break a handful of things, for example some sites embed comments from facebook, disqus, google+ etc. So for example when you visit www.youtube.com you won't be able to comment, as comments are in iframe loaded from plus.google.com which you can't log into without third party cookies enabled.
IMHO this is no great loss, and I block third party cookies all the time.
Of course, it's still possible to do certain attacks by redirecting the entire browser window or opening a popup window.
[1] https://support.mozilla.org/en-US/kb/disable-third-party-coo... [2] https://support.google.com/chrome/answer/95647?hl=en-GB
In all seriousness I blocked Third Party Cookies in Chrome and never looked back. Nothing of value was lost.
If anyone is interested, here is a much more fleshed out description of what a next generation browser could have: http://benjamin-meyer.blogspot.com/2009/08/next-generation-d... If a company out there is looking to see some browser R&D work done send me an email.
For some bookmarks/history and window/tab management I recommend checking old Opera (<=12). I'd argue it's still the best browser when it comes to UI/UX, unfortunately it's dead[1] and not really usable nowadays. For no-url experience, see Yandex Alpha[2].
1. there's an open source project to get that feel back http://otter-browser.org/ (not quite possible without touching the Blink)
Unfortunately (or fortunately depending on how you look at it) it isn't 2004 where almost no browser development was occurring and you could have something "new" like Firefox come to light and grow quickly with very little features against almost no competition. These days you have many large companies funding development teams to keep what we have today working and make marginally better each day. To make a new browser you can't just take Chrome and tack on a tiny tweak you need step changes. That is what my 2009 article was about and with a few more years of thought and experienced that is what I have been messing around with lately, making a browser where users abandon Chrome/FireFox/IE not because it is a tiny bit better because it is so better it isn't about switching, but about moving to a different product.
However, given that FF doesn't have sandboxes and SOP is (AFAIK) the main isolation system, I wonder whether it's possible for one origin to somehow sniff the presence of different sessions in the same client via, say, some JS info leak.
https://ffdevtools.uservoice.com/forums/246087-firefox-devel...
Existing solutions are either lacking or way too difficult to operate.
Give Netsparker[1] a go.. couldn't get much easier then this!
Seriously, the solution isn't better scanners or better tests, it's better languages. Make whether something is taking a potentially-destructive action part of its type, and then the compiler ensures that all such routes are appropriately protected; you can do this today in e.g. Spray (which I'm using in production, so this is not some ivory-tower theoretical solution).
Most times I'm aware of a site being hacked it's been through a hole in their application code, not the stack they're running on top of.
Most vulnerabilities do not derive from a single faulty tool or framework, but the incorrect combination of several (faulty or not!) tools over a sufficiently large attack surface.
How often are security flaws a subtle, complex thing that couldn't have been caught by a sensible type system? Almost all of the flaws we hear about, at least here, are the really simple dumb mistakes that a better language absolutely would have caught.
I would like to experience the next problem, please. If only for variety's sake.
But you don't get a lot of web application security advantages when you compare, say, Python and Java.
Of course, a very weak type system like PHP's can definitely introduce additional security flaws.
You can't accidentally forget to validate form parameters. It won't compile. This is pretty easy to do in Java. On the weaker side, I would assume php and python have something like perl's taint mode. It's such a simple thing and it avoids so many xss problems.
Better typing can help, and Ruby programs are more likely to be "stringly typed" than Haskell programs in practice - but the difference is a lot more subtle than one might expect.
[0]
Unfortunately, there is a very idealistic drive to feature-creep penetration testing tools away from "useful when used by a professional" to "half as useful when used by anybody and full of false positives."
The real solution is not more or better security software, but rather more secure coding practices. People generally don't accept this idea, but the state of software security is such a moving target that no amount of automation short of strong AI will find every bug. The onus is on developer education.
Where I work we have a desire for both.
We want developers to be able to scan their own code -- preferably automatically as part of a CI process -- for things that are clearly wrong, without needing to be appsec experts, and clear out a lot of the low-level brush.
We also want complex tools that are used by appsec to be able to do their jobs faster.
This is timely since I'm about to do a search for tools for this. I'd love, for example, a way to see the permissions for all lines returned by "rake routes", whether those are resolved by CanCan or where CSRF is disabled or whether it's been overruled by some skip_authorization_check.
I already unsuccessfully searched for a XKCD treatment.
Something I can forward to non-devs not written at dev level. Also no videos (who has time for that?). It sounds like a graphics arts type project, like a xkcd topic, so I guess something like that is what I'm looking for.
The wiki explanation is pretty good, just curious if anyone has anything better for non-technical-ish people.
It's slightly harder to exploit, as the attacker can't just send you a link to facebook.com, but they can send you a link to example.com which has the form and uses JavaScript to submit the form.
<script>document.forms[0].submit();</script>
(The above code may contain bugs.)
Useful CSRF exploits depend on the server to trust session data to authenticate client actions. OAuth2 is designed for allowing external (third-party) applications to communicate with you. Cross-site requests are an expectation in OAuth2. If you ignore the spec and skip proper authentication, you're in a bad spot anyway.
[1] https://tools.ietf.org/html/rfc6749 (page 37 & 38)
They all let you approve if you are already logged in.
That said, I agree that some of the giants are fine with using cookies for auth in OAuth2. And while that indicates that this is a possible use case, OAuth2 is capable of being used in many ways and Digital Ocean's usage still doesn't make much sense.
When the user is already logged in via a cookie set by the authentication system (i.e. an existing valid session), they don't get prompted for a password again; the authentication system will simply redirect to the OAuth2 request url. The typical OAuth2 implementations shouldn't be reading the authentication cookies directly.
The "password flow" in OAuth2 is really a special case for those who want to bypass the separate authentication system and use OAuth2 directly for both authentication and authorization.
> According to the OAuth2 spec[1], username and password are REQUIRED
> fields. Allowing clients to generate tokens based off of cookies is
> reckless.
It's possible I'm not understanding you correctly, but the section of the spec
to which you linked is describing the "Resource Owner Password Credentials
Grant", just one _possible_ flow for requesting an access token. In that same
section the spec reads: > The authorization server should take special care when enabling this
> grant type and only allow it when other flows are not viable.
(read that section here: https://tools.ietf.org/html/rfc6749#section-4.3)If you read the authorization grant overview section (https://tools.ietf.org/html/rfc6749#section-1.3), you'll see that the spec also defines an "Authorization Code" flow (https://tools.ietf.org/html/rfc6749#section-1.3.1) – this is what most sites implement.
Also worth reading is the section of the spec dedicated to security considerations (https://tools.ietf.org/html/rfc6749#section-10). There is an entire subsection regarding the password authentication flow you're referencing. Choice excerpts:
> This grant type carries a higher risk than other grant types because it
> maintains the password anti-pattern this protocol seeks to avoid. The
> client could abuse the password, or the password could unintentionally be
> disclosed to an attacker (e.g., via log files or other records kept by
> the client).
> The authorization server and client SHOULD minimize use of this grant
> type and utilize other grant types whenever possible.https://github.com/doorkeeper-gem/doorkeeper/wiki/authorizat...
I don't see a way to get the access token without having the client ID and client secret.
That being said, this one is pretty bad.
1) A general law, rule, principle, or criterion by which something is judged 2) A collection or list of sacred books accepted as genuine
(http://www.oxforddictionaries.com/definition/english/canon)