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

CC_MD5 is deprecated (in addition to being broken) #29590

Closed
jonthanon opened this issue Aug 7, 2020 · 8 comments
Closed

CC_MD5 is deprecated (in addition to being broken) #29590

jonthanon opened this issue Aug 7, 2020 · 8 comments
Labels
Impact: Security If the issue is causes a vulnerability Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon. Type: Security

Comments

@jonthanon
Copy link

Description

CC_MD5 is used in RCTUtils' function RCTMD5Hash(NSString *string) (here), which is used in RCTAsyncLocalStorage.mm and RNCAsyncStorage.m to get a file name. My company's security team has requested we remove all use of MD5, regardless of whether it's used for cryptographic purposes or called by our code. In addition to being cryptographically insecure (though that isn't relevant here since it doesn't seem to be used for cryptographic purposes), CC_MD5 was deprecated by Apple in iOS 13.

React Native version:

0.63.2 (based on running npx react-native info at the time of opening this issue)

Steps To Reproduce

  1. Follow the React Native CLI Quickstart version of the Setting up the development environment documentation.
  2. In Step 2 of "Running your React Native application", open Xcode instead of using run-ios.
  3. Change the iOS Deployment Target for React-Core to iOS 13.0 (or higher).
  4. Build.

Expected Results

You shouldn't get any warnings, but for the scope of this issue, you shouldn't get any warnings about CC_MD5 being deprecated.

Snack, code example, screenshot, or link to a repository:

Here's the resulting error you'll get in the issue navigator on the left.

/Code/AwesomeProject/AwesomeProject/node_modules/react-native/React/Base/RCTUtils.m:224:3: 'CC_MD5' is deprecated: first deprecated in iOS 13.0 - This function is cryptographically broken and should not be used in security contexts. Clients should migrate to SHA256 (or stronger).

@safaiyeh
Copy link
Contributor

safaiyeh commented Aug 8, 2020

Hi @jonthanon some history for this.

RCTAsyncLocalStorage eventually became the community module async-storage as part of the Lean Core efforts; however, the module stayed in React Native core as Facebook has a dependency on it and needs to migrate out of it internally.
cc @cpojer for updates on that.

There are two options that could be taken
• Migrate out of the CC_MD5 deprecation
• Maintain a fork of React Native and removing AsyncLocalStorage until React Native core can fully remove it

Second option will help you out a bit quicker to resolve your security concerns.

@cpojer
Copy link
Contributor

cpojer commented Aug 9, 2020

Unfortunately we haven't gotten around to cleaning up the repo yet. How did the open source version of async storage deal with the same issue? Can we backport the fix for now?

@safaiyeh
Copy link
Contributor

safaiyeh commented Aug 10, 2020

@cpojer It looks like async-storage also depends on the RCTMD5Hash https://github.com/react-native-community/async-storage/blob/af2664e5334175a180d71e22fe10e184904d63ff/ios/RNCAsyncStorage.m#L365

I'll file an issue with them and that should be back ported to core.

@jonthanon
Copy link
Author

@safaiyeh Awesome, thanks for the info. I'll move my questions to the new community thread.

@stale
Copy link

stale bot commented Dec 25, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 25, 2020
@jonthanon
Copy link
Author

Nope, still repros in 0.63.4. See also react-native-async-storage/async-storage#415, which is linked above and is where the initial fix is (theoretically) happening.

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Jan 5, 2021
@cipolleschi cipolleschi added the Impact: Security If the issue is causes a vulnerability label May 17, 2022
@github-actions
Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jun 21, 2023
@github-actions
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Impact: Security If the issue is causes a vulnerability Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon. Type: Security
Projects
None yet
Development

No branches or pull requests

4 participants