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.

This talk has been presented at React Summit 2022, check out the latest edition of this React Conference.

FAQ

Jeff Bezos' iPhone was hacked in 2020 due to a vulnerability in WhatsApp, which allowed bad actors to exploit the app and escalate privileges on iOS.

Research indicates that approximately 75% of mobile apps have bugs or features that can be exploited by bad actors to infiltrate the app or the business.

The 7-Eleven app had a feature that allowed users to reset their passwords by changing their email addresses. This feature was misused by bad actors to reset passwords of other user accounts and make unauthorized purchases.

Fake applications mimic popular apps and are placed in app stores to lure users into downloading them. These apps often request unnecessary permissions, like access to contact lists, to steal user data or insert advertisements to profit off the app.

Yes, there are fake app stores that offer cracked versions of applications, often containing malicious code to steal user data or install malware like crypto miners.

Developers should understand their app's native code, follow security guidelines from React Native, Google, and Apple, use tools to check dependencies, and regularly perform penetration tests to identify and fix vulnerabilities.

The OWASP Mobile Top 10 is a list of the most common security vulnerabilities found in mobile applications, created by the Open Web Application Security Project (OWASP) to help developers secure their apps.

Dependencies can be a security risk because bad actors can exploit vulnerabilities in these external libraries to infiltrate the app or the developer's machine, potentially stealing sensitive information or installing malware.

The British Airways hack involved a keylogger inside the Modernizr framework, which captured and sent all user input, including credit card details, to the hackers. This led to a $20 million fine for British Airways.

Developers should avoid placing sensitive information, like API keys, in environment variables within the app code. Instead, they should securely fetch these details from a server to prevent easy access by bad actors.

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
Watch video: Raising the Bar: Our Journey Making React Native a Preferred Choice
This Talk discusses Rack Native at Microsoft and the efforts to improve code integration, developer experience, and leadership goals. The goal is to extend Rack Native to any app, utilize web code, and increase developer velocity. Implementing web APIs for React Native is being explored, as well as collaboration with Meta. The ultimate aim is to make web code into universal code and enable developers to write code once and have it work on all platforms.
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
Watch video: Bringing React Server Components to React Native
React Server Components (RSC) offer a more accessible approach within the React model, addressing challenges like big initial bundle size and unnecessary data over the network. RSC can benefit React Native development by adding a new server layer and enabling faster requests. They also allow for faster publishing of changes in mobile apps and can be integrated into federated super apps. However, implementing RSC in mobile apps requires careful consideration of offline-first apps, caching, and Apple's review process.
React Native Kotlin Multiplatform Toolkit
React Day Berlin 2022React Day Berlin 2022
26 min
React Native Kotlin Multiplatform Toolkit
Top Content
The Talk discusses the combination of React Native and Kotlin Multiplatform for cross-platform app development. Challenges with native modules in React Native are addressed, and the potential improvements of using Kotlin Multiplatform Mobile are explored. The integration of Kotlin Multiplatform with React Native streamlines native implementation and eliminates boilerplate code. Questions about architecture and compatibility, as well as the possibility of supporting React Native Web, are discussed. The React Native toolkit works with native animations and has potential for open-source development.
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
This Talk discusses building cross-platform component libraries for React and React Native, based on a successful project with a large government-owned news organization. It covers the requirements for React Native knowledge, building cross-platform components, platform-specific components, styling, and the tools used. The Talk also highlights the challenges of implementing responsive design in React Native.
MDX in React-Native!?
React Advanced Conference 2021React Advanced Conference 2021
21 min
MDX in React-Native!?
Top Content
This Talk is about the development of MDX, a combination of Markdown and JSX, by a freelance full stack JavaScript developer. MDX is a powerful technology that allows for the creation of interactive content within blog posts and supports React components. The speaker developed RnMDX, a proper and polished MDX library for React Native, which can be dropped into any React Native app. RnMDX provides solutions for common issues with Markdown content in React Native and allows for the rendering of MDX content into native views. Bringing MDX into native apps is now easier, and it can be used for various purposes, such as serving the app layout from a CMS or creating interactive online magazines or blogs.

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
Build a powerful DataGrid in few hours with Ag Grid
React Summit US 2023React Summit US 2023
96 min
Build a powerful DataGrid in few hours with Ag Grid
Top Content
WorkshopFree
Mike Ryan
Mike Ryan
Does your React app need to efficiently display lots (and lots) of data in a grid? Do your users want to be able to search, sort, filter, and edit data? AG Grid is the best JavaScript grid in the world and is packed with features, highly performant, and extensible. In this workshop, you’ll learn how to get started with AG Grid, how we can enable sorting and filtering of data in the grid, cell rendering, and more. You will walk away from this free 3-hour workshop equipped with the knowledge for implementing AG Grid into your React application.
We all know that rolling our own grid solution is not easy, and let's be honest, is not something that we should be working on. We are focused on building a product and driving forward innovation. In this workshop, you'll see just how easy it is to get started with AG Grid.
Prerequisites: Basic React and JavaScript
Workshop level: Beginner
Build a Powerful Datagrid With AG Grid
React Summit 2024React Summit 2024
168 min
Build a Powerful Datagrid With AG Grid
WorkshopFree
Brian Love
Brian Love
Does your React app need to efficiently display lots (and lots) of data in a grid? Do your users want to be able to search, sort, filter, and edit data? AG Grid is the best JavaScript grid in the world and is packed with features, highly performant, and extensible. In this workshop, you’ll learn how to get started with AG Grid, how we can enable sorting and filtering of data in the grid, cell rendering, and more. You will walk away from this free 3-hour workshop equipped with the knowledge for implementing AG Grid into your React application.
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