We release patches for security vulnerabilities. Currently supported versions:
| Version | Supported |
|---|---|
| 0.1.x | ✅ |
Please do not report security vulnerabilities through public GitHub issues.
Instead, please report them via email to: security@khodpay.com
You should receive a response within 48 hours. If for some reason you do not, please follow up via email to ensure we received your original message.
Please include the following information:
- Type of issue (e.g., buffer overflow, SQL injection, cross-site scripting, etc.)
- Full paths of source file(s) related to the manifestation of the issue
- The location of the affected source code (tag/branch/commit or direct URL)
- Any special configuration required to reproduce the issue
- Step-by-step instructions to reproduce the issue
- Proof-of-concept or exploit code (if possible)
- Impact of the issue, including how an attacker might exploit it
This information will help us triage your report more quickly.
-
Keep Dependencies Updated
- Regularly update to the latest version
- Monitor security advisories
- Run
cargo auditregularly
-
Protect Sensitive Data
- Never log or print mnemonics, seeds, or private keys
- Store sensitive data encrypted at rest
- Use secure memory practices (this library uses
zeroize) - Never transmit sensitive data over insecure channels
-
Validate Inputs
- Always validate user-provided mnemonics
- Check derivation paths for validity
- Handle errors appropriately
-
Environment Security
- Use this library only in secure environments
- Ensure your system's RNG is properly seeded
- Keep your operating system and dependencies updated
-
Code Security
- Never use
unsafecode without thorough review - Follow Rust security best practices
- Use cryptographically secure primitives
- Validate all inputs and handle errors properly
- Never use
-
Testing
- Write security-focused test cases
- Test edge cases and error conditions
- Use fuzzing for cryptographic code
- Validate against official test vectors
-
Dependencies
- Minimize dependencies
- Use well-audited cryptographic libraries
- Keep dependencies updated
- Review dependency code for security issues
-
Review Process
- All changes require code review
- Security-sensitive changes require extra scrutiny
- Run security audits before releases
-
Entropy Source
- Uses system CSPRNG (
rand::thread_rng()) - Ensure your system has sufficient entropy
- Consider using hardware RNG for production
- Uses system CSPRNG (
-
Mnemonic Storage
- Never store mnemonics in plain text
- Use encrypted storage with strong passwords
- Consider hardware wallets for key storage
-
Passphrase Protection
- Passphrases provide additional security
- Lost passphrases cannot be recovered
- Use strong, memorable passphrases
-
Private Key Protection
- Private keys are zeroized after use
- Never expose private keys in logs or errors
- Use hardened derivation for account-level keys
-
Path Derivation
- Validate derivation paths before use
- Use standard paths (BIP44/49/84) when possible
- Understand hardened vs. normal derivation
-
Serialization
- Extended private keys (xprv) contain sensitive data
- Only share extended public keys (xpub) when necessary
- Never transmit xprv over insecure channels
This library uses the following cryptographic primitives:
- PBKDF2-HMAC-SHA512: Seed derivation (BIP39)
- HMAC-SHA512: Key derivation (BIP32)
- secp256k1: Elliptic curve operations
- SHA-256: Hashing
- RIPEMD-160: Address generation
All primitives are provided by well-audited Rust crates.
- v0.1.0 (2024-10-16): Initial release, no external audit yet
We plan to commission professional security audits for future releases.
We follow the principle of responsible disclosure:
- Reporter submits vulnerability privately
- We confirm and investigate the issue
- We develop and test a fix
- We release a security patch
- We publicly disclose the vulnerability after users have had time to update
Security updates will be released as soon as possible after a vulnerability is confirmed. We will:
- Release a patch version with the fix
- Update the security advisory
- Notify users through GitHub releases and security advisories
- Update documentation with mitigation steps
- Rust Security Guidelines
- OWASP Cryptographic Storage Cheat Sheet
- BIP39 Security Considerations
- BIP32 Security Considerations
- Security Email: security@khodpay.com
- General Support: support@khodpay.com
- GitHub Issues: For non-security bugs only
Thank you for helping keep KhodPay Wallet Libraries secure!