Installations
npm install npq
Developer Guide
Typescript
No
Module System
N/A
Min. Node Version
>=18
Node Version
20.17.0
NPM Version
10.8.3
Score
53.6
Supply Chain
95.1
Quality
80.7
Maintenance
100
Vulnerability
96.4
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (99.63%)
Shell (0.37%)
Developer
lirantal
Download Statistics
Total Downloads
73,920
Last Day
27
Last Week
406
Last Month
2,330
Last Year
31,706
GitHub Statistics
960 Stars
274 Commits
28 Forks
3 Watching
3 Branches
22 Contributors
Package Meta Information
Latest Version
3.5.3
Package Id
npq@3.5.3
Unpacked Size
3.10 MB
Size
1.55 MB
File Count
65
NPM Version
10.8.3
Node Version
20.17.0
Publised On
12 Sept 2024
Total Downloads
Cumulative downloads
Total Downloads
73,920
Last day
-69.7%
27
Compared to previous day
Last week
-17%
406
Compared to previous week
Last month
-8.1%
2,330
Compared to previous month
Last year
197%
31,706
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
safely* install packages with npm/yarn by auditing them as part of your install process
Media coverage about npq:
- As mentioned on Thomas Gentilhomme's French book of Become a Node.js Developer
- Tao Bojlén's A web of trust for npm
- Zander's favorite list of command line tools
- Ran Bar Zik's npq review to install safe modules
- ostechnix's How To Safely Install Packages Using Npm Or Yarn On Linux
- debricked's How to evaluate the security of your NPM Package dependencies
- JavaScript January advent calendar's post on Open Source From Heaven, Modules From Hell
- Liran Tal's Malicious Modules — what you need to know when installing npm packages
About
Once npq is installed, you can safely* install packages:
1npq install express
npq
will perform the following steps to sanity check that the package is safe by employing syntactic heuristics and querying a CVE database:
- Consult the snyk.io database of publicly disclosed vulnerabilities to check if a security vulnerability exists for this package and its version.
- Package age on npm
- Package download count as a popularity metric
- Package has a README file
- Package has a LICENSE file
- Package has pre/post install scripts
If npq is prompted to continue with the install, it simply hands over the actual package install job to the package manager (npm by default).
safely* - there's no guaranteed safety; a malicious or vulnerable package could still exist that has no security vulnerabilities publicly disclosed and passes npq's checks.
Install
1npm install -g npq
Note: we recommend installing with npm
rather than yarn
. That way, npq
can automatically install shell aliases for you.
Usage
Install packages with npq:
1npq install express
Embed in your day to day
Since npq
is a pre-step to ensure that the npm package you're installing is safe, you can safely embed it in your day-to-day npm
usage so there's no need to remember to run npq
explicitly.
1alias npm='npq-hero'
Offload to package managers
If you're using yarn
, or generally want to explicitly tell npq which package manager to use you can specify an environment variable: NPQ_PKG_MGR=yarn
Example: create an alias with yarn as the package manager:
1alias yarn="NPQ_PKG_MGR=yarn npq-hero"
Note: npq
by default will offload all commands and their arguments to the npm
package manager after it finished its due-diligence for the respective packages.
Marshalls
Marshall Name | Description | Notes |
---|---|---|
age | Will show a warning for a package if its age on npm is less than 22 days | Checks a package creation date, not a specific version |
author | Will show a warning if a package has been found without an author field | Checks the latest version for an author |
downloads | Will show a warning for a package if its download count in the last month is less than 20 | |
readme | Will show a warning if a package has no README or it has been detected as a security placeholder package by npm staff | |
repo | Will show a warning if a package has been found without a valid and working repository URL | Checks the latest version for a repository URL |
scripts | Will show a warning if a package has a pre/post install script which could potentially be malicious | |
snyk | Will show a warning if a package has been found with vulnerabilities in Snyk's database | For Snyk to work you need to either have the snyk npm package installed with a valid api token, or make the token available in the SNYK_TOKEN environment variable, and npq will use it |
license | Will show a warning if a package has been found without a license field | Checks the latest version for a license |
expired domains | Will show a warning if a package has been found with one of its maintainers having an email address that includes an expired domain | Checks a dependency version for a maintainer with an expired domain |
signatures | Will compare the package's signature as it shows on the registry's pakument with the keys published on the npmjs.com registry | |
provenance | Will verify the package's attestations of provenance metadata for the published package |
Disabling Marshalls
To disable a marshall altogether, set an environment variable using with the marshall's shortname.
Example, to disable the Snyk vulnerability marshall:
MARSHALL_DISABLE_SNYK=1 npq install express
Run checks on package without installing it:
1npq install express --dry-run
Learn Node.js Security
Learn Node.js Secure Coding techniques and best practices from Liran Tal
FAQ
- Can I use NPQ without having npm or yarn?
- NPQ will audit a package for possible security issues, but it isn't a replacement for npm or yarn. When you choose to continue installing the package, it will offload the installation process to your choice of either npm or yarn.
- How is NPQ different from npm audit?
npm install
will install a module even if it has vulnerabilities; NPQ will display the issues detected, and prompt the user for confirmation on whether to proceed installing it.- NPQ will run synthetic checks, called marshalls, on the characteristics of a module, such as whether the module you are going to install has a
pre-install
script which can be potentially harmful for your system and prompt you whether to install it. Whereasnpm audit
will not perform any such checks, and only consults a vulnerability database for known security issues. npm audit
is closer in functionality to what Snyk does, rather than what NPQ does.
- Do I require a Snyk API key in order to use NPQ?
- It's not required. If NPQ is unable to detect a Snyk API key for the user running NPQ, then it will skip the database vulnerabilities check. We do, however, greatly encourage you to use Snyk, and connect it with NPQ for broader security.
Contributing
Please consult the CONTRIBUTING for guidelines on contributing to this project
Author
Liran Tal liran.tal@gmail.com
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
security policy file detected
Details
- Info: security policy file detected: SECURITY.md:1
- Info: Found linked content: SECURITY.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1
- Info: Found text in security policy: SECURITY.md:1
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0
Reason
packaging workflow detected
Details
- Info: Project packages its releases by way of GitHub Actions.: .github/workflows/main.yml:37
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/lirantal/npq/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/lirantal/npq/main.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/lirantal/npq/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/lirantal/npq/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:49: update your workflow using https://app.stepsecurity.io/secureworkflow/lirantal/npq/main.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .husky/post-merge:4
- Info: 0 out of 4 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 third-party GitHubAction dependencies pinned
- Info: 2 out of 3 npmCommand dependencies pinned
Reason
8 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
Reason
0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/29 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/main.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 15 are checked with a SAST tool
Score
4.3
/10
Last Scanned on 2024-12-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More