
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
react-native-ssl-manager
Advanced tools
React Native SSL Pinning provides seamless SSL certificate pinning integration for enhanced network security in React Native apps. This module enables developers to easily implement and manage certificate pinning, protecting applications against man-in-th
React Native SSL Pinning provides seamless SSL certificate pinning integration for enhanced network security in React Native apps. This module enables developers to easily implement and manage certificate pinning, protecting applications against man-in-the-middle (MITM) attacks. With dynamic configuration options and the ability to toggle SSL pinning, it's particularly useful for development and testing scenarios.
npm install react-native-ssl-manager
import {
initializeSslPinning,
setUseSSLPinning,
getUseSSLPinning
} from 'react-native-ssl-manager';
// Initialize SSL pinning with configuration
const sslConfig = {
"domains": {
"development": "api.dev.example.com",
"production": "api.example.com"
},
"sha256Keys": {
"api.dev.example.com": [
"sha256/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=",
"sha256/YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY="
],
"api.example.com": [
"sha256/ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ=",
"sha256/WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW="
]
}
};
// Initialize the SSL pinning
await initializeSslPinning(JSON.stringify(sslConfig));
// Enable SSL pinning
await setUseSSLPinning(true);
// Check if SSL pinning is enabled
const isEnabled = await getUseSSLPinning();
console.log('SSL Pinning enabled:', isEnabled);
Create a configuration file with your domain certificates. Example structure:
{
"domains": {
"development": "api.dev.example.com",
"production": "api.example.com"
},
"sha256Keys": {
"api.dev.example.com": [
"sha256/certificate-hash-1=",
"sha256/certificate-hash-2="
],
"api.example.com": [
"sha256/certificate-hash-3=",
"sha256/certificate-hash-4="
]
}
}
initializeSslPinning(configJsonString: string): Promise<any>
Initializes the SSL pinning configuration with the provided JSON string configuration.
await initializeSslPinning(JSON.stringify(sslConfig));
setUseSSLPinning(usePinning: boolean): void
Enables or disables SSL pinning dynamically.
await setUseSSLPinning(true); // Enable SSL pinning
await setUseSSLPinning(false); // Disable SSL pinning
getUseSSLPinning(): Promise<boolean>
Retrieves the current state of SSL pinning.
const isEnabled = await getUseSSLPinning();
When using setUseSSLPinning
, a restart of the application is required for changes to take effect. This is because SSL pinning is implemented at the native level.
First, install react-native-restart:
# Using npm
npm install react-native-restart
# Using yarn
yarn add react-native-restart
For iOS, run pod install:
cd ios && pod install
Then use it in your code:
import RNRestart from 'react-native-restart';
const toggleSSLPinning = async (enabled: boolean) => {
await setUseSSLPinning(enabled);
// Restart the app to apply changes
RNRestart.Restart();
};
// Example with user confirmation
const handleSSLToggle = async (enabled: boolean) => {
// Save any necessary state
await saveAppState();
// Update SSL pinning
await setUseSSLPinning(enabled);
// Show user message
Alert.alert(
'Restart Required',
'The app needs to restart to apply security changes.',
[
{
text: 'Restart Now',
onPress: () => RNRestart.Restart()
}
]
);
};
Environment Management
Performance Optimization
Security Considerations
We're actively working on expanding the capabilities of react-native-ssl-manager. Here are our planned features:
Proxyman is a powerful tool for testing SSL pinning implementation. Here's how you can verify your SSL pinning configuration:
Install Proxyman
Testing SSL Pinning
// Enable SSL Pinning
await setUseSSLPinning(true);
// Make API requests through your app
// If SSL pinning is working correctly:
// - Requests will fail when Proxyman tries to intercept them
// - You'll see SSL/TLS handshake errors
// Disable SSL Pinning for debugging
await setUseSSLPinning(false);
// Now you can intercept and inspect API calls with Proxyman
Verify SSL Pinning is Active
Debug API Calls
Certificate Validation
This integration with Proxyman makes it easy to:
See the contributing guide to learn how to contribute to the repository and the development workflow.
For open source projects, say how it is licensed.
Made with create-react-native-library
FAQs
React Native SSL Pinning provides seamless SSL certificate pinning integration for enhanced network security in React Native apps. This module enables developers to easily implement and manage certificate pinning, protecting applications against man-in-th
The npm package react-native-ssl-manager receives a total of 39 weekly downloads. As such, react-native-ssl-manager popularity was classified as not popular.
We found that react-native-ssl-manager demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.