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

WASM Failure on Safari on macOS and iOS #798

Closed
1 task
MayuraRam opened this issue Apr 8, 2021 · 8 comments
Closed
1 task

WASM Failure on Safari on macOS and iOS #798

MayuraRam opened this issue Apr 8, 2021 · 8 comments
Labels
bug W-WasmThemis 🌐 Wrapper: WasmThemis, JavaScript API, npm packages

Comments

@MayuraRam
Copy link

During decryption it fails with this message : Themis: SecureCellSeal: failure

To Reproduce
Steps to reproduce the behavior:

  1. Use libthemis.wasm on a web page to encrypt and decrypt data with an input data size above 48000 bytes
  2. Run '...'
  3. See the following error:
Themis: SecureCellSeal: failure

Expected behavior
Expected it to decrypt the
Environment (please complete the following information):

  • OS: macOS Big Sur v 11.2.2, Safari 14.0.3
  • Hardware: [32-bit/64-bit, or mobile device name and version]
  • Themis version: [e.g. 0.12.0]
  • Installation way:
    • [X ] via package manager
    • built from source

Additional context
Happens intermittently with an input data size around 48000 bytes. Larger input sizes happens all the time. Does not happen with much smaller sizes. Runs perfectly well on Chrome on macOS. After encryption if decryption is not done - this exception is thrown - RuntimeError: Out of Bounds memory access (evaluating 'libthemis$2._themis_secure_cell_encrypt_sel')

@vixentael vixentael added W-WasmThemis 🌐 Wrapper: WasmThemis, JavaScript API, npm packages bug labels Apr 8, 2021
@vixentael
Copy link
Contributor

Hi @CACUser!

Thank you for reporting, that looks interesting :)
I suspect some issues with data size / memory management in wasm wrapper. We will investigate.

Do you see this error every time on any data larger than 48000 bytes? Or does this data have some special symbols inside?

@vixentael
Copy link
Contributor

Runs perfectly well on Chrome on macOS.

even with data above 48000 bytes?

@MayuraRam
Copy link
Author

Apologies - I now think it does not have anything to do with size. It is occurring intermittently with smaller sizes too. There are no special symbols inside. I am adding a bunch of messages to an indexedDB, encrypting the DB, storing in localStorage, then later decrypting the DB (this is where the issue is occurring on Safari on macOS and iOS). It works without any issues with any data size on Chrome on macOS.

@vixentael
Copy link
Contributor

Thank you @CACUser! We will investigate this.

It will help a lot if you could send us a test project that reproduces the issue.

Also, we're in the middle of migrating to typescript for WASM themis #792, I'm wondering if this might help..

cc @ilammy

@maxammann
Copy link
Contributor

Also, we're in the middle of migrating to typescript for WASM themis #792, I'm wondering if this might help..

Probably it wont as I did not really discover any implementation bugs while converting to ts.

@ilammy
Copy link
Collaborator

ilammy commented Jul 16, 2021

FWIW, I've been testing recently added WasmThemis example with recently released wasm-themis@0.13.10 with Safari 14.0.3 as well, and it works fine for me. So it does not seem to be failing in isolation.

@vixentael
Copy link
Contributor

i think this one is addressed by #928 and https://github.com/cossacklabs/themis/releases/tag/0.14.8

@radetsky
Copy link
Contributor

@CACUser, please take a look, if you are still interested. You may update wasm-themis to the latest at the moment 0.14.8.

I have checked twice with different browsers the issue with the code from https://github.com/radetsky/create-react-app-with-themis/tree/big_files_encryption_test

It works fine even with 20 MB of data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug W-WasmThemis 🌐 Wrapper: WasmThemis, JavaScript API, npm packages
Projects
None yet
Development

No branches or pull requests

5 participants