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

API Key should not be passed as a parameter #1349

Closed
1 task done
philippeluickx opened this issue Jul 29, 2016 · 11 comments
Closed
1 task done

API Key should not be passed as a parameter #1349

philippeluickx opened this issue Jul 29, 2016 · 11 comments
Assignees

Comments

@philippeluickx
Copy link
Contributor

philippeluickx commented Jul 29, 2016

Adding keys in URL is not a safe practice. It stays in (browser) history and call logs. (It is secured though: https://groups.google.com/forum/#!forum/api-craft)
Better option is to pass the key in the header of the requests, e.g. authentication header.

edit: found that URLs are secure, but still best practice to not include sensitive data in URLs

Edited by bajiat:

Usernames, passwords, session tokens, and API keys should not appear in the URL, as this can be captured in web server logs, which makes them intrinsically valuable.
NOT OK:
https://example.com/controller/action?apiKey=a53f435643de32 (API Key in URL)
Source: https://www.owasp.org/index.php/REST_Security_Cheat_Sheet

Definition of done:

  • Remove instruction for passing API key in URL
@bajiat
Copy link
Contributor

bajiat commented Aug 1, 2016

@philippeluickx Where and what kind of change are you proposing/expecting?

@philippeluickx
Copy link
Contributor Author

@bajiat Common practice is to use HTTP headers for authentication. Changes should be minimal to implement this.
E.g. http://code.tutsplus.com/tutorials/http-headers-for-dummies--net-8039

@bajiat
Copy link
Contributor

bajiat commented Aug 11, 2016

@philippeluickx Still unclear about the impact about this issue. Where in the UI does this occur?

@bajiat bajiat added the icebox label Aug 11, 2016
@philippeluickx
Copy link
Contributor Author

Impact would be how we pass information to the developer (user) of an API. Otherwise no impact in UI.
The effect is mainly in how calls are made.

@frenchbread
Copy link
Contributor

This approach is implemented here.

@philippeluickx
Copy link
Contributor Author

@frenchbread so do we have multiple options (and parameter is the default) or is this something new?

@frenchbread
Copy link
Contributor

@philippeluickx Did not really got your question.

Meteor's HTTP.GET method takes options such as headers, parameters etc. Documented here. So we could either pass credentials as headers or as a parameters.

@philippeluickx
Copy link
Contributor Author

Ok, right. So you basically mean that if we want to implement using Headers instead of parameters, this is pretty standard behaviour?

@frenchbread
Copy link
Contributor

@philippeluickx Yep.

@jykae jykae self-assigned this Nov 18, 2016
@jykae jykae added in progress and removed backlog labels Nov 18, 2016
@jykae
Copy link
Contributor

jykae commented Nov 18, 2016

@philippeluickx If we want really be secure about this we could set "pass API key header" as default, otherwise Umbrella accepts both anyway. What you think?
nayttokuva 2016-11-18 kello 10 16 45

@philippeluickx
Copy link
Contributor Author

@jykae Sounds good to me. Default to the more safe behavior, but leave the other options open.

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

No branches or pull requests

5 participants