-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
fix(logging): avoid logging sensitive param values #31522
Conversation
|
Base commit: ca499a6 |
Base commit: ca499a6 |
Have you considered using https://www.npmjs.com/package/babel-plugin-transform-remove-console or something similar? That will cut down on your bundle size too. |
I guess a better question is: are we OK with this verbose logging as default behaviour in all apps powered by React Native? |
@charlesbdudley has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
This pull request was successfully merged by @sterlingwes in e612d3a. When will my fix make it into a release? | Upcoming Releases |
Summary: We noticed that by default when the RootView / ReactView calls runApplication, we're logging at an info level any props ("params") passed to that component. In our case, one of these props was sensitive in nature, causing the value to leak out in logs for our release builds. This is especially problematic on Android where device logs can be accessed by any app which requests that permission. This is probably more of a concern for brownfield react-native apps, but it seems worthwhile locking this down in non-dev builds. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [General] [Security] - Avoiding logging root view params outside of dev / debug mode builds Pull Request resolved: facebook#31522 Test Plan: * build app in release mode on Android and verified I could not see: `Running "my app" with { sensitive: 'thing' }` in logcat in Android Studio with a tethered device Reviewed By: yungsters Differential Revision: D31064902 Pulled By: charlesbdudley fbshipit-source-id: 8b10a46d92a9ec44243dd74384299087260c7d83
Summary: We noticed that by default when the RootView / ReactView calls runApplication, we're logging at an info level any props ("params") passed to that component. In our case, one of these props was sensitive in nature, causing the value to leak out in logs for our release builds. This is especially problematic on Android where device logs can be accessed by any app which requests that permission. This is probably more of a concern for brownfield react-native apps, but it seems worthwhile locking this down in non-dev builds. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [General] [Security] - Avoiding logging root view params outside of dev / debug mode builds Pull Request resolved: facebook#31522 Test Plan: * build app in release mode on Android and verified I could not see: `Running "my app" with { sensitive: 'thing' }` in logcat in Android Studio with a tethered device Reviewed By: yungsters Differential Revision: D31064902 Pulled By: charlesbdudley fbshipit-source-id: 8b10a46d92a9ec44243dd74384299087260c7d83
Summary: We noticed that by default when the RootView / ReactView calls runApplication, we're logging at an info level any props ("params") passed to that component. In our case, one of these props was sensitive in nature, causing the value to leak out in logs for our release builds. This is especially problematic on Android where device logs can be accessed by any app which requests that permission. This is probably more of a concern for brownfield react-native apps, but it seems worthwhile locking this down in non-dev builds. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [General] [Security] - Avoiding logging root view params outside of dev / debug mode builds Pull Request resolved: facebook#31522 Test Plan: * build app in release mode on Android and verified I could not see: `Running "my app" with { sensitive: 'thing' }` in logcat in Android Studio with a tethered device Reviewed By: yungsters Differential Revision: D31064902 Pulled By: charlesbdudley fbshipit-source-id: 8b10a46d92a9ec44243dd74384299087260c7d83
Summary
We noticed that by default when the RootView / ReactView calls runApplication, we're logging at an info level any props ("params") passed to that component. In our case, one of these props was sensitive in nature, causing the value to leak out in logs for our release builds. This is especially problematic on Android where device logs can be accessed by any app which requests that permission.
This is probably more of a concern for brownfield react-native apps, but it seems worthwhile locking this down in non-dev builds.
Changelog
[General] [Security] - Avoiding logging root view params outside of dev / debug mode builds
Test Plan
Running "my app" with { sensitive: 'thing' }
in logcat in Android Studio with a tethered device