Last active
March 18, 2022 06:19
-
-
Save superche/d12f3fb5083426f9179d5cbb21d47ed0 to your computer and use it in GitHub Desktop.
node-ipc cve check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// /usr/local/bin/node | |
const fs = require('fs'); | |
const blackList = [{ | |
name: 'node-ipc', | |
affectingVersion: '>=10.1.1 <10.1.3', | |
}]; | |
const packages = fs.readdirSync('./node_modules'); | |
const dangerList = []; | |
blackList.forEach(item => { | |
if (packages.includes(item.name)) { | |
dangerList.push(item); | |
} | |
}); | |
if (dangerList.length) { | |
console.error(`危险包存在,请检查是否为受影响版本: 共${dangerList.length}个`); | |
dangerList.forEach(item => { | |
console.error(`${item.name}: 受影响版本 ${item.affectingVersion}`); | |
}); | |
} else { | |
console.log('检测无毒'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment