#461: Web NFC

Visit on Github.

Opened Dec 13, 2019

Hello TAG!

We’re excited to request another TAG review of Web NFC.

Web NFC aims to provide sites the ability to read and write to nearby NFC devices (e.g., tags and phones). The current scope is limited to NDEF, a lightweight binary message format, but the API is designed so that the feature set can be expanded in the future.

Further details:

You should also know that...

An TAG review has already been requested back in 2015 at https://github.com/w3ctag/design-reviews/issues/22. We're filing a new one because the API has changed a lot and requires a brand new review.

We'd prefer the TAG provide feedback as:

🐛 open issues in our GitHub repo for each point of feedback

Discussions

Discussed Jan 6, 2020 (See Github)

Dan: I'd like to see more disucssions of user stories in the explainer

David: I filed 2 issues on their repo... #478 & #482 - detailed algorithm thing about use of promises... other one was interaction with permissions stuff - changes required to permissions API spec... There is an example in the explainer that encourages bad practices... referenced 2 issues in permissions API spec - #189

Dan: reviewing the privacy & security self check response & privacy considerations section - they are really comprehensive. I'd like to see Lukasz's comments.

David: NFC seems less scary than USB - much simpler tech...

Ken: It's a way to store and read data -- there are other lower level commands, more in line with USB, but those aren't supported in WebNFC... Could be used for passports and things...

Dan: opportunities for unintentional use... - leakage of PII?

Ken: there are a lot of mitigations in the spec about that. If you want to make sure that people are not changing content - e.g. smart posters... people put a nother sticker on top... could send you to a malacious web site... apps should use some signatures...

Dan: is that discussed in the spec?

Ken: yes it's discussed in the spec though no special APi for adding the signatures...

Dan: any other implementations planned?

[...not at this time...]

Dan: there is in Safari a FIDO -related use cases for NFC... But currently orthagonal to this...

Ken: you could do a polyfill on top of webnfc potentially... One of things we're not exposing is access to the secure elements...

Dan: we should get some feedback from Tess maybe... just to see if there is any overlapping set of concerns that could be brought together.

Comment by @torgo Jan 6, 2020 (See Github)

@lknik can you have a look at this and feed back? ...both the answers to the security & privacy self check and the privacy & security consideration section?

Discussed Jan 13, 2020 (See Github)

Did not discuss; regrets from all assignees.

Discussed Jan 20, 2020 (See Github)

Dan: feels like our feedback has been taken on board... maybe close?

David: might be some things from the larger disucssion - Mozilla standards position, etc... Security & privacy concerns. Not sure how much it should be the TAG's job to dig into those.

Tess: has PING done a review? if there are outstanding privacy concerns we could ask them to do a review, or suggest that they ask PING to do a review.

David: i suspect not...

[linking these discussions in to our issue]

David: i have seen a concern that looked like "you can use NFC to do the same thing you can do with form posts and xhr..." i'm skeptical on pushing something back on something with security issues when those issues are common to other web technologies.

Dan: is writing to a NFC tag restricted to a domain?

David: is it more unexpected for the web to be able to write to an NFC tag?

Dan: we need ken to answer these..

Discussed Jan 20, 2020 (See Github)

Dan: it looks like Ken issued some changes to the explainer that addrressed some of my feedback from last time.

Moving this topic to breakout

Comment by @dbaron Jan 21, 2020 (See Github)

There's a discusion in mozilla/standards-positions#238 that seems likely to have some topics that are relevant here.

Comment by @beaufortfrancois Jan 21, 2020 (See Github)

For info, here's the blink-dev intent to experiment thread URL: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/8bsAd-PsdbA

Discussed Jan 27, 2020 (See Github)

Bumped.

Discussed Jan 27, 2020 (See Github)

Bumped 2 weeks.

Comment by @torgo Jan 27, 2020 (See Github)

I'm bumping this to our next issue week. Sorry the delay - we hope to get a resolution on this sooner than that.

Discussed Feb 10, 2020 (See Github)

David: I need to take another look at Maciej's comments.

Tess: Annevk's point in the last comment on Mozilla issue was great; it's not enough to enumerate threats and make sure there's flexibility to address them, need an affirmative belief thatsome kind of UI.... just paraphrasing, you should read it. Maybe worth reflecting in text for design principles doc? Might be worth getting something in the privacy and security self check?

David: Maybe I'll have time to look between now and plenary?

Tess: Maybe we should propose this breakout session be 24 hours later

Discussed Feb 17, 2020 (See Github)

David: We discussed possibly closing, and how we all have different analogies for it.

...And what happens if a user touches a web app and that web app wants to use webnfc, and what that looks like.

Kenneth: If the nfc tag triggers loading a web page, no special data passed through. Would then need to touch again to read the NFC tag.

Tess: Subsequent to breakout I commented on the issue, raising concerns about not knowing how to word the permission prompts for this to get meaningful consent from users. Subsequent conversation about that. A bit of pushback from one person who wants a rigorous description. I don't want to design a user study for him; I think we should be describing the relevant principles, ask people to do the work, and show their work. Though I'm not sure what to do with the thread at this point.

Hadley: I'm scanning the conversation -- looks reasonable. I think we can say thanks, we've done the bit under our remit, it's now up to you to design the thing. Perhaps we've been in loops where it wasn't clear what the role of the TAG was -- people feeling they need to iterate on the design with us until we can rubber-stamp it.

Tess: That's useful, still not quite sure how to get out of conversation. But I think you're right that confusion over role of TAG is involved here.

Alice: Worth thinking about which parts are meaningful -- I think motivated by unhappiness with the feedback -- but what can we do to be clearer -- are there other resources we can point to to explain when the prompt isn't good enough?

Hadley: design principles?

Tess: Some text (a little) in David's PR. Tried to link to resources I had at hand. I linked to workshop report from San Diego on permissions and one of the other artifacts from that (checklist).

Tess: I think we should add to design principles. I don't offhand have all the resources to point them at.

Alice: Can you describe why it's a bad prompt?

Tess: "The Website wants to send and receive info when you tap your phone on an NFC device". First, not clear that it's sending to/from the NFC device. What's the nature of the info? The yubikey example is interesting. Given the general nature of API, I don't know how to write text that makes threat/tradeoffs clear. I work in the space and understand the technology, so I think I could make an informed decision with a specific NFC device in my hand and I knew what was on it. But not knowing much about the device I wouldn't know what to do. But I"d want less knowledgeable users to understand this.

Hadley: Can we pull something out of ethical web principles? Ex:

Security and privacy are essential

We will write specs and build platforms in line with our responsibility to our users, knowing that we are making decisions that change their ability to protect their personal data. This data includes their conversations, their financial transactions and how they live their lives. We will start by creating web technologies that create as few risks as possible, and will make sure our users understand what they are risking in using our services.

Kenneth: Same problem with camera -- might pick up text.

Tess: Camera and microphone are interesting -- I think it's much clearer to an average user that camera takes in scene around you. Though might not realize how easy it is to find the location. But

Tess: I think Camera is a case where permissions well, there's a lot of nuance about what you're granting, but I think users can get the gist of it. Though I think David used geolocation as an example.

Kenneth: Yubikey is a special case; shouldn't have used NDEF for this.

Tess: Web is meant to be secure, though.

Peter: Sensitive stuff like credit cards and passports.

Kenneth: Those aren't over NDEF, though.

Tess: But Yubikey thing is the existence proof that hardware developers might expose that kind of information. I don't think it's fair to dismiss that as "they shouldn't have done that". If there's a fatal flaw like that, we should clearly identify it.

Kenneth: Also I think it's not exposed by all Yubikeys. Security issue here is with Yubikey; can already get this with any native app.

Hadley: (question)

Kenneth: If I tap my Android phone on an NFC tag that an app can't handle, Android will show the data in a native UI.

Tess: I don't think we should make that mistake on the web.

Peter: Difference between exposing info to person holding both devices versus to a website halfway round the world.

Tess: How to respond?

Alice: In terms of responding... might be worth raising the point about yubikey as an existence proof since I didn't see that there.

Hadley: Also something potentially ... might be jumping to conclusions based on previous examples... but we've run into cases where developers haven't thought about the difference between the web and the feature in the browser... Difference between not being able to specify UI makes this more complicated? If they feel comfortable with the risks in Chrome; it's another thing to say to other browsers that you'll feel comfortable with it as well. I think that dividing line isn't fully divided in this conversation.

Tess: Agree it's a useful line of questioning. Also, a more general concern, this is a specific case of it. More general concern is that hiding powerful features behind permission prompts is often not a good enough mitigation. There are tradeoffs not often looked at. Scary? Put it behind a permission prompt. But what you say when you prompt, how informed when say Allow, is relevant. But also permission fatigue, but if we keep prompting users, they're just trying to use the site, they'll just hit allow a bunch until it lets them do the thing. We should be careful adding permissions prompts because adding more increases chances of permissions fatigue. When I see new spec say "just put it behind a permission prompt". Given the cost of permission fatigue and the difficulty of designing a prompt, why do you think this in adequate mitigation? I think that conversation should happen more in other reviews as well. Sometimes there's pushback on how to word a permission prompt to do this that "UI is out of scope" ... some browsers may prompt, some may use engagement metric. True, but as a smell test... if you can't figure out what to say, that's a smell.

Tess: David, you and Dan had the conversation in the breakout, could you raise that example.

David: sure

Peter: OK, and I'll set a milestone for face-to-face and we can loop back and revie

Discussed Feb 17, 2020 (See Github)

David: referring to mozilla standards position disucssion... different mental models of what is going on here (and what a good analogy is)..

Dan: the use cases in the explainer are pretty clear...

David: what risks are there and how do you explain permissions to users?

Ken: the way I see it... everything is unencrypted... if you have access to the camera it's similar. the whole problem came up because yubico is exposing passwords..

David: passwords or one time codes?

Ken: by default it's one time codes but there is an advanced mode where you can create static password

David: one concern is that yubikey exposes one time codes which could be read by the web site.. other set of concerns are what the permissions around writing should be and whether it's possible to explain them to users... 3rd piece was : does it need some kind of permission around reading and how do you explain that?

Ken: there is a permission of using NFC as a whole... No specific permissions for writing... You can make it read only...

David: there are going to be some devices that aren't read only and therefore the page would have permission to write with them...

Ken: It needs to be focused, it needs to be unlocked (the phone), the user needs to be on the web page, it needs to be...

Dan: (raises scenarios about user touching an NFC tag which then loads a web app)

Dan: what are the abuse cases?

Dan: devices have NFC buttons and advertise NFC as a function --- users will begin to have some understanding of what NFC is similar to Bluetooth...

Dan: i guess the question is... we could close it and acknowledge that the debate is still going on elsewhere...

Dan: I will note that the MDN Developer Needs Assessment did indicate that web developers do want APIs that allow them to access device features.

Dan: propose closed?

David: i think it's reasonable. Tess may have opinions as well

Comment by @torgo Feb 18, 2020 (See Github)

We're proposing to close this issue, noting that the debate is going on elsehwere at this point regarding some of the privacy and permissions issues of the API. The API itself seems sound from a design perspective and I note that the authors have been responsive to TAG requests to expand the threats section under Security & Privacy.

Comment by @hober Feb 18, 2020 (See Github)

When a feature requires a permission prompt (because it's powerful), we have to be able to present the user with a clear, concise question. If we can't do that, we can't say the user meaningfully consented when they tap "allow". If we can't say we have meaningful consent from the user, it may be unsafe to expose the feature even behind a permission prompt.

I don't know how do this for something like NFC access, and neither the spec nor the explainer offer any guidance here.

Comment by @beaufortfrancois Feb 18, 2020 (See Github)

For info, Chrome uses prompt below.

example.com wants to send and receive info when you tap your phone on an NFC device

image

Source: https://web.dev/nfc/#security-and-permissions

Comment by @hober Feb 18, 2020 (See Github)

For info, Chrome uses prompt below.

example.com wants to send and receive info when you tap your phone on an NFC device

I think that's a great example of a prompt that inadequately helps the user meaningfully consent to the risks here.

Comment by @zolkis Feb 18, 2020 (See Github)

When a feature requires a permission prompt (because it's powerful), we have to be able to present the user with a clear, concise question. If we can't do that, we can't say the user meaningfully consented when they tap "allow". If we can't say we have meaningful consent from the user, it may be unsafe to expose the feature even behind a permission prompt.

Then likely there must exist a deterministic process which takes a permission prompt as input, and outputs whether it is a "clear, concise question", i.e. qualified or not. Otherwise anyone can say that nothing is safe, right? Any links to such a process? It can be review process, whatever, but itself is it adequately and consistently defined somewhere? Who can tell in objective manner what is adequate?

Comment by @hober Feb 18, 2020 (See Github)

Any links to such a process?

Well, to start, there's @npdoty's/@w3cping's excellent Adding another permission? A guide which came out of the W3C Workshop on Permissions and User Consent back in 2018. See also @dbaron's text in w3ctag/design-principles#155, specifically this bit:

We should not depend on asking the user for consent (via a permission prompt or other mechanism) if we don't have a way to express that request in a way that users will understand what is being requested and the main implications of giving their consent.

Comment by @zolkis Feb 18, 2020 (See Github)

@hober thanks for the links, the principle is understood and fine.

However, the guides and texts you cite are hardly enough deterministic, consistent and exact for the substantial claims drawn above (if based on them). Is there is enough information that 8 people out of 10 could give consistent (10% relative std deviation) ranking to any given permission currently implemented in the browsers? If there are no measurements on that, we don't have a consistent process.

With such substantial claims that a given feature should not be exposed even with permissions IMHO warrants a well defined, deterministic and specific process. If the links above qualify for that (they are good, and the most usable metrics I found are this flowchart and checklist), in particular, I am interested in

  • where exactly do the Web NFC permissions fail in the context given above
  • has Web NFC been given feedback about that and has it had the chance to implement those, and
  • in general is there a process of curating and improving a feature permission in order to pass a kind of certification for being "good enough permission"?

If issue discussions like this serve that purpose, then please be more specific about the subject of criticism and the preferred mitigations.

Comment by @hober Feb 18, 2020 (See Github)

I'm not proposing we write an algorithm that can be used to mechanically determine if a permission prompt is adequate. This is something that ultimately requires human discernment and judgment.

Comment by @dbaron Feb 18, 2020 (See Github)

It likely also involves actual studies of user understanding in the more borderline cases. But experienced user experience designers can likely predict the results of such studies correctly in many of the non-borderline cases.

Comment by @zolkis Feb 19, 2020 (See Github)

'm not proposing we write an algorithm that can be used to mechanically determine if a permission prompt is adequate. This is something that ultimately requires human discernment and judgment.

Right, but it has to be based on a clear and concise process, which I am begging to define in one place and which is applied to all permissions in the Web Platform in a documented way. Otherwise there will be too many subjective elements in such judgment and might prevent forming consensus on rational terms. And again, if the given link is that process, please be more specific about the concerns and what is expected.

When you say a prompt is not good enough, you should also be to explain why, in specific terms.

If the Web NFC spec is expected to give guidance on permission prompt text, that is fine, though I don't see how would that currently guarantee prompt quality passing the unspecified level of human discernment and judgement.

Comment by @dbaron Feb 19, 2020 (See Github)

We discussed this further in today's TAG call.

One thing we discussed a bit was the issue of Yubikeys exposing one-time-passwords via NDEF, originally raised in the Mozilla standards-positions issue. While you certainly could argue that Yubico shouldn't have exposed the user's one time passwords via NDEF, they have done so, and that they have done so is an existence proof for the problem that hardware vendors may not use NDEF the way you or I might think it should have been used. Given that traversing a link to a web page should generally be safe, we should consider the range of uses of NDEF when deciding how risky it is to expose NDEF to the web, and if we're going to ask users about it, what users would need to consent to.

Comment by @zolkis Feb 20, 2020 (See Github)

From the TAG meeting text,

still not quite sure how to get out of conversation

  • Make clear what exactly is considered wrong or lacking. Though the TAG discussion reveals some of that, they need some deciphering. A generic ("something wrong, go back to work") negative feedback is not very useful, as it will have solutions like "something fixed". Being specific in feedback would speed up convergence.
  • Make clear what are the expectations. A new section with guidance for permission texts? That is doable, but I am not sure what has been asked us to do and IMHO won't be a safety guarantee either.
  • Consistency about the expectations across similar APIs and sharing similar cases/best practices, or just suggestions. That would include making a clear, concise and consistent TAG process for evaluating permissions across the Web Platform.

While you certainly could argue that Yubico shouldn't have exposed the user's one time passwords via NDEF, they have done so, and that they have done so is an existence proof for the problem that hardware vendors may not use NDEF the way you or I might think it should have been used.

That is like not selling HW until you know what people are going to use it for. Of course things can be misused. We track that in the threats section. The Yubikey passwords have already been exposed for anyone to read, not only via Web NFC. Anyone includes web pages now, but only the ones that are secure, visible on top and have NFC permission from the user. However, the bigger problem is when the page with permission exposes the data to 3rd parties without the user knowing. That threat is not with Web NFC, since data ownership moved from Web NFC to the app, but belongs to the platform in general. Maybe we need a mechanism to contain data, track data origin and enforce policies across the lifetime of that data.

But for now, provided it is guidance on NFC permissions that has been asked by the TAG, I wonder if anyone have suggestions what to warn the user about. On writes, the warning could include a clause that NDEF is not safe and can be read by anyone. On reads, the warning could be that the data read is available to the app and the app can share it if has the permissions? (which is the case for every content API in the web). Then, there might be room for warning about different content types, if there is a similar practice done with other content APIs.

Comment by @dbaron Mar 4, 2020 (See Github)

@atanassov and I are looking at this in a breakout at our Wellington face-to-face.

We (the TAG as a whole) could probably have some further discussion to come up with some more specific advice, but building TAG consensus over that advice would likely take both (a) time and (b) data about the level of user understanding of existing permissions.

The Yubikey passwords have already been exposed for anyone to read, not only via Web NFC.

I think treating native applications that the user has chosen to install as "anyone" is misleading. Using a web app has much higher expectations of safety and privacy than installing a native app; see this recently added section to our design principles document on the expectation that visiting a web page is safe.

I suppose this is perhaps still on us to respond to try to provide more specific advice, although I think there are definitely limits to the level of detail we'd like to provide such advice. At some point we also need to figure out where the boundary is between the role of the TAG in providing advice versus the role of other browser vendors (some of whom have participants in the TAG) in exercising their right to not implement a specification because they don't trust its security or privacy.

Comment by @zolkis Mar 4, 2020 (See Github)

I think treating native applications that the user has chosen to install as "anyone" is misleading.

Not the app, but the media is exposed to anyone. The native (or web or HW) readers are just readers. Anyone can buy a reader, so yes, anyone can read an NDEF tag.

We could implement some special censorship for web readers, but we need heuristics for that. Moreover, we need tag unique identification and integrity, neither of which is guaranteed for NDEF tags.

So what can we do?

We could include permission UI recommendations in the spec, and also consider implementing a blacklisting mechanism like in Web Bluetooth. However, not sure how much would it solve, given the problems above (UID duplication/fakes and no integrity unless encrypted).

Comment by @annevk Mar 4, 2020 (See Github)

Anyone can buy a reader, so yes, anyone can read an NDEF tag.

I think this is misleading. It's much more likely for a "trusted" device with a browser to be near than literally anyone.

Discussed Mar 16, 2020 (See Github)

David: Was hoping to provide some more specific advice here but hadn't gotten to that yet.

Dan: Bump for next week then

Discussed Mar 23, 2020 (See Github)

David: bump a week?

Peter: 2 weeks

Comment by @torgo May 26, 2020 (See Github)

Just picking this one up in our virtual F2f. We're still concerned about the privacy issues here. Considering the widespread "gaming" of user permission (ref discussion in https://github.com/w3ctag/design-reviews/issues/337) it's not clear that putting something behind an additional permission prompt would be beneficial. Since writing seems to be the more dangerous operation would it make sense to split reading and writing? Do you have info on the potentially dangerous uses of NDEF reading - e.g. where it has been used to steal credentials, etc... - and if so do you have a mitigation strategy? Do you have data on what the range of activities that NDEF reading and writing is used for "in the wild"? Some of these activities might be more dangerous than others when you imagine a world where these are exposed to arbitrary web sites.

Comment by @zolkis May 26, 2020 (See Github)

We're still concerned about the privacy issues here.

That's included in your job, so it's fine :). Most NDEF use cases that are supported by this API include sharing a URL, a short text and eventually icons, which are meant to be publicly shared.

I understand Web APIs need to undergo more scrutiny than the native APIs they are based upon, but the API currently does not support the use cases based on more advanced communication options, which might impose threats that I feel are back-projected here. IMHO the current scoping makes Web NFC fairly secure and privacy-sensitive when compared to other Web APIs. For instance it's not even in the same ballpark as the Contacts API referred above.

Since writing seems to be the more dangerous operation

Mm, why is that? The threat with writing is overwriting non-protected NDEF tags by a web page when the user has it open, in focus and accepting the operation. If the user wants to do that operation, it's considered legitimate, since we cannot contact the tag's creator to ask for permission for modifying the tag's content (and this was never meant for NFC). NFC is just designed this way. NFC Forum added Signature records to protect content integrity. In addition, a tag can be made read-only so there is a hard mitigation available.

IMHO arguably the most dangerous privacy threat is figuring out the user's location if the tag's location is known and the page shares the fact of the reading operation of given tag id's (e.g. tags laid out as baits in order to localize users - though this is theoretic, I have not found documented uses of that yet - open to accept updates on that and include links -, and it's far easier to localize people by other means).

would it make sense to split reading and writing?

They are already split in separate objects and separate permissions could be applied (if that was meant). I don't think splitting reading and writing in different conformance classes would help with the existing threats.

In general, IMHO the conceivable threats and their mitigation are well documented in the spec, but of course we are welcoming reviews, additions, suggestions.

Discussed Jun 22, 2020 (See Github)

Peter: marked proposed closing..

Dan: (reading issue replies) ...

David: what people use writable ones for in the wild... what is the existing set of writable vs

Ken: you can make them read-only and that's what would use in a commercial deployment

... when you buy NFC tags they are read/write... but they can be made read-only (and then no way to go back)

Dan: Reasonably happy with the answers. Should be more discussion in the privacy section.

David: the other concern we have is whether the permission prompts are adequate. The concern is that there are a set of things out there that support reading and writing NDEF - some of those are things like Yubikeys (which you can read the current one-time-code from). Yubikeys themselves are blocked but what about other Yubikey-like things. Not clear that this explains those risks to the user in a way that is adequate. We've disagreed on this but we should mention that again if we're going to close it.

Dan: we should be erring on the side of more rigorous prompts.

Ken: you can prompt each time... i discussed that with the chrome team they said they didn't want to do that. Whenever it's reading you see a prompt... So we have a semi-permanent prompt.

David: the other question is whether more prompts would help. The underlying concern is you don't know what the devices are that support NFC so you can't explain the risk to an end user in a prompt.

Ken: like that for many things

David: the assumption on native is you're trusting the app but on the web you can go visit a web site and there is not the same assumption of trust.

Ken: examples of linux system ...

Ken: i was suggesting an active "scanning" visual indication that something is going on and is temporary. Very user-visible. And at any time you can hit cancel. I like that approach. I see a use case where this won't be useful - scanning multiple - and that might require a different prompt. Having said that NDEF is inherently supposed to be like post-it notes... so this issue will always be there...

Rossen: seems like if we need to be prescriptive about UI ...

(discussion of Dan's proposed comment)

David: distinction from camera API is that yes, there are security risks to a photo with your environment, but it's also not a distinction about technical expertise where users who aren't technical enough to know what NFC is don't understand what data are sent.

Rossen: I keep running thru this example in my head of what prompting could look like - some parallels with geoloc - where you are still providing personal info ... The common UI is "the web site wants to use this service . Allow/disallow" one time decision... If I draw a parallel with this one the problem is that geoloc data is very uniform. And the contract between you and that website is a ... obviously the data is changing but the same kind of data. Here, the data could be anything.

Ken: but you have to physically take the phone and scan something.

Rossen: i could boobytrap my store with all kinds of tags.

Ken: but you need to be within 5cm.. the phone needs to be unlocked. the screen needs to be on. Sometimes with geoloc you have the option of "always allow for this website" - so now if similar pattern was adopted for WebNFC that to me sounds concerning. Is this a good parallel to draw?

Ken: to come back to my idea of indicator - the example of how that is done is to say "now I am scanning" and you can't do anything on your phone until that is scanned. So that mitigates this idea - it can't be scanning in the background. In some cases (e.g. a game with lots of tags) it can't work... but there can be another option for that.

Dan: I propose I leave this comment and we talk about closing at the plenary. We can leave further comments, and we might have to mark as closed with no consensus

Comment by @torgo Jun 22, 2020 (See Github)

Ok @zolkis that's good info. On the risks of writing to NFC tags I think we are most concerned about them being used a a vector for phishing / spam/ fraud, etc... We would appreciate the spec having some more detailed write-up on these considerations and mitigations (e.g. "only use read-only tags in a commercial / public service setting" or similar wording).

On prompting: we are still uncomfortable with the approach being taken to user prompts. We don't think the current approach is adequate. We understand that there was an alternative proposal being floated for non-interruptive visual indication of scanning that would make it obvious to the end-user when the NFC scanning is happening and give the user the opportunity to cancel. That sounds like it might be a better approach - especially considering the different trust expectation of users for web pages. Ideally the user would be shown something that indicates to them what data is being exchanged. (Similar to how the bluetooth scanning API would show what bluetooth devices are around you as part of a privacy prompt.)

Comment by @kenchris Jun 22, 2020 (See Github)

^ above we are not talking about a persistent notification, but instead a modal indicator that stays visible until a tag is scanned and then disables scanning

image

Option would be that the scan done would allow to easily allow a second scan (optional).

image

This is also the approach taken by default on iOS (not "background scan").

Comment by @dbaron Jun 23, 2020 (See Github)

I should also clarify that I think there's disagreement within the TAG on what the problems with the prompts for NFC permission are. I think the problems are deeper: it's hard to explain to a user what reading and writing NFC tags means, since the user doesn't know what information is exposed by reading NFC tags (whether it identifies them uniquely, identifies their location, says they have a particular disease, or shares one of their second-factor authentication tokens) or by writing them, and this varies widely by what NFC tags are being read/written. Given that the protocol itself wasn't designed with the explicit intention of being exposed to arbitrary web content, it's not clear that the security tradeoffs made by the designers of devices that support NFC's NDEF messages are appropriate for exposing them to Web content. (The Yubikey example clearly demonstrates that this is a problem, but it doesn't tell us the scope of the problem.)

Comment by @zolkis Jun 24, 2020 (See Github)

User prompting is a policy and the spec could recommend using non-interruptive visual indications of cancellable operations as the preferred policy. However, browsers may have reasons to use other prompting policies. What the spec needs to ensure is clarity about the subject of the policy, i.e. what authorization is needed for what operations.

the user doesn't know what information is exposed by reading NFC tags

When reading a simple NFC tag (as exposed by this API), information flow is from the NFC tag to the device. The user indeed does not know what information is on the NFC tag, but likely wants to know, which is the main reason the user engages into reading the tag. There is no information exposed about the user by reading NFC tags. User location could be determined indirectly if the tag location was known and the tag directs the user to a page that identifies the tag, therefore indirectly identifies the location of the read. However, that page cannot be opened if the user does not approve it. No, reading a tag cannot identify the user. No, reading a tag cannot reveal a particular disease of the user. No, reading a tag cannot share one of their second-factor authentication tokens. There is an infinitum of other things that reading a tag cannot share about the user. These fears and arguments are unfounded.

We keep going in a loop, but fine, spin it once more. The protocol itself was designed to expose the information on the NFC tags (with this API), and also to write information. Not unlike a file API on a physical medium. These are ubiquitous technologies we cannot prevent from existing and are becoming more and more part of everyday life, including the web - we should rather strive to expose them in the most secure way possible, both by scoping and by security hardening.

The question is not whether exposing NFC to web pages is a good idea (the growing number of use cases signals it is a good idea), but how to do it properly.

Discussed Jun 29, 2020 (See Github)

Dan: Whats the latest?

Ken: improved on the security section of the spec.

[reviewing latest comment from Zoltan]

David: I think he said "no x cannot happen" a bunch of times to things that can happen.

Tess: I agree with David.

Dan: I agree.

[trying to find a way forward...]

Dan: left a comment and bumped - let's try to resolve by next week

Comment by @torgo Jun 29, 2020 (See Github)

User prompting is a policy and the spec could recommend using non-interruptive visual indications of cancellable operations as the preferred policy.

This sounds like a good idea. It's within the of specs to provide non-normative best practices.

On the other issues, I understand that you feel that the fears and arguments are unfounded but that is not generally recognised and many members of the TAG (myself included) do have strong concerns about the privacy issues. It would be more helpful if the spec could take these concerns seriously and present some mitigation strategy.

At this point, we don't have positive consensus on this. I think with a little more consideration in the document regarding these possible abuse cases and the mitigations thereof we would be much more comfortable.

Comment by @dbaron Jun 29, 2020 (See Github)

The user indeed does not know what information is on the NFC tag, but likely wants to know, which is the main reason the user engages into reading the tag.

The user may want to know something about what's on the tag, but they might not know how much information is on it or want to share all of it with the site. Let's consider the example of airline boarding passes -- they have information that's currently on barcodes, but could plausibly be an NFC tag rather than a barcode. Travelers are sometimes surprised by the amount of information in the barcode on the boarding pass. I think it generally contains enough information for somebody in possession of the boarding pass to go to the airline website and modify the reservation (e.g., change or cancel the remaining flights). Somebody scanning the barcode (or tag) in order to check their flight's status might not expect to be giving away that amount of information. (This is a specific example of the "hard to explain to a user" problem in https://github.com/w3ctag/design-reviews/issues/461#issuecomment-648471296 .)

No, reading a tag cannot identify the user.

What if it's an NFC tag on a conference badge or a boarding pass? Or, as you mentioned, a tag with a known location, which could reduce the potential set of users to a small set (perhaps not of size 1), which is relatively close to identifying the user.

No, reading a tag cannot reveal a particular disease of the user.

So I can come up with a straightforward examples of this for bluetooth scanning: some modern glucose meters support bluetooth for transfer of data, so if a bluetooth scan identifies a glucose meter nearby, it would suggest that the user (or a member of their family) is likely to have diabetes.

Insofar as NFC becomes used within hospital settings, within medical practices, or on medical devices, it seems like this might become possible for NFC as well.

No, reading a tag cannot share one of their second-factor authentication tokens.

There's a discussion of this exact attack starting at https://github.com/mozilla/standards-positions/issues/238#issuecomment-578457411 . I believe that discussion led to the one known device where it happens being blocklisted from WebNFC, but that doesn't guarantee that it's the only device with that problem.

Comment by @reillyeon Jun 29, 2020 (See Github)

I think the comparison to barcodes is appropriate because NFC tags are another non-human-readable method of exchanging data and sharing them can have unforeseen privacy and security implications. The WebNFC specification should explain the potential hazards and suggest mitigations such as block lists and user education.

The specification section on fingerprinting and data collection is a start but could be expanded with suggestions from the TAG.

Comment by @zolkis Jun 30, 2020 (See Github)

I think with a little more consideration in the document regarding these possible abuse cases and the mitigations thereof we would be much more comfortable.

If the suggestion is to improve the security section, we're all ears. If there are threats that are not covered in the security section, please file issues, or formulate the concerns in a clear way so that we could file issues (the TAG is okay to just say "more work needed on this" - but needs to be specific enough).

So far I could decipher the following:

  • I got that we should include guidance about possible and preferred prompting policies (thanks @torgo)
  • looking at the other concerns in this thread (thanks @dbaron), looks like the TAG would feel more comfortable if there was a "peek" functionality to NFC content before sharing with the site; that is, a prompt (if there is any :) ), could show information like what type of tag it is, what type of content is has, and eventually a part of the content if it is text (with an option to show all). That would make the prompt an NFC application itself, but that's before the content reaches the web page
  • block lists are an answer to known threats and are needed as such, but they are by no means a guarantee against other possible misuses; therefore "user education" is a must, which the spec has been trying to do. If you feel something is missing in that regards, please tell.

On the other hand, there are uses that should not raise more concern for NFC than they (don't) raise elsewhere. For instance, if someone wants to share a one time password by NFC, it should not raise more concerns than writing it on a piece of paper, barcodes, or sending it by SMS, email, etc. Users should be able to share content they want. Does the TAG want a policy that NFC implementations look into the user data and try to figure out in the best interest of the user, if the user action is good for the user? Wouldn't that raise privacy questions? Where is the thin line?

Discussed Jul 13, 2020 (See Github)

Dan: i propose we close this as the webnfc spec has taken into account.

David: The thing we weren't decided on last time was what we'd say when we closed it.

Dan: I suggest "We acknowledge the work the spec authors have done to mitigate against the issues we have raised and while we believe privacy issues still exist, we think it's now up to the working group to address these issues. Hence we're planning to close this."

David: I think a different approach would be a different spec that had devices more explicitly opt in to being on the web gave more info to the user agent about what nfc is doing.

Tess: Looks good to me

Comment by @torgo Jul 13, 2020 (See Github)

We acknowledge the work the spec authors have done to mitigate against the issues we have raised and while we believe privacy issues still exist, we think it's now up to the working group to address these issues. Hence we're planning to close this.

Comment by @dbaron Jul 15, 2020 (See Github)

One further note based on the TAG's discussion today: different people have different opinions about the risks of Web NFC.

I think at least some of those concerns would be alleviated by some mechanism that showed that the device had opted in to being accessed by Web content. (For example, if it were a variant of NDEF, or a different NDEF tag type, or basically any other mechanism that would not work on existing devices and thus where the device maker needed to do something to opt in to being read and written by web content.) It's further possible that additional concerns might be addressed by additional information carried through that mechanism that could be used when asking the user for permission, but that's a lot more speculative.

That said, we agreed that, despite that we have disagreement within the TAG, we agreed to close this issue as @torgo mentioned 37 hours ago.