Separating from T208134, which is about the same feature in mobile app.
Description
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Barcode scanning | mediawiki/extensions/Citoid | master | +1 K -3 |
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | ppelberg | T216775 Add ability to cite books by scanning their ISBN barcode in mobile web | |||
Open | None | T231031 Instrument usage of ISBN barcode scanner | |||
Resolved | Reedy | T269007 Security Readiness Review For Citoid VE Mobile ISBN Barcode Scanner |
Event Timeline
Change 493494 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/Citoid@master] WIP DEMO barcode scanning
Video throughput on my iPhoneX seems jittery, but this is an amazing feature.. SHIP IT ! ;)
Awesome! There's a slight delay with no loading animation in between when the barcode app closes and when the isbn gets inserted that is just a little too long for no feedback on my phone... is there any way to make that pending? And also, when you press back after denying camera access, you get an empty dialog. But yes ship it :D.
Change 493494 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/Citoid@master] WIP DEMO barcode scanning
Can you make a screen recording? The dialog should be closing fairly instantly - if it isn't that could be the shutdown code for the library causes the main thread to hang.
I note the small camera icon in the top left of the system tray disappears at the same time as the barcode appears. I would suspect that the camera closing is causes the whole phone to freeze up for a second. Potentially we could emit the barcode detected event before closing the camera so at least the code is there when the phone freezes.
Changing .closed to .closing in the scanner widget appears to fix this, sending the detected code to the widget at the start of the teardown process, instead of the end.
Now on patch demo (mobile only): https://patchdemo.wmflabs.org/wikis/cbe37578751b8297c6f29ebdd4406bb7/w/index.php/Test
I'm uneasy about this feature for security reasons. As far as I know, browsers will only ask for camera permissions once, and then the website is just allowed to use the camera whenever it wants.
I think this offers new nasty possibilities to someone who manages to take over an interface administrator account, or finds an XSS vulnerability anywhere in any of the code the sites run. Previously just about the worst thing they could do was fetching the IP address, but if our sites have camera permissions, they will also be able to take photos and record videos.
Maybe I am paranoid, but I wanted to point this out.
There is precedent in us asking for sensor data from users with the nearby pages feature asking for location (https://en.m.wikipedia.org/wiki/Special:Nearby). AFAIK there have been no concerns raised about this.
I think this offers new nasty possibilities to someone who manages to take over an interface administrator account, or finds an XSS vulnerability anywhere in any of the code the sites run. Previously just about the worst thing they could do was fetching the IP address, but if our sites have camera permissions, they will also be able to take photos and record videos.
There are undoubtedly terrible things that can happen if an attacker gets hold of an interface admin account (at least for as long as it goes unnoticed). In addition to gathering IPs and granted sensor data (GPS/camera), the user could exploit trust in the domain to prompt for a password, or payment information from donors. Additional private information could be harvested from various API calls, or by scraping Special:Preferences. A attacker could ask a much larger number of users for sensor data, again exploiting the trust in our domain. I don't think it's correct to characterise this as a large change in the data at risk. There are other pieces of work being undertaken to address this (such as enforcing our CORS policy, which would it make it harder to export stolen data).
@JTannerWMF - we've taken a look and would appreciate it if you would fill out the Security Readiness Review form. Thanks!
Will do – thank you, @Jcross!
Note: I'm assigning this task over to @JTannerWMF to file a security review task.
Per T269007#7067880 this has been security reviewed and just needs sign off from @marcella.
Test wiki created on Patch Demo by ESanders (WMF) using patch(es) linked to this task:
Test wiki created on Patch demo by ESanders (WMF) using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/b9bf6906b0/wiki/Douglas Adams
Test wiki on Patch demo by ESanders (WMF) using patch(es) linked to this task was deleted:
Test wiki created on Patch demo by ESanders (WMF) using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/1346aed9a7/wiki/Douglas Adams
Test wiki on Patch demo by ESanders (WMF) using patch(es) linked to this task was deleted:
Test wiki on Patch demo by ESanders (WMF) using patch(es) linked to this task was deleted:
Test wiki created on Patch demo by ESanders (WMF) using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/3b416c7370/wiki/Douglas Adams
Change 493494 merged by jenkins-bot:
[mediawiki/extensions/Citoid@master] Barcode scanning
This works as expected. However, I observed the following:
✅ Scanning old books with savageable ISBN barcode
❓ I wasn't able to add some books, even though it scanned correctly. Is this something we are in control of?
❓ I struggled a bit with going to the next line immediately after adding the citation
See https://photos.app.goo.gl/c2S1C2vXo1XZyxhRA for reference.
Not really - we use a third party to do the lookup and no database is complete.
❓ I struggled a bit with going to the next line immediately after adding the citation
See https://photos.app.goo.gl/c2S1C2vXo1XZyxhRA for reference.
Thanks - this looks like a general issue with the citation workflow, rather than the ISBN scanning part, so lets address it in a new task.
Test wiki on Patch demo by ESanders (WMF) using patch(es) linked to this task was deleted: