Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Security Vulnerabilities Fix - Cyrex Penetration Test 2025
Summary
This PR addresses 7 security vulnerabilities identified in the Cyrex penetration test report for Pali Wallet 2025. The fixes span both the
pali-walletandsysweb3-keyringrepositories, implementing defense-in-depth security measures while maintaining backward compatibility for existing users.Vulnerabilities Addressed
Detailed Changes
🔐 Vulnerability 001 & 007: Cryptographic Improvements (sysweb3-keyring)
Problem:
Solution:
Implemented PBKDF2-based key derivation with proper separation of concerns:
Vault Version System:
Migration Strategy:
Files Changed:
packages/sysweb3-keyring/src/keyring-manager.ts🔑 Vulnerability 002: Password Complexity Requirements (pali-wallet)
Problem:
Passwords only required 8 characters with 1 lowercase and 1 number - too weak for protecting cryptocurrency.
Solution:
Strengthened password requirements:
Regex Pattern:
/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]).{12,}$/Files Changed:
source/components/PasswordForm/PasswordForm.tsxsource/assets/locales/en.jsonsource/assets/locales/es.jsonsource/assets/locales/pt.jsonsource/assets/locales/de.jsonsource/assets/locales/fr.jsonsource/assets/locales/ja.jsonsource/assets/locales/ko.jsonsource/assets/locales/ru.jsonsource/assets/locales/zh.json📋 Vulnerability 003: Clipboard Attack Prevention (pali-wallet)
Problem:
Copy buttons for seed phrases and private keys allowed users to place sensitive data on the clipboard, where malicious websites could read it.
Solution:
select-noneCSS to prevent text selectionFiles Changed:
source/components/Input/SeedPhraseDisplay.tsxsource/pages/Settings/Phrase.tsxsource/pages/Settings/ForgetWallet.tsxsource/pages/Settings/PrivateKey.tsxsource/pages/SeedConfirm/CreatePhrase.tsx🚫 Vulnerability 004: Rate Limiting with Persistence (pali-wallet)
Problem:
Rate limiting for failed password attempts was only stored in memory - attackers could bypass it by restarting the browser.
Solution:
Implemented persistent rate limiting using chrome.storage:
Protected Methods:
unlock()- Main loginunlockFromController()- Controller unlockgetSeed()- View seed phrasegetPrivateKeyByAccountId()- View private keyforgetWallet()- Delete walletNew Public API:
getRemainingLockoutTime()- Returns seconds until lockout expires (for UI display)Files Changed:
source/scripts/Background/controllers/MainController.ts⏰ Vulnerability 005: ENS Cache Expiration (pali-wallet)
Problem:
ENS lookups were cached indefinitely, allowing stale data to persist. ENS names can change, creating security risks.
Solution:
Implemented 5-minute TTL for ENS cache entries:
Selectors Updated:
selectValidEnsCache- Returns only non-expired entriesselectEnsNameToAddress- Now uses valid cacheisEnsCacheEntryValid()- Helper to check entry validityFiles Changed:
source/state/vaultGlobal/index.tssource/state/vault/selectors.tssource/pages/Send/SendEth.tsxsource/pages/Send/Confirm.tsxsource/pages/Send/components/TransactionDetails.tsxsource/pages/Home/Panel/components/Transactions/EVM/EvmDetailsEnhanced.tsx📦 Vulnerability 006: Dependency Updates (pali-wallet)
Problem:
Multiple npm packages had known security vulnerabilities.
Solution:
Direct Dependency Updates:
Yarn Resolutions Added:
{ "resolutions": { "node-fetch": "^2.7.0", "axios": "^1.12.0", "node-forge": "^1.3.2", "valibot": "^1.2.0", "glob": "^10.5.0", "cookie": "^0.7.0", "tmp": "^0.2.4", "jws": "^4.0.1", "js-yaml": "^4.1.1" } }Vulnerabilities Patched:
Files Changed:
package.jsonSecurity Impact Summary
Migration & Backward Compatibility
Test Plan
Cryptographic Improvements (001 & 007)
Password Complexity (002)
Clipboard Prevention (003)
Rate Limiting (004)
ENS Cache (005)
Dependencies (006)
yarn installsuccessfullygrype .- verify vulnerability count reducedReferences
🤖 Generated with Claude Code