From 49459d4a3ce68587d48ffa8dead86fc9ed58e965 Mon Sep 17 00:00:00 2001 From: DuLinRain Date: Tue, 26 Jan 2021 11:55:57 +0800 Subject: [PATCH] feat: add test case for Command Injection Attack add test case for Command Injection Attack --- test/index.test.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/index.test.js b/test/index.test.js index 7426b16..2fdc9bb 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -16,4 +16,12 @@ describe('test webpack and webpackxxx', () => { }); expect(version).to.be.equal(null); }).timeout(10 * 1000); -}); \ No newline at end of file + + // test defence attack + it('test defence Command Injection Attack', () => { + const version = getVersion('get-npm-package-version; echo hehe; npm view get-npm-package-version', { + timeout: 100 + }); + expect(version).to.be.equal(null); + }).timeout(10 * 1000); +});