This document outlines the security guidelines for developers contributing to the Web3 Student Lab project. Ensuring the security of our codebase, user data, and smart contracts is a top priority.
- Never Commit Secrets: Do not commit API keys, passwords, or other secrets to the repository.
- Use Environment Variables: Store sensitive configuration in a
.envfile and use a package likedotenvto load them. .gitignore: Ensure that.envand other files containing secrets are included in the.gitignorefile.- Secret Scanning: We use GitHub's secret scanning to detect accidentally committed secrets. If a secret is leaked, rotate it immediately.
- Private Keys: Never share or commit private keys. Use hardware wallets or secure vault services for managing keys in production.
- User Data: Minimize the collection of personal data. Encrypt sensitive user information at rest and in transit.
- Blockchain Data: Remember that data stored on-chain is public. Do not store sensitive information directly on the blockchain unless it is encrypted.
- Input Validation: Always validate and sanitize user input to prevent common vulnerabilities like XSS and Injection.
- Dependency Management: Regularly update dependencies and use tools like
npm auditorsnykto check for known vulnerabilities. - Principle of Least Privilege: Grant only the minimum necessary permissions to services and users.
- Reentrancy Protection: Use
ReentrancyGuardor the checks-effects-interactions pattern. - Integer Overflows: Use Solidity 0.8+ or
SafeMathfor older versions. - Access Control: Use
OwnableorAccessControlto restrict sensitive functions. - Audit: High-stakes contracts should undergo a professional security audit before deployment.
For information on how to report vulnerabilities or see our security advisories, please refer to our GitHub Security Policy.
Last Updated: 2026-03-24