Skip to content
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

iOS Binary Make Use Of Insecure APIs #988

Open
waligoraj opened this issue Aug 27, 2021 · 3 comments
Open

iOS Binary Make Use Of Insecure APIs #988

waligoraj opened this issue Aug 27, 2021 · 3 comments
Labels

Comments

@waligoraj
Copy link

The iOS binary makes use of several APIs that are insecure. These functions are dangerous because
they might lead to memory corruption and should not be used. The following binaries were
discovered being used:
_malloc
_fopen
_stat
_memcpy
_strncpy
_sscanf
_strlen
_srand
_random

@brodycj
Copy link

brodycj commented Aug 27, 2021

Thanks but these API functions are used by SQLite which is very well tested as described here: https://sqlite.org/testing.html

I would consider this issue to be invalid and will likely close it unless there are some very, very strong arguments forthcoming.

@waligoraj
Copy link
Author

Brody,

Thanks for you quick response. I am trying to get clarification for our security team, and an explanation as to why this plugin is secure and what would be driving these "false positive" security vulnerabilities. In other words, can you explain why these functions listed above, cannot lead to memory corruption? Any and all response will be extremely useful in explaining to my security department why we don't have to be concerned about this plugin.

Thanks,
Joseph Waligora

@brodycj
Copy link

brodycj commented Aug 30, 2021

Hello I am still not yet convinced that we should keep this issue open.

It would be extremely helpful if you could give me an idea of what tool is reporting the use of "insecure" or "dangerous" API functions.

Yes the C functions listed in the description do have to be used very carefully.

As I tried to explain before:

  • these C functions are only used by SQLite and not directly by the Objective-C code in this plugin
  • SQLite itself is extremely well tested

By "extremely well tested" I mean that SQLite has been tested with 100% code and branch coverage for years and has been considered safe for aviation as well:

At the risk of sounding promotional I will also say that SQLite is known as the most widely used database engine:

One more thing is that in terms of this plugin:

  • the iOS implementation was originally made by someone else in 2011 (~10 years ago)
  • I have been maintaining various versions of this plugin for both Android and iOS since 2012 (~9 years ago)
  • I have not seen any reports of memory corruption on iOS in this plugin

I did receive some reports of intermittent database file corruption back in 2017 (3-4 years ago) and applied some build updates in response to these reports: storesafe/cordova-sqlite-storage-help#34 ... I have not seen any more reports of database file corruption since 2018 when I applied these updates.

Given the points above, I would consider this plugin to be very safe against memory corruption.

Does this mean that we can absolutely guarantee that the use of these functions can never lead to memory corruption? Not necessarily, but I think it can and should be plenty good enough. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants