NFC while phone locked: what's the actual danger?

Search This thread

zequav

Senior Member
Aug 14, 2011
268
105
I was wondering (like many did before me, it seems) why the hell I needed to unlock my phone to change profiles by NFC, when it's way more convenient to simply touch my trouser pocket with the NFC token I have in my car to toggle +bluetooth/+data/-wifi, or simply leave the phone over the NFC sticker on my desk I when I arrive at work to do the opposite (-bluetooth/-data/+wifi).

I searched gerrit in case anyone was working on it and saw this:

http://review.cyanogenmod.org/#/c/21785/

so we won't see it in CM, it seems :(

Now, what's the worse thing that could happen if NFC is enabled at all times? When I swipe an unknown NFC tag the phone does nothing (besides telling me).

I decided to compile my own CM10 KANGs from now on with a patched NfcService.java (running great right now), but I'd like to know of any vulnerability I might have overlooked.
 

adrynalyne

Inactive Recognized Developer
Dec 13, 2008
10,950
6,471
I was wondering (like many did before me, it seems) why the hell I needed to unlock my phone to change profiles by NFC, when it's way more convenient to simply touch my trouser pocket with the NFC token I have in my car to toggle +bluetooth/+data/-wifi, or simply leave the phone over the NFC sticker on my desk I when I arrive at work to do the opposite (-bluetooth/-data/+wifi).

I searched gerrit in case anyone was working on it and saw this:

http://review.cyanogenmod.org/#/c/21785/

so we won't see it in CM, it seems :(

Now, what's the worse thing that could happen if NFC is enabled at all times? When I swipe an unknown NFC tag the phone does nothing (besides telling me).

I decided to compile my own CM10 KANGs from now on with a patched NfcService.java (running great right now), but I'd like to know of any vulnerability I might have overlooked.


Someone steals your phone and drains the cards using Google Wallet?

Just a guess.
 

zequav

Senior Member
Aug 14, 2011
268
105
Someone steals your phone and drains the cards using Google Wallet?

Just a guess.
If someone steals my phone they will be able to unlock it and use google wallet anyway if I set my profile lock screen to "unsecure", which would be no different than setting NFC to "always".
 

altimax98

Senior Member
Nov 7, 2008
2,227
676
Florida
Google wallet wouldn't be an issue since it requires a Pin number to unlock it to use it. I would worry more about battery drain and rouge apps. Someone could in theory bump upload an app and run it. Other then that I don't know.
 

speedyink

Senior Member
Sep 10, 2010
1,479
373
Pretty sure the dude trying to NFC harmful stuff to your phone will have to dry hump you first to get close enough
 

Marisa

Senior Member
Mar 22, 2010
164
37
Proximity is somewhat an issue, however there are some places where such activity might go completely unnoticed (packed subway or train as examples.)

Also, if NFC being always on becomes a "normal" thing, or at least expected on some level, it won't take long for better methods of exploiting it to be developed.
 

Schiehallion

Senior Member
Mar 3, 2009
253
21
London
Irotsoma made a mod for NFC screen off/locked, it's further down on this board if anyone wants it

Sent from my Galaxy Nexus using xda premium
 
Last edited:

zequav

Senior Member
Aug 14, 2011
268
105
So no real danger if you're not paranoid, then. Good to know. A pity we won't have it in CM; I don't see any problem if it's off by default and there is a warning when you enable it.

Irotsoma made a mod for NFC screen off/locked, it's further down on this board if anyone wants it

I usually don't trust random_guy's apks. I'd rather compile it myself. The patch is simple:

Code:
diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java
index 06642f7..793cc28 100755
--- a/src/com/android/nfc/NfcService.java
+++ b/src/com/android/nfc/NfcService.java
@@ -132,7 +132,7 @@ public class NfcService extends Application implements DeviceHostListener {
     static final int ROUTE_ON_WHEN_SCREEN_ON = 2;
 
     /** minimum screen state that enables NFC polling (discovery) */
-    static final int POLLING_MODE = SCREEN_STATE_ON_UNLOCKED;
+    static final int POLLING_MODE = SCREEN_STATE_OFF;
 
     // for use with playSound()
     public static final int SOUND_START = 0;
 

squidder

Senior Member
Apr 3, 2008
385
111
Samsung Galaxy Z Fold3
Some dudes have already used NFC to gain access to a locked gs3 and and upload a trojan automatically and then they have full control of the phone and can have u call premium numbers or whatever the hell they want. So yes there is danger just not likely ATM but in a couple years who knows. When Trojans first came to PCs u didn't really have to worry about it but now u have skids running rampant and I wouldn't be surprised if that happened to android.

Sent from my Galaxy Nexus using xda app-developers app
 

speedyink

Senior Member
Sep 10, 2010
1,479
373
Some dudes have already used NFC to gain access to a locked gs3 and and upload a trojan automatically and then they have full control of the phone and can have u call premium numbers or whatever the hell they want. So yes there is danger just not likely ATM but in a couple years who knows. When Trojans first came to PCs u didn't really have to worry about it but now u have skids running rampant and I wouldn't be surprised if that happened to android.

Sent from my Galaxy Nexus using xda app-developers app

In a controlled environment. Maybe if your live in New York and frequent the subways and stuff (ie: environments where people get packed together) you have a slight chance of it happening. If you are in those situations, turn NFC off. Otherwise, NFC has a working range of a couple cm's, so in all other cases the guy trying to trojan you will have to get so close that you'll be wondering what the hell he's trying to do.
 
Last edited:

Marisa

Senior Member
Mar 22, 2010
164
37
In a controlled environment. Maybe if your live in New York and frequent the subways and stuff (ie: environments where people get packed together) you have a slight chance of it happening. If you are in those situations, turn NFC off. Otherwise, NFC has a working range of a couple cm's, so in all other cases the guy trying to trojan you will have to get so close that you'll be wondering what the hell he's trying to do.
Hypothetically, someone could stick some NFC tags in places that people are likely to brush up against or set a purse nearby. Sure the tags aren't free but it would only take one hit to make that back.

Yeah it's still kind of a paranoia thing, and extremely unlikely unless NFC on while locked becomes commonplace. If someone thinks they can make a buck doing it, it will be done.
 

squidder

Senior Member
Apr 3, 2008
385
111
Samsung Galaxy Z Fold3
You say that because we are on this topic but the truth is if a guy "accidentally" bumps into u somewhere the last thing u think is he is trying to trojan u. U would prolly let it go and say learn to walk or something similar under ur breath. And then ud be "pwned" by some stupid 1337 skid.


In a controlled environment. Maybe if your live in New York and frequent the subways and stuff (ie: environments where people get packed together) you have a slight chance of it happening. If you are in those situations, turn NFC off. Otherwise, NFC has a working range of a couple cm's, so in all other cases the guy trying to trojan you will have to get so close that you'll be wondering what the hell he's trying to do.



Sent from my Galaxy Nexus using xda app-developers app
 

speedyink

Senior Member
Sep 10, 2010
1,479
373
Hypothetically, someone could stick some NFC tags in places that people are likely to brush up against or set a purse nearby. Sure the tags aren't free but it would only take one hit to make that back.

I didn't think of that, that's a good point


You say that because we are on this topic but the truth is if a guy "accidentally" bumps into u somewhere the last thing u think is he is trying to trojan u. U would prolly let it go and say learn to walk or something similar under ur breath. And then ud be "pwned" by some stupid 133...

True, I just wouldn't live in fear of it since the chances are really low. I always leave my NFC off unless I need it anyways, so its a non issue.
 

LoveNFC

Senior Member
May 14, 2012
161
63
Some dudes have already used NFC to gain access to a locked gs3 and and upload a trojan automatically and then they have full control of the phone and can have u call premium numbers or whatever the hell they want. So yes there is danger just not likely ATM but in a couple years who knows. When Trojans first came to PCs u didn't really have to worry about it but now u have skids running rampant and I wouldn't be surprised if that happened to android.

Sent from my Galaxy Nexus using xda app-developers app

Show us the link to this. You're either bull****ting or remembering incorrectly. When a stock GS3 is locked, NFC is off; this would not be possible whatsoever.
 

CptanPanic

Senior Member
Jun 15, 2011
193
66
I made a change, but now NfcNci.apk isn't getting built. How I can just build NfcNci.apk so I can see the build error?
Thanks.

So no real danger if you're not paranoid, then. Good to know. A pity we won't have it in CM; I don't see any problem if it's off by default and there is a warning when you enable it.



I usually don't trust random_guy's apks. I'd rather compile it myself. The patch is simple:

Code:
diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java
index 06642f7..793cc28 100755
--- a/src/com/android/nfc/NfcService.java
+++ b/src/com/android/nfc/NfcService.java
@@ -132,7 +132,7 @@ public class NfcService extends Application implements DeviceHostListener {
     static final int ROUTE_ON_WHEN_SCREEN_ON = 2;
 
     /** minimum screen state that enables NFC polling (discovery) */
-    static final int POLLING_MODE = SCREEN_STATE_ON_UNLOCKED;
+    static final int POLLING_MODE = SCREEN_STATE_OFF;
 
     // for use with playSound()
     public static final int SOUND_START = 0;