mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-06-26 19:18:43 +00:00
Compare commits
4 Commits
1be5b348c5
...
2836cfd0f5
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2836cfd0f5 | ||
![]() |
1aab8b2d5a | ||
![]() |
27dea683a5 | ||
![]() |
c0e6d8f332 |
117
.github/INCIDENT_RESPONSE_PLAN.md
vendored
Normal file
117
.github/INCIDENT_RESPONSE_PLAN.md
vendored
Normal file
@ -0,0 +1,117 @@
|
||||
# Incident Response Process for **nvm**
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
We take the security of **nvm** very seriously. If you believe you’ve found a security vulnerability, please inform us responsibly through coordinated disclosure.
|
||||
|
||||
### How to Report
|
||||
|
||||
> **Do not** report security vulnerabilities through public GitHub issues, discussions, or social media.
|
||||
|
||||
Instead, please use one of these secure channels:
|
||||
|
||||
1. **GitHub Security Advisories**
|
||||
Use the **Report a vulnerability** button in the Security tab of the [nvm-sh/nvm repository](https://github.com/nvm-sh/nvm).
|
||||
|
||||
2. **Email**
|
||||
Follow the posted [Security Policy](https://github.com/nvm-sh/nvm/security/policy).
|
||||
|
||||
### What to Include
|
||||
|
||||
**Required Information:**
|
||||
- Brief description of the vulnerability type
|
||||
- Affected version(s) and components
|
||||
- Steps to reproduce the issue
|
||||
- Impact assessment (what an attacker could achieve)
|
||||
|
||||
**Helpful Additional Details:**
|
||||
- Full paths of affected scripts or files
|
||||
- Specific commit or branch where the issue exists
|
||||
- Required configuration to reproduce
|
||||
- Proof-of-concept code (if available)
|
||||
- Suggested mitigation or fix
|
||||
|
||||
## Our Response Process
|
||||
|
||||
**Timeline Commitments:**
|
||||
- **Initial acknowledgment**: Within 24 hours
|
||||
- **Detailed response**: Within 3 business days
|
||||
- **Status updates**: Every 7 days until resolved
|
||||
- **Resolution target**: 90 days for most issues
|
||||
|
||||
**What We’ll Do:**
|
||||
1. Acknowledge your report and assign a tracking ID
|
||||
2. Assess the vulnerability and determine severity
|
||||
3. Develop and test a fix
|
||||
4. Coordinate disclosure timeline with you
|
||||
5. Release a security update and publish an advisory and CVE
|
||||
6. Credit you in our security advisory (if desired)
|
||||
|
||||
## Disclosure Policy
|
||||
|
||||
- **Coordinated disclosure**: We’ll work with you on timing
|
||||
- **Typical timeline**: 90 days from report to public disclosure
|
||||
- **Early disclosure**: If actively exploited
|
||||
- **Delayed disclosure**: For complex issues
|
||||
|
||||
## Scope
|
||||
|
||||
**In Scope:**
|
||||
- **nvm** project (all supported versions)
|
||||
- Installation and update scripts (`install.sh`, `nvm.sh`)
|
||||
- Official documentation and CI/CD integrations
|
||||
- Dependencies with direct security implications
|
||||
|
||||
**Out of Scope:**
|
||||
- Third-party forks or mirrors
|
||||
- Platform-specific installs outside core scripts
|
||||
- Social engineering or physical attacks
|
||||
- Theoretical vulnerabilities without practical exploitation
|
||||
|
||||
## Security Measures
|
||||
|
||||
**Our Commitments:**
|
||||
- Regular vulnerability scanning via GitHub Actions
|
||||
- Automated security checks in CI/CD pipelines
|
||||
- Secure scripting practices and mandatory code review
|
||||
- Prompt patch releases for critical issues
|
||||
|
||||
**User Responsibilities:**
|
||||
- Keep **nvm** updated
|
||||
- Verify script downloads via PGP signatures
|
||||
- Follow secure configuration guidelines for shell environments
|
||||
|
||||
## Legal Safe Harbor
|
||||
|
||||
**We will NOT:**
|
||||
- Initiate legal action
|
||||
- Contact law enforcement
|
||||
- Suspend or terminate your access
|
||||
|
||||
**You must:**
|
||||
- Only test against your own installations
|
||||
- Not access, modify, or delete user data
|
||||
- Not degrade service availability
|
||||
- Not publicly disclose before coordinated disclosure
|
||||
- Act in good faith
|
||||
|
||||
## Recognition
|
||||
|
||||
- **Advisory Credits**: Credit in GitHub Security Advisories (unless anonymous)
|
||||
|
||||
## Security Updates
|
||||
|
||||
**Stay Informed:**
|
||||
- Subscribe to GitHub releases for **nvm**
|
||||
- Enable GitHub Security Advisory notifications
|
||||
|
||||
**Update Process:**
|
||||
- Patch releases (e.g., v0.40.3 → v0.40.4)
|
||||
- Out-of-band releases for critical issues
|
||||
- Advisories via GitHub Security Advisories
|
||||
|
||||
## Contact Information
|
||||
|
||||
- **Security reports**: Security tab of [nvm-sh/nvm](https://github.com/nvm-sh/nvm/security)
|
||||
- **General inquiries**: GitHub Discussions or Issues
|
||||
|
17
.github/SECURITY.md
vendored
17
.github/SECURITY.md
vendored
@ -1,6 +1,6 @@
|
||||
# Security
|
||||
|
||||
Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report.
|
||||
Please file a private vulnerability report via GitHub, email [@ljharb](https://github.com/ljharb), or see https://tidelift.com/security if you have a potential security vulnerability to report.
|
||||
|
||||
## OpenSSF CII Best Practices
|
||||
|
||||
@ -12,16 +12,17 @@ There are three “tiers”: passing, silver, and gold.
|
||||
We meet 100% of the “passing” criteria.
|
||||
|
||||
### Silver
|
||||
We meet 95% of the “silver” criteria. The gaps are as follows:
|
||||
- we do not have a DCO or a CLA process for contributions.
|
||||
- because we only have one maintainer, the project has no way to continue if that maintainer stops being active.
|
||||
- we do not currently document “what the user can and cannot expect in terms of security” for our project. This is planned to be completed in 2023.
|
||||
We meet 100% of the “silver” criteria.
|
||||
|
||||
### Gold
|
||||
We meet 65% of the “gold” criteria. The gaps are as follows:
|
||||
- we do not yet have the “silver” badge; see all the gaps above.
|
||||
We meet 78% of the “gold” criteria. The gaps are as follows:
|
||||
- because we only have one maintainer, the project has no way to continue if that maintainer stops being active.
|
||||
- We do not include a copyright or license statement in each source file. Efforts are underway to change this archaic practice into a suggestion instead of a hard requirement.
|
||||
|
||||
## Threat Model
|
||||
|
||||
See [THREAT_MODEL.md](./THREAT_MODEL.md).
|
||||
See [THREAT_MODEL.md](.github/THREAT_MODEL.md).
|
||||
|
||||
## Incident Response Plan
|
||||
|
||||
Please see our [Incident Response Plan](.github/INCIDENT_RESPONSE_PLAN.md).
|
||||
|
5
nvm.sh
5
nvm.sh
@ -715,6 +715,11 @@ nvm_ensure_version_installed() {
|
||||
LOCAL_VERSION="$(nvm_version "${PROVIDED_VERSION}")"
|
||||
EXIT_CODE="$?"
|
||||
local NVM_VERSION_DIR
|
||||
|
||||
if [ "_$PROVIDED_VERSION" = "_N/A" ] && [ ! -d "$NVM_RC_VERSION" ] ; then
|
||||
PROVIDED_VERSION="$(nvm_ensure_version_prefix "$NVM_RC_VERSION")"
|
||||
fi
|
||||
|
||||
if [ "${EXIT_CODE}" != "0" ] || ! nvm_is_version_installed "${LOCAL_VERSION}"; then
|
||||
if VERSION="$(nvm_resolve_alias "${PROVIDED_VERSION}")"; then
|
||||
nvm_err "N/A: version \"${PROVIDED_VERSION} -> ${VERSION}\" is not yet installed."
|
||||
|
@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -ex
|
||||
|
||||
die () { echo $@ ; exit 1; }
|
||||
|
||||
. ../../../nvm.sh
|
||||
|
||||
echo "v0.10.28" > .nvmrc
|
||||
OUTPUT="$(nvm use 2>&1 >/dev/null | awk 'NR==1')"
|
||||
EXPECTED_OUTPUT='N/A: version "v0.10.28" is not yet installed.'
|
||||
TESTTT="$(nvm use 2>&1 >/dev/null)"
|
||||
TESTT="$(nvm use 2>&1)"
|
||||
TEST="$(nvm use)"
|
||||
|
||||
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] \
|
||||
|| die "'nvm use' did not output: '$EXPECTED_OUTPUT'; got: '$OUTPUT'; Normal: $TEST; with 2>&1: $TESTT; with /null: $TESTTT"
|
||||
|
||||
OUTPUT="$(nvm use 2>&1 >/dev/null | awk 'NR==3')"
|
||||
EXPECTED_OUTPUT='You need to run "nvm install v0.10.28" to install it before using it.'
|
||||
|
||||
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] \
|
||||
|| die "'nvm use' did not output: '$EXPECTED_OUTPUT'; got: '$OUTPUT'"
|
@ -19,5 +19,9 @@ for VERSION in "1.0.0" "1.0.1"; do
|
||||
nvm install "iojs-v$VERSION"
|
||||
done
|
||||
|
||||
if [ -f ".nvmrc" ]; then
|
||||
mv .nvmrc .nvmrc.bak
|
||||
fi
|
||||
|
||||
nvm_make_alias lts/testing 0.10.1
|
||||
nvm_make_alias 'lts/*' lts/testing
|
||||
|
@ -20,3 +20,9 @@ if [ -d "${NVM_DIR}/.nvm_use_lts_alias_bak" ]; then
|
||||
mv "${NVM_DIR}/.nvm_use_lts_alias_bak/*" "${NVM_DIR}/alias/lts/"
|
||||
rmdir "${NVM_DIR}/.nvm_use_lts_alias_bak"
|
||||
fi
|
||||
|
||||
rm .nvmrc
|
||||
|
||||
if [ -f ".nvmrc.bak" ]; then
|
||||
mv .nvmrc.bak .nvmrc
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user