Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PKCE Chosen Challenge Attacks #41

Open
tlodderstedt opened this issue Dec 15, 2018 · 8 comments
Open

PKCE Chosen Challenge Attacks #41

tlodderstedt opened this issue Dec 15, 2018 · 8 comments
Assignees

Comments

@tlodderstedt
Copy link
Owner

tlodderstedt commented Dec 15, 2018

Attacker chooses PKCE verifier and obtains code through leakage (referrer etc)

  1. attacker impersonates legit client (works for public clients only)
  2. attacker abuses legit client (e.g. payment initiation issue)

options:

  • invalidate code after exchange attempt with wrong PKCE verifier (similar to RT rotation and replay detection)
  • requires cooperation of "client under attack"
  • requires AS to enforce PKCE challenge for every authorization request (!)
@tlodderstedt tlodderstedt changed the title invalidate code after exchange attempt with wrong PKCE verfier PKCE Chosen Challenge Attacks Dec 20, 2018
@tlodderstedt tlodderstedt added -12 and removed -12 labels Dec 20, 2018
@tlodderstedt tlodderstedt added this to the -12 milestone Dec 20, 2018
@tlodderstedt
Copy link
Owner Author

basiert auf FAPI-Analyse der Uni Stuttgart - wird beim OSW noch mal diskutiert werden

@tlodderstedt tlodderstedt modified the milestones: -12, -13 Feb 25, 2019
@danielfett
Copy link
Collaborator

This can also be used against a confidential client and when JAR/JARM are used. There is currently no good defense if attacker A3 is active...

@danielfett danielfett removed this from the -13 milestone Jul 5, 2019
@tlodderstedt
Copy link
Owner Author

The sequence diagram is very helpful! How is the code supposed to leak?

@danielfett
Copy link
Collaborator

See Attacker model A3: (A3) Attackers that can read, but not modify, the contents of the authorization response (i.e., the authorization response can leak to an attacker).
Examples for such attacks include open redirector attacks, problems existing on mobile operating systems (where different apps can register themselves on the same URI), so-called mix-up attacks, where the client is tricked into sending credentials to a attacker-controlled AS, and the fact that URLs are often stored/logged by browsers (history), proxy servers, and operating systems.

@tlodderstedt
Copy link
Owner Author

Essentially you are saying client and do not fully implement the recommendations given in the BCP (redirect matching, AS binding, ...), right?

What options for detection do we have? just the failed attempt to exchange the code?

@danielfett
Copy link
Collaborator

Something like that, or a leak on a proxy or in a mobile OS.

Only good detection option I can come up with: The AS needs to decline Authz-Requests if they do not come from one of the clients URLs (by opportunistically checking Origin or Referer headers). This would, however, be a completely new concept. It would be similar to redirect URIs, including registering etc.
Alternative: Token Binding in the browser or something with PostMessage communication.

@tlodderstedt
Copy link
Owner Author

I think refer headers are not a bad choice. Assuming the attacker does not control the victims device, they may at least function as a good hint that something is going wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants