Due to recent npm ecosystem vulnerabilities and supply chain attacks, we follow strict dependency practices:
All new npm packages must be at least 7 days old before integration.
- Check package publish date:
npm view <package> time.created - Verify publish history: https://www.npmjs.com/package/
- Wait for community security review & CVE discovery window
- Use
npm auditbefore upgrading
All packages in frontend/package.json are production-tested and stable:
react@^18.2.0- Core UI frameworkreact-dom@^18.2.0- DOM rendererreact-router-dom@^6.20.0- Routingaxios@^1.6.0- HTTP clientrecharts@^2.10.0- Charting library@tanstack/react-query@^5.25.0- Data fetching
- Pin major versions - Use
^for patches/minors, but lock majors - Review
package-lock.json- Commit lock file to git - Run
npm auditregularly - Check for known vulnerabilities - Audit transitive dependencies - Use
npm lsto inspect tree - Update cautiously - Test updates in isolated branch first
- Monitor CVE databases:
- GitHub Security Advisories
- npm public advisories
- Snyk vulnerability tracker
When adding or updating packages:
# Check age of package
npm view <package> time
# Add package (waits 7+ days before integrating)
npm install <package>
# Audit before committing
npm audit
# Review lock file changes
git diff package-lock.json
# Commit lock file with changes
git add package-lock.json package.json
git commit -m "Add <package> - published 7+ days ago, audit clean"Similar practices apply to Python packages in backend/requirements.txt:
- All packages from PyPI with established track records
- Consider using
pip-auditfor vulnerability scanning - Lock versions in production:
pip freeze > requirements.lock - Review
pipdeptreefor dependency chains