-
Notifications
You must be signed in to change notification settings - Fork 67
Security review #22
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
Comments
Thank you for the review, Nathan. I will update the spec considering the comments and scenarios.
|
@ngparker Should we require a secure context? The Secure Contexts spec defines a set of requirements that addresses some of your concerns that are more generic in nature. |
#22: addressed review comments, added security threats
Regarding parsing JSON. That will not be done using eval but using the JSON.parse algorithm, which is considered safe. http://www.ecma-international.org/ecma-262/6.0/#sec-json.parse The result will be returned in a dictionary. Does this solve your worries @ngparker ? |
Hi,
In my opinion, you have such risk with an ordinary NFC tag: So, for Web NFC, why do we want to prevent something that is in fact possible with any Android phone? Regards |
I am not sure how much of an issue that actually is. Generally loading web sites is not dangerous due to the sandbox of the web, but you can of course encode specific URLs like ?location=showonsecondstreet and that way somehow track where the user is, but it might not really be a big issue. Actually as Android can already launch the browser for URLs then it makes little sense for this spec to conflict with it and try to do the same. On the other hand it would be nicer to actually launch the site and then somehow still be able to get the info read from the NFC from the site, a bit like Web Bluetooth discussed having the navigator.bluetooth.referringDevice when launched from a bluetooth beacon. |
SWs are not supported
Done
Read and write are treated separately
Done, Feature is HTTPS only
Done
Done: https://w3c.github.io/web-nfc/#dfn-obtain-reading-permission
Not specced
Done, this is using https://infra.spec.whatwg.org/#parse-json-from-bytes - see https://w3c.github.io/web-nfc/#the-ndef-parsing-algorithm
Not done, filed #208
NDEF content should always be treated as not-trusted, and the API allows you to easily make sure that you only get content that was written by a specific domain (like your own)
URLs, strings and JSON is already validated by platform parsing rules (as defined in INFRA spec etc). If custom binary data is written, that can only be understood if you know how it was written, so the authors would need to do their own validation.
That is outside of the NFC spec, as that is handled at platform level, for instance Android |
[Intro: I am Nathan Parker of the Google Chrome Security Team]
I have some question and comments on the spec, and one general concern which is described in the first security scenario below. I look forward to your responses.
Questions
Comments
Security scenarios to address
Some potential directions to take this: Suggest rules for handling that payload safely, provide best-practice methods for doing so, provide a sanitization/validation function. The webapp’s server could even cryptographically sign a payload before writing it to a tag so the contents could later be verified.
The text was updated successfully, but these errors were encountered: