Infiltrate Your Own React Native App

Rate this content
Bookmark

Ever wondered how hackers can compromise your app and your app data? In this talk you will see how to infiltrate your own app with different techniques like decompiling, sniffing, etc.. By the end of the talk, you'll walk away a little bit scared but more prepared with some great practices to infiltrate your own app and the knowledge to battle them.

Wouter van den Broek
Wouter van den Broek
24 min
17 Jun, 2022

Comments

Sign in or register to post your comment.

Video Summary and Transcription

Every bug and feature can be a potential flaw or entry point for bad actors. React Native projects have many dependencies that can be exploited. It's important to understand your app's native code and follow security guidelines. Analyzing and modifying code can alter an application's behavior. Repackaging and modifying compiled code is relatively easy. App update vulnerabilities can be demonstrated by redirecting URLs. Code reviews and automated tooling are important for accountability. There are resources available to learn about basic security precautions for React Native.

1. Risks of Bugs, Flaws, and Fake Apps

Short description:

This is a headline you don't want to see. As a product owner or as a business, you don't want to. As a developer as well, you don't want to see this headline popping up at the New York Times. Every bug and feature can also be a potential flaw or potential entry point for a bad actor to exploit your app or business. Fake applications use your brand or icon to make fake apps and try to escalate privileges. There are thousands of fake apps in the app store. Some app stores are fake and contain malicious code. Attackers target your tools and dependencies.

This is a headline you don't want to see. As a product owner or as a business, you don't want to. As a developer as well, you don't want to see this headline popping up at the New York Times. This one really did pop up in 2002, 2020, sorry, because Jeff Bezos' iPhone was hacked because there was a vulnerability in WhatsApp, so not on iOS, which you were multiple times, of course, that are some exploits for iOS itself. But this was only because WhatsApp made an error somewhere, so they were, yeah, and Jeff Bezos was infiltrated that way and escalated on iOS multiple times.

So every time you make a feature or you create code, of course, there is a chance of a bug. And every bug and feature can also be a potential flaw or potential entry point for a bad actor to use so they can exploit your app, exploit your business. So in research, there was like 75% of apps have bugs in them or features that can be used to infiltrate your app or exploit your business. So for example, the 7-eleven one was a nice feature, what they used to reset your password, which is of course an obvious functionality, but they thought, what happens if you change your email? So if you change your email all the time, maybe you could just enter another email and reset your password that way. Sounds great, but of course, if somebody new, and multiple people new, they reset passwords of other user accounts, and then just ordered everything, what they could online. So that feature was misused multiple times, and like it says here, it costs some money for them as well.

Another thing you see online a lot is fake applications. So they use your brand or has your icon, if it's really popular of course as well, to make fake applications, put it in the app store, for example, iOS or Android doesn't, or Google Play doesn't really matter, and try to lure you in to download that app, and try to escalate privileges. For example, you can ask the app for the contact permissions for the contact list, although your normal app doesn't do that, the fake app does, and just upload that contact list of yours to their own server and try to do it that way. Another trick is, of course, what they do is try to put advertisements in your application. So they make a copycat application, just 101, and enter advertisement code in it. So if you open the app, there's advertisements, which you didn't add, so they are profiting off your application as well. You would think that Apple and Google would do a great job of protecting your app, of course, because they have this really neat review process, which everybody loves and hates. But still, there are thousands of fake applications in the app store right now. Of course, some with great brands, while others smaller, which do this all day long. And also, there are some app stores which are not really app stores, but they are fake app stores with correct applications, for example, because some applications are expensive and people try to use them in a free way. So they will go to an app store, which isn't of course the Google or the Apple one, and then download the application. And usually, there is malicious code in there as well, because they also need to make a profit of you, of course. In the Fortnite example, for example, Fortnite is of course still a popular game, but they made an announcement that they were making a mobile version of it. They made an Android application which downloaded the real game, let's say like that, so they made a launcher app. So everybody made a fake launcher app, which downloaded some other app, which of course escalated the permissions, and of course tried to inject everything in your mobile device. Another one is, it's not only, they are not only attacking your app, but also your tools you use every day. Of course, most notably the fake Xcode, as we call it, is one of an example of that. And not only the tools, but also your dependencies. So all the dependencies you have in your application are targeted to get there into your device, so in your MacBook or laptop.

2. React Native Security and Best Practices

Short description:

And they try to search for credentials or put a crypto miner on your device. Software projects have many dependencies, providing entry points for bad actors. British Airways and MPM hacks are notable examples. To protect your app, understand its native code, hire experts if needed, and follow security guidelines. Watch talks by Julia from Cossack Labs for insights on React Native security. OWASP provides top 10 security vulnerabilities for mobile. Use the mobile requirement and verification project to assess your app's safety.

And they try to search for, for example, XSKEYS for AWS or some other credentials they want to have, or they just put a crypto miner on your device without you knowing and they profit off you as well. Because these days the software project has like 203 on average dependencies, I think React, of course, has some more, but that's the average at this time, there are a lot of ways for them, for bad actors, to get into dependencies as well, and then try to get into the app.

Most notably, of course, they try to do it on your machine as well, to exploit that, but they want to exploit the application you are making as well, so again, they will eventually get onto the device, buy your app and then trying to get that data that they want. I think the British Airways one is one of the most notable here. They used Modernizr, which is of course a web framework to attack, but they also use that on mobile as well, and what they did is they made a keylogger inside of Modernizr and then push that to BA and then every page on BA got that script, so also the checkout page, so everything you typed in the checkout page was sent to them as well. So of course all the credit cards, etc. details were sent to them and they used that of course to make all the purchases, etc. BA got fined for $20 million last year for this hack alone, so it was a really expensive trick that they did on them. And also from last year, I guess, was the MPM one, the UI partial one, was that they added a CryptoMiner for your machine. So if you run that or you added the newest version of that dependency, then of course you get that CryptoMiner as well. So what can we do about this?

First of all, and I think Katie did a great job of saying that as well, know your service loader, so also know the native code of your react native code. Of course most people will know the JS code or the TypeScript code as well, but try to understand the other parts your React Native app is using as well. If you don't, by yourself, try to hire someone or contract somebody to see what the code is doing and what it is not doing so you can assess what attack factors there are in your code. Documentation, of course, again, thanking Katie for the React Native security documentation which she made for most of the bunch, which is great. React Native itself on the website has some security guidelines, so please follow them as well. Google and Apple, for the native side, have great security guidelines as well, so to what to do and what not to do with your data and your security details, et cetera. Big shout out to Julia, because there should be a YouTube here but I guess the internet isn't working great at the moment. Julia is from Cossack Labs, which is a security company from Ukraine. She already has some talks about React Native and security for a few years now. Please watch them because they are really, really good to knowing about how React Native works with the native side as well for the bridge and all the things you need to account to. We have OWASP, which is an open source framework. We have that for web as well. We have the top 10 for OWASP for web. We also have that for mobile, which is shown in the infographic here as well. We have the 10 most used security vulnerabilities that are used in the wild. They make a top 10 out of them. Take a look at them. See if your app is somewhere in that space and try to improve on that. They also have another project, which is the mobile requirement and verification project, which is mainly, of course, there's a lot of documentation, but it also has an Excel sheet with all the things you can check to see if your application is safe. Not only code, but also in process, et cetera.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Raising the Bar: Our Journey Making React Native a Preferred Choice
React Advanced Conference 2023React Advanced Conference 2023
29 min
Raising the Bar: Our Journey Making React Native a Preferred Choice
At Microsoft, we're committed to providing our teams with the best tools and technologies to build high-quality mobile applications. React Native has long been a preferred choice for its high performance and great user experience, but getting stakeholders on board can be a challenge. In this talk, we will share our journey of making React Native a preferred choice for stakeholders who prioritize ease of integration and developer experience. We'll discuss the specific strategies we used to achieve our goal and the results we achieved.
Opensource Documentation—Tales from React and React Native
React Finland 2021React Finland 2021
27 min
Opensource Documentation—Tales from React and React Native
Documentation is often your community's first point of contact with your project and their daily companion at work. So why is documentation the last thing that gets done, and how can we do it better? This talk shares how important documentation is for React and React Native and how you can invest in or contribute to making your favourite project's docs to build a thriving community
Bringing React Server Components to React Native
React Day Berlin 2023React Day Berlin 2023
29 min
Bringing React Server Components to React Native
Top Content
React Server Components are new topic in community, bunch of frameworks are implementing them, people are discussing around this topic. But what if we could use React Server Components in React Native? And bring all optimisation features that RSC allows to mobile apps? In this talk I would present what we are able to do with RSC in React Native!
Building Cross-Platform Component Libraries for Web and Native with React
React Advanced Conference 2021React Advanced Conference 2021
21 min
Building Cross-Platform Component Libraries for Web and Native with React
Top Content
Building products for multiple platforms such as web and mobile often requires separate code-based despite most of the components being identical in look and feel. Is there a way where we could use shared React component library on different platforms and save time? In this presentation I'll demonstrate one way to build truly cross-platform component library with a unique approach of using React & React Native in combination.
React Native Kotlin Multiplatform Toolkit
React Day Berlin 2022React Day Berlin 2022
26 min
React Native Kotlin Multiplatform Toolkit
Top Content
Combining the best of two cross-platform frameworks to build the ultimate multiplatform development experience.
MDX in React-Native!?
React Advanced Conference 2021React Advanced Conference 2021
21 min
MDX in React-Native!?
Top Content
How to use MDX in React-Native to great effect and the challenges you didn't know you signed up for.

Workshops on related topic

Introducing FlashList: Let's build a performant React Native list all together
React Advanced Conference 2022React Advanced Conference 2022
81 min
Introducing FlashList: Let's build a performant React Native list all together
Top Content
WorkshopFree
David Cortés Fulla
Marek Fořt
Talha Naqvi
3 authors
In this workshop you’ll learn why we created FlashList at Shopify and how you can use it in your code today. We will show you how to take a list that is not performant in FlatList and make it performant using FlashList with minimum effort. We will use tools like Flipper, our own benchmarking code, and teach you how the FlashList API can cover more complex use cases and still keep a top-notch performance.You will know:- Quick presentation about what FlashList, why we built, etc.- Migrating from FlatList to FlashList- Teaching how to write a performant list- Utilizing the tools provided by FlashList library (mainly the useBenchmark hook)- Using the Flipper plugins (flame graph, our lists profiler, UI & JS FPS profiler, etc.)- Optimizing performance of FlashList by using more advanced props like `getType`- 5-6 sample tasks where we’ll uncover and fix issues together- Q&A with Shopify team
Detox 101: How to write stable end-to-end tests for your React Native application
React Summit 2022React Summit 2022
117 min
Detox 101: How to write stable end-to-end tests for your React Native application
Top Content
WorkshopFree
Yevheniia Hlovatska
Yevheniia Hlovatska
Compared to unit testing, end-to-end testing aims to interact with your application just like a real user. And as we all know it can be pretty challenging. Especially when we talk about Mobile applications.
Tests rely on many conditions and are considered to be slow and flaky. On the other hand - end-to-end tests can give the greatest confidence that your app is working. And if done right - can become an amazing tool for boosting developer velocity.
Detox is a gray-box end-to-end testing framework for mobile apps. Developed by Wix to solve the problem of slowness and flakiness and used by React Native itself as its E2E testing tool.
Join me on this workshop to learn how to make your mobile end-to-end tests with Detox rock.
Prerequisites- iOS/Android: MacOS Catalina or newer- Android only: Linux- Install before the workshop
How to Build an Interactive “Wheel of Fortune” Animation with React Native
React Summit Remote Edition 2021React Summit Remote Edition 2021
60 min
How to Build an Interactive “Wheel of Fortune” Animation with React Native
Top Content
Workshop
Oli Bates
Oli Bates
- Intro - Cleo & our mission- What we want to build, how it fits into our product & purpose, run through designs- Getting started with environment set up & “hello world”- Intro to React Native Animation- Step 1: Spinning the wheel on a button press- Step 2: Dragging the wheel to give it velocity- Step 3: Adding friction to the wheel to slow it down- Step 4 (stretch): Adding haptics for an immersive feel
Get started with AG Grid Angular Data Grid
JSNation 2022JSNation 2022
116 min
Get started with AG Grid Angular Data Grid
WorkshopFree
Stephen Cooper
Stephen Cooper
Get started with AG Grid Angular Data Grid with a hands-on tutorial from the core team that will take you through the steps of creating your first grid, including how to configure the grid with simple properties and custom components. AG Grid community edition is completely free to use in commercial applications, so you’ll learn a powerful tool that you can immediately add to your projects. You’ll also discover how to load data into the grid and different ways to add custom rendering to the grid. By the end of the workshop, you will have created and customized an AG Grid Angular Data Grid.
Contents:- getting started and installing AG Grid- configuring sorting, filtering, pagination- loading data into the grid- the grid API- add your own components to the Grid for rendering and editing- capabilities of the free community edition of AG Grid
Effective Detox Testing
React Advanced Conference 2023React Advanced Conference 2023
159 min
Effective Detox Testing
Workshop
Josh Justice
Josh Justice
So you’ve gotten Detox set up to test your React Native application. Good work! But you aren’t done yet: there are still a lot of questions you need to answer. How many tests do you write? When and where do you run them? How do you ensure there is test data available? What do you do about parts of your app that use mobile APIs that are difficult to automate? You could sink a lot of effort into these things—is the payoff worth it?
In this three-hour workshop we’ll address these questions by discussing how to integrate Detox into your development workflow. You’ll walk away with the skills and information you need to make Detox testing a natural and productive part of day-to-day development.
Table of contents:
- Deciding what to test with Detox vs React Native Testing Library vs manual testing- Setting up a fake API layer for testing- Getting Detox running on CI on GitHub Actions for free- Deciding how much of your app to test with Detox: a sliding scale- Fitting Detox into you local development workflow
Prerequisites
- Familiarity with building applications with React Native- Basic experience with Detox- Machine setup: a working React Native CLI development environment including either Xcode or Android Studio
Deploying React Native Apps in the Cloud
React Summit 2023React Summit 2023
88 min
Deploying React Native Apps in the Cloud
WorkshopFree
Cecelia Martinez
Cecelia Martinez
Deploying React Native apps manually on a local machine can be complex. The differences between Android and iOS require developers to use specific tools and processes for each platform, including hardware requirements for iOS. Manual deployments also make it difficult to manage signing credentials, environment configurations, track releases, and to collaborate as a team.
Appflow is the cloud mobile DevOps platform built by Ionic. Using a service like Appflow to build React Native apps not only provides access to powerful computing resources, it can simplify the deployment process by providing a centralized environment for managing and distributing your app to multiple platforms. This can save time and resources, enable collaboration, as well as improve the overall reliability and scalability of an app.
In this workshop, you’ll deploy a React Native application for delivery to Android and iOS test devices using Appflow. You’ll also learn the steps for publishing to Google Play and Apple App Stores. No previous experience with deploying native applications is required, and you’ll come away with a deeper understanding of the mobile deployment process and best practices for how to use a cloud mobile DevOps platform to ship quickly at scale.