Skip to content

Commit

Permalink
feat: add defence to Command Injection
Browse files Browse the repository at this point in the history
add defence to Command Injection
  • Loading branch information
DuLinRain committed Jan 26, 2021
1 parent 5279786 commit 40b1cf3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
@@ -1,5 +1,8 @@
module.exports = function (packageName, { registry = '', timeout = null } = {}) {
try {
if (/[`$&{}[;|]/g.test(packageName) || /[`$&{}[;|]/g.test(registry)) {
return null
}
let version;

const config = {
Expand Down

0 comments on commit 40b1cf3

Please sign in to comment.