
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
react-native-cookie-parser
Advanced tools
This library is a basic cookie parser which uses the algorithms defined in RFC 6265.
react-native-sensitive-info is used as the storage manager
react-native-url-polyfill is used to parse URLs
yarn add react-native-cookie-parser
npm install react-native-cookie-parser
import { CookieManager } from 'react-native-cookie-parser'
const cookieManager = new CookieManager()
// Recommended to use inside a response interceptor
await cookieManager.insertCookiesFromHeader(
["A=B; path=/; expires=2022-03-11T13:06:49Z; domain=example.ro; secure", "C=Z; path=/; secure", "E=G; path=/"],
"https://example.ro/"
)
// Fetches cookies from store
// Format -> A=B; C=Z; E=G
let cookies = await cookieManager.getConcatenatedCookies(
"https://example.ro/"
)
// Clear store (usually on logout)
await cookieManager.clear()
On every insert/get the expired cookies are removed
If you want to store additional security tokens, you can use TokenManager
import { TokenManager } from 'react-native-cookie-parser'
const tokenManager = new TokenManager()
await tokenManager.setAuthTokens({"a": "b", "c": "d", "e": "f"})
let tokens = await tokenManager.getAuthTokens()
// Clear store
await wipeAuthTokens()
Both CookieManager and TokenManager have an optional string argument. This string is used to set the key name which identifies the bulk item from storage manager.
CookieManager default: "PACKED_COOKIES_NAME"
TokenManager default: "PACKED_TOKENS_NAME"
FAQs
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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.