-
-
Notifications
You must be signed in to change notification settings - Fork 151
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
Question on permissions #478
Comments
{READ | WRITE}_EXTERNAL_STORAGE makes sense to me. There is an opportunity to store files or the application on the external drive. To access those files it will need READ permissions. It may also allow external thumb drives or similar for loading large gcode files.
@feelfreelinux would have to explain better but I can take a crack at what I can see from the code:
I would need to do a much deeper dive into the system but most of everything seems good and I think the SYSTEM ALERT DIALOG is merely to create modal dialogs inside the app and not interfere with any other software. Overall a pretty clean app. |
Thanks @hhocker – I know what the permissions mean, my question was rather how they are utilized here. I've adopted some of your list – but e.g.
So one downloads plugins from inside the app? And updates are not shipped as updates to the app itself? Would make sense for drivers and Octoprint software probably indeed, if the app mostly provides the GUI. But what's more obvious is the need to access the device for monitoring.
What files? I guess WRITE might be needed to install the Octoprint drivers/software (and if READ were not requested explicitly it'd be granted implicitly then anyhow due to the presence of WRITE (btw, it's The "chocolate" ones are the ones mostly needing an explanation, as they are considered sensitive there. So I hope for one of the devs to chime in for clarification. Meanwhile, thanks for providing your details! |
There would be two reasons for the internet usage. First the application will download the latest version of OctoPrint on first install. Then once the OctoPrint system is nested inside the container it will want to access the internet and check for updates and download plugins. Octo4A essentially creates what I would describe as a Docker container inside the app and runs the OctoPrint python system inside that. I dont know if the proot container can directly access the internet or if it proxies through the app.
Most likely any GCODE files stored externally so it can be loaded. Though I can see where there might be used for the proot container stored. Filip will need to confirm usage.
What are your concerns with them? I am not super familiar with all of the Android security as I have just started working with it. I presume unfettered READ_EXTERNAL_STORAGE would allow the app to view anything on the card, potentially collecting data? I am also confused what the SYSTEM_ALERT_WINDOW would allow the application to do? Hijack a form on another application?
|
Digging a bit more into the SYSTEM_ALERT_WINDOW permission it might be a kludge to be able to force the Octoprint container foreground service. Take a look at this: https://developer.android.com/develop/background-work/services/foreground-services#background-start-restriction-exemptions It appears that background services, provided they have the SAW permisson can start a foreground service. I wonder if this is how the system does the on boot launch. Filip will have to explain the code flow better as I am not fully following the code flow yet. |
Thanks for the insights! I've updated the description a bit (could not put everything into it as it has to be short).
I'm not familiar with Octoprint (or 3D printing in general), so please forgive me if my question sounds a bit stupid: Those files one would manually place on external storage (like files from Thingyverse) for printing? Then it's pretty clear to my why those do not simply go to the app's "private storage" indeed. Didn't think of that, d'ooh…
And together with the
That was e.g. used in the past by malicious apps, creating overlays over other apps to grab sensitive information (input then went to the overlay while one thought to put it into the underlying app). For this there are protective measures in place meanwhile, but there are other "use cases". I'm not saying Octo4a (or any other app with this permission listed in the IzzyOnDroid repo) would do such shady things – but again this is for transparency and building up trust to show what it's needed for. Thanks for your digging in; indeed I've been given comparable reasoning for this in connection with background/foreground services on other apps. Waiting for Filip to confirm then before I put in something we're not sure about. |
Hi! Sorry for the lack of reply - got a bit lost in the notifications. Thanks a lot @hhocker for digging into the code :) Internally, octo4a works on quite a lot of odd hacks and workarounds, that are not exactly self explanatory. I'll try to give a quick rundown of the more suspicious permissions.
As far as I remember, this is correct. To be exact, this is used to make the "launch app on boot" feature work. While, just registering the boot receiver allows the app's service to run on boot, it does not allow the boot receiver to explicitly start the app's activity on start. However, Android does make an exception for apps with
To build a complete list of network interfaces + their assigned addresses, octo4a needs to use the
While octo4a's linux bootstrap works inside of
Octo4a tries to mimic the experience of someone running OctoPrint on some Linux SBC. The underlying Alpine Linux bootstrap has a full access to network, mostly used for performing updates, and for installation of plugins. The app can also optionally run an SSH server, allowing the users to customize the Alpine Linux environment manually. The plugins are downloaded from OctoPrints plugin repository - so this does technically allow for an execution of arbitary binaries, and is a security risk to some degree. To be completely honest, by design octo4a is not something you would like to run on your daily driver phone. People usually use the app on old unused phones, tablets and tv boxes - those devices don't exactly have sensitive data on them to begin with. |
Ah, also regarding the anti-features listed in IzzySoft repo - the bugsnag reporting is opt-in with a dialog asking for permission on first boot, and users can always change their mind through the app's settings. Does it still count as the Tracking anti-feature? |
Ha! Welcome to the party. I know exactly what you're talking about there 🙈
Talk about Android permissions being transparent to us "mere mortals". This is now the second time I get this explanation, so I totally believe it – especially with your elaborations on it, which I got for the first time now. Before I just facepalmed about the logic (well, there are worse things: permissions which are no permissions at all, like DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION). Thanks a lot for explaining! Will update that in my permission explanations ASAP so I cannot forget.
Tack. Next one. It's not changing anything but you need a permission named CHANGE_something. And then one wonders about those becoming suspicious (or giving up to even try understanding). Well, for octo4a we'll help that by making it transparent. Adding that now as well, thanks again!
Thanks, updated accordingly!
Yeah – and comes close to violate the IzzyOnDroid App Inclusion Policy:
But only almost. It won't download things by itself (but only on explicit request), and hopefully also makes clear where it's downloaded from. As the app works fine without any of those, I guess the NonFreeNet: The app downloads the Alpine Linux bootstrap and Octoprint binaries from XXX (and also lets you download Plugins from YYY) (XXX and YYY would need to be replaced properly of course)
Nope, certainly not. But as you write yourself: it's a very good use-case for your otherwise abandoned "older device". Unless of course you take along your OctoPrinter on your "daily drives" as well, then the term "daily driver" would need to be clarified 🤪
Ah, thanks for pointing out! Yes, then of course that anti-featue can be removed (just done that, effective with the next sync around 6 pm UTC). |
My scanner reported for the latest APK:
May I ask for clarifications on those?
CAMERA
is clear as it's mentioned in the Readme.usesCleartextTraffic
I assume is only for the connections to the printer (didn't check if there's a network security policy set up). The other two I couldn't figure (and wouldn't mind a short explanation for the rest 😉)Thanks in advance!
The text was updated successfully, but these errors were encountered: