nvllsvm / Audinaut

A Subsonic client for Android
GNU General Public License v3.0
134 stars 18 forks source link

Internet availability may not be being verified in methods #110

Closed amazuerar closed 3 years ago

amazuerar commented 3 years ago

Dear Developer!

My name is Alejandro Mazuera-Rozo, I am a PhD Student at Universidad de los Andes, and at Università della Svizzera italiana. I am part of a research on the usage of network libraries within android apps. As a result of this we have identified some code locations that might have a missing validation of Internet availability, validation that is needed since some network operations are being performed within some methods.

As you might know, a device may be connected to a network but may not have Internet connection. Therefore it is recommended for the app to identify whether the device is connected to a network having Internet connectivity before performing a network operation.

In order to address this issue we recommend you to visit:

  1. https://developer.android.com/reference/android/net/NetworkCapabilities
  2. https://developer.android.com/reference/android/net/NetworkCapabilities#NET_CAPABILITY_INTERNET
  3. https://developer.android.com/reference/android/net/NetworkCapabilities#NET_CAPABILITY_VALIDATED

Potential Code Location missing Internet connectivity validation:

https://github.com/nvllsvm/Audinaut/blob/aa4c877046f328b09a48ca7bc52185cbb9f19e86/app/src/main/java/net/nullsum/audinaut/service/RESTMusicService.java#L162

https://github.com/nvllsvm/Audinaut/blob/aa4c877046f328b09a48ca7bc52185cbb9f19e86/app/src/main/java/net/nullsum/audinaut/service/RESTMusicService.java#L179

https://github.com/nvllsvm/Audinaut/blob/aa4c877046f328b09a48ca7bc52185cbb9f19e86/app/src/main/java/net/nullsum/audinaut/service/RESTMusicService.java#L308

https://github.com/nvllsvm/Audinaut/blob/aa4c877046f328b09a48ca7bc52185cbb9f19e86/app/src/main/java/net/nullsum/audinaut/service/RESTMusicService.java#L328

https://github.com/nvllsvm/Audinaut/blob/aa4c877046f328b09a48ca7bc52185cbb9f19e86/app/src/main/java/net/nullsum/audinaut/service/RESTMusicService.java#L461

https://github.com/nvllsvm/Audinaut/blob/aa4c877046f328b09a48ca7bc52185cbb9f19e86/app/src/main/java/net/nullsum/audinaut/service/RESTMusicService.java#L658

Related issues: #109

nvllsvm commented 3 years ago

Internet connectivity is not necessarily required as the destination server may be available on the local network.