talsec / Free-RASP-Cordova

Cordova plugin for improving app security and threat monitoring on Android and iOS mobile devices.
https://github.com/talsec/Free-RASP-Community
MIT License
19 stars 6 forks source link

Not Working In IOS #28

Closed codehack26 closed 6 months ago

codehack26 commented 6 months ago

Describe the bug A clear and concise description of what the bug is. App crashes with an exception in TalsecPlugin

To Reproduce If applicable, steps to reproduce the behavior. Step 1: Installed the cordova plugin add cordova-plugin-add-swift-support --save Step 2: Installed the cordova plugin add cordova-talsec-plugin-freerasp Step 3: Configuration Code added in JS file Step 4: Run the Real device with simulator

Expected behavior A clear and concise description of what you expected to happen. App should not crash & detect type of Security Threat

Screenshots If applicable, add screenshots to help explain your problem.

Screenshot 2024-05-09 at 12 40 03 PM

Please complete the following information:

Additional context Add any other context about the problem here.

tompsota commented 6 months ago

Hi @codehack26,

did this happen on fresh install of freeRASP, or are you updating from a previous version?

Best, Tomas from Talsec

codehack26 commented 6 months ago

Hi @tompsota Thanks for the quick response.

Its an fresh installation. We have tried on standalone project (Blank project) as well as on our project. Issue is still same for both the projects

We are using Xcode 15.3

codehack26 commented 6 months ago

@tompsota Were you able to reproduce the issues.?

tompsota commented 6 months ago

Hi @codehack26,

No, I wasn't able to reproduce.

What version of 'cordova-ios' and 'cordova-plugin-add-swift-support' are you using?

Additionally, in the following gist is index.js of a demo app I used for testing. It should start freeRASP and log any detected incidents. https://gist.github.com/tompsota/f2a9e70ac6497cdb0ffe10dced16c80b . Can you try it on the blank project to see if the issue is still there?

codehack26 commented 6 months ago

@tompsota Please find the details cordova-ios: 6.3.0 cordova-plugin-add-swift-support : 2.0.2

Can you try it on the blank project to see if the issue is still there? Same error in blank project. Seems like some issue with plugin

tompsota commented 6 months ago

Hello @codehack26,

I was finally able to reproduce the bug. It is caused by cordova-ios plugin. More specifically, just by some versions of it. I'll try to fix it.

However, newer versions of the ios plugin do not throw the error, so maybe consider to bump the cordova-ios. I'm not sure what is the least version that fixes the problem, but I can say that with "cordova-ios": "^7.1.0", the project builds successfully.

Cheers,

Tomas from Talsec

codehack26 commented 6 months ago

@tompsota Thanks for the update. Awaiting for the fix for lower version of cordova-ios

tompsota commented 6 months ago

Issue should be resolved in v6.1.2

@codehack26, please try to update the freerasp plugin

Best, Tomas from Talsec

codehack26 commented 6 months ago

@tompsota Appreciate your quick response. We will let you know if we face any issue.

codehack26 commented 6 months ago

@codehack26 Still we are facing same issue. Screenshot attached for your reference. We have update the TalsecPlugin.swift manually as of now. I have not see any other change with the latest commit apart from TalsecPlugin.swift

image
tompsota commented 6 months ago

@codehack26 Allright. Let's try different approach.

Can you try to replace the SecurityThreat extension with following code?

https://gist.github.com/tompsota/737ffb2a8599641644f4fd72de38af64

Let me know if this helped, and I'll create a new release then.

codehack26 commented 6 months ago

@tompsota Error is resolved. App is not crashing now. Exploring the configuration(debug, jailbreak etc) available on IOS

tompsota commented 6 months ago

Issue is resolved in v6.1.3.