expo-dev-launcher 58.0.3 → 58.0.4

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/CHANGELOG.md CHANGED
@@ -10,6 +10,12 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 58.0.4 — 2026-09-21
14
+
15
+ ### 🎉 New features
16
+
17
+ - [iOS] Answer a fingerprint check on a physical device from a debug build, so a tool can read the fingerprint the build embedded. ([#49494](https://github.com/expo/expo/pull/49494) by [@vonovak](https://github.com/vonovak))
18
+
13
19
  ## 58.0.3 — 2026-09-16
14
20
 
15
21
  _This version does not introduce any user-facing changes._
@@ -24,13 +24,13 @@ expoModule {
24
24
  }
25
25
 
26
26
  group = "host.exp.exponent"
27
- version = "58.0.3"
27
+ version = "58.0.4"
28
28
 
29
29
  android {
30
30
  namespace "expo.modules.devlauncher"
31
31
  defaultConfig {
32
32
  versionCode 9
33
- versionName "58.0.3"
33
+ versionName "58.0.4"
34
34
  }
35
35
 
36
36
  buildTypes {
@@ -1,2 +1,2 @@
1
- #Wed Sep 16 23:48:06 IST 2026
1
+ #Mon Sep 21 11:42:05 IST 2026
2
2
  gradle.version=9.4.1
@@ -314,6 +314,10 @@ static const NSTimeInterval EXDevLauncherDefaultRequestTimeout = 10.0;
314
314
 
315
315
  - (BOOL)onDeepLink:(NSURL *)url options:(NSDictionary *)options
316
316
  {
317
+ if ([EXDevLauncherFingerprintCheck handle:url]) {
318
+ return YES;
319
+ }
320
+
317
321
  if (![EXDevLauncherURLHelper isDevLauncherURL:url]) {
318
322
  return [self _handleExternalDeepLink:url options:options];
319
323
  }
@@ -0,0 +1,141 @@
1
+ // Copyright 2015-present 650 Industries. All rights reserved.
2
+
3
+ import Foundation
4
+ import ExpoModulesCore
5
+
6
+ /** A validated trigger URL. Separate from the POST so the SSRF guard is unit-testable. */
7
+ internal struct FingerprintCheckRequest: Equatable {
8
+ private typealias Check = EmbeddedFingerprint.CheckProtocol
9
+
10
+ let nonce: String
11
+ let callback: URL
12
+
13
+ internal static func parse(_ url: URL) -> FingerprintCheckRequest? {
14
+ guard let components = URLComponents(url: url, resolvingAgainstBaseURL: false),
15
+ let queryItems = components.queryItems else {
16
+ return nil
17
+ }
18
+ func query(_ name: String) -> String? {
19
+ return queryItems.first { $0.name == name }?.value
20
+ }
21
+
22
+ // Matched on a reserved query parameter, not a host: hosts belong to the app's own routes.
23
+ let marked = queryItems.contains { $0.name == Check.markerParam && $0.value == Check.markerValue }
24
+ guard marked else {
25
+ return nil
26
+ }
27
+ guard let nonce = query(Check.nonceParam), !nonce.isEmpty else {
28
+ return nil
29
+ }
30
+ guard let callbackValue = query(Check.callbackParam),
31
+ let callback = URL(string: callbackValue),
32
+ isReachableCallback(callback) else {
33
+ return nil
34
+ }
35
+ return FingerprintCheckRequest(nonce: nonce, callback: callback)
36
+ }
37
+
38
+ private static func isReachableCallback(_ url: URL) -> Bool {
39
+ // The CLI never emits https, and https to an IP literal would fail TLS anyway.
40
+ guard url.scheme == "http",
41
+ url.path == Check.callbackPath,
42
+ let host = url.host else {
43
+ return false
44
+ }
45
+ return isPrivateAddress(host)
46
+ }
47
+ }
48
+
49
+ /**
50
+ * True when `host` is an IP literal in a private or link-local range, resolving no DNS names.
51
+ * This is the SSRF guard: without it a web page could deep-link a debug build with a callback
52
+ * pointing anywhere.
53
+ */
54
+ internal func isPrivateAddress(_ host: String) -> Bool {
55
+ var ipv4Addr = in_addr()
56
+ if host.withCString({ inet_pton(AF_INET, $0, &ipv4Addr) }) == 1 {
57
+ let address = UInt32(bigEndian: ipv4Addr.s_addr)
58
+ return isPrivateIPv4(UInt8(address >> 24), UInt8(address >> 16 & 0xFF))
59
+ }
60
+
61
+ var ipv6Addr = in6_addr()
62
+ if host.withCString({ inet_pton(AF_INET6, $0, &ipv6Addr) }) == 1 {
63
+ let bytes = withUnsafeBytes(of: ipv6Addr) { Array($0) }
64
+ return isPrivateIPv6(bytes[0], bytes[1])
65
+ }
66
+
67
+ return false
68
+ }
69
+
70
+ /** 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 (link-local), 100.64.0.0/10 (CGN). */
71
+ private func isPrivateIPv4(_ a: UInt8, _ b: UInt8) -> Bool {
72
+ switch (a, b) {
73
+ case (10, _): return true
74
+ case (172, 16...31): return true
75
+ case (192, 168): return true
76
+ case (169, 254): return true
77
+ case (100, 64...127): return true
78
+ default: return false
79
+ }
80
+ }
81
+
82
+ /** fc00::/7 (unique local) and fe80::/10 (link-local). */
83
+ private func isPrivateIPv6(_ b0: UInt8, _ b1: UInt8) -> Bool {
84
+ if (b0 & 0xFE) == 0xFC {
85
+ return true
86
+ }
87
+ if b0 == 0xFE && (b1 & 0xC0) == 0x80 {
88
+ return true
89
+ }
90
+ return false
91
+ }
92
+
93
+ /** Blocks HTTP redirects so a compromised callback endpoint can't retarget the POST. */
94
+ private class NoRedirectSessionDelegate: NSObject, URLSessionTaskDelegate {
95
+ func urlSession(
96
+ _ session: URLSession,
97
+ task: URLSessionTask,
98
+ willPerformHTTPRedirection response: HTTPURLResponse,
99
+ newRequest request: URLRequest,
100
+ completionHandler: @escaping (URLRequest?) -> Void
101
+ ) {
102
+ completionHandler(nil)
103
+ }
104
+ }
105
+
106
+ /**
107
+ * Answers a fingerprint-check trigger URL: a tool cannot read a physical device's app container,
108
+ * so the app posts its embedded fingerprint back instead.
109
+ */
110
+ @objc(EXDevLauncherFingerprintCheck)
111
+ public class EXDevLauncherFingerprintCheck: NSObject {
112
+ /** True when the URL was a trigger and this consumed it. */
113
+ @objc public static func handle(_ url: URL) -> Bool {
114
+ #if DEBUG
115
+ guard let request = FingerprintCheckRequest.parse(url) else {
116
+ return false
117
+ }
118
+
119
+ let body = EmbeddedFingerprint.checkResponseBody(
120
+ nonce: request.nonce,
121
+ fingerprint: EmbeddedFingerprint.read()
122
+ )
123
+
124
+ var urlRequest = URLRequest(url: request.callback)
125
+ urlRequest.httpMethod = "POST"
126
+ urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type")
127
+ urlRequest.httpBody = try? JSONSerialization.data(withJSONObject: body)
128
+ urlRequest.timeoutInterval = 10
129
+
130
+ // The session retains the redirect-blocking delegate until the task ends.
131
+ let delegate = NoRedirectSessionDelegate()
132
+ let session = URLSession(configuration: .ephemeral, delegate: delegate, delegateQueue: nil)
133
+ session.dataTask(with: urlRequest).resume()
134
+ session.finishTasksAndInvalidate()
135
+ return true
136
+ #else
137
+ // Debug only: a release app posting to a URL from a deep link would be an SSRF primitive.
138
+ return false
139
+ #endif
140
+ }
141
+ }
@@ -0,0 +1,177 @@
1
+ // Copyright 2015-present 650 Industries. All rights reserved.
2
+
3
+ import Testing
4
+
5
+ @testable import EXDevLauncher
6
+
7
+ @Suite("EXDevLauncherFingerprintCheck")
8
+ struct EXDevLauncherFingerprintCheckTests {
9
+ /// `host` defaults to a user-land route, to prove the marker alone selects the channel.
10
+ ///
11
+ /// The parameter names are spelled out rather than read from `CheckProtocol`: these
12
+ /// are the literals the agent CLI sends, so renaming the constant has to fail here.
13
+ private func triggerUrl(
14
+ host: String = "some-app-route",
15
+ marker: String? = "1",
16
+ nonce: String?,
17
+ callback: String?
18
+ ) -> URL {
19
+ var parts: [String] = []
20
+ if let marker {
21
+ parts.append("__expo_fingerprint_check=\(marker)")
22
+ }
23
+ if let nonce {
24
+ parts.append("__expo_fingerprint_nonce=\(nonce)")
25
+ }
26
+ if let callback {
27
+ let encoded = callback.addingPercentEncoding(withAllowedCharacters: .alphanumerics) ?? callback
28
+ parts.append("__expo_fingerprint_callback=\(encoded)")
29
+ }
30
+ return URL(string: "exp+app://\(host)?\(parts.joined(separator: "&"))")!
31
+ }
32
+
33
+ // MARK: - Valid requests
34
+
35
+ @Test("accepts a trigger whose host is an app route, because the marker selects the channel")
36
+ func validRequestOnAnAppRouteHost() {
37
+ let url = triggerUrl(host: "login", nonce: "abc", callback: "http://192.168.1.50:1/fingerprint-callback")
38
+
39
+ #expect(FingerprintCheckRequest.parse(url)?.nonce == "abc")
40
+ }
41
+
42
+ @Test("accepts a trigger with no host at all")
43
+ func validRequestWithNoHost() {
44
+ let url = triggerUrl(host: "", nonce: "abc", callback: "http://192.168.1.50:1/fingerprint-callback")
45
+
46
+ #expect(FingerprintCheckRequest.parse(url)?.nonce == "abc")
47
+ }
48
+
49
+ @Test("accepts a callback on a private IPv4 address, and keeps its port")
50
+ func validRequestWithPrivateIPv4Callback() {
51
+ let url = triggerUrl(nonce: "abc", callback: "http://192.168.1.50:54321/fingerprint-callback")
52
+
53
+ let request = FingerprintCheckRequest.parse(url)
54
+
55
+ #expect(request?.nonce == "abc")
56
+ #expect(request?.callback.absoluteString == "http://192.168.1.50:54321/fingerprint-callback")
57
+ }
58
+
59
+ @Test("accepts a callback in 10.0.0.0/8")
60
+ func validRequestWith10DotCallback() {
61
+ let url = triggerUrl(nonce: "abc", callback: "http://10.1.2.3:54321/fingerprint-callback")
62
+
63
+ #expect(FingerprintCheckRequest.parse(url) != nil)
64
+ }
65
+
66
+ @Test("accepts a callback in 172.16.0.0/12")
67
+ func validRequestWith172Slash12Callback() {
68
+ let url = triggerUrl(nonce: "abc", callback: "http://172.20.0.5:54321/fingerprint-callback")
69
+
70
+ #expect(FingerprintCheckRequest.parse(url) != nil)
71
+ }
72
+
73
+ @Test("accepts a callback in the carrier-grade NAT range")
74
+ func validRequestWithCGNCallback() {
75
+ let url = triggerUrl(nonce: "abc", callback: "http://100.100.0.5:54321/fingerprint-callback")
76
+
77
+ #expect(FingerprintCheckRequest.parse(url) != nil)
78
+ }
79
+
80
+ @Test("accepts a callback on an IPv6 unique local address")
81
+ func validRequestWithIPv6ULACallback() {
82
+ let url = triggerUrl(nonce: "abc", callback: "http://[fc00::1]:54321/fingerprint-callback")
83
+
84
+ #expect(FingerprintCheckRequest.parse(url) != nil)
85
+ }
86
+
87
+ // MARK: - Rejected requests
88
+
89
+ @Test("rejects a URL without the reserved marker parameter")
90
+ func rejectsUrlWithoutTheMarkerParam() {
91
+ let url = triggerUrl(marker: nil, nonce: "abc", callback: "http://192.168.1.50:1/fingerprint-callback")
92
+
93
+ #expect(FingerprintCheckRequest.parse(url) == nil)
94
+ }
95
+
96
+ @Test("rejects a marker parameter set to anything but 1")
97
+ func rejectsMarkerParamWithAnotherValue() {
98
+ let url = triggerUrl(marker: "0", nonce: "abc", callback: "http://192.168.1.50:1/fingerprint-callback")
99
+
100
+ #expect(FingerprintCheckRequest.parse(url) == nil)
101
+ }
102
+
103
+ @Test("rejects a URL with no query at all")
104
+ func rejectsUrlWithNoQueryAtAll() {
105
+ #expect(FingerprintCheckRequest.parse(URL(string: "exp+app://expo-fingerprint-check")!) == nil)
106
+ }
107
+
108
+ @Test("rejects a trigger with no nonce")
109
+ func rejectsMissingNonce() {
110
+ let url = triggerUrl(nonce: nil, callback: "http://192.168.1.50:1/fingerprint-callback")
111
+
112
+ #expect(FingerprintCheckRequest.parse(url) == nil)
113
+ }
114
+
115
+ @Test("rejects an empty nonce")
116
+ func rejectsEmptyNonce() {
117
+ let url = triggerUrl(nonce: "", callback: "http://192.168.1.50:1/fingerprint-callback")
118
+
119
+ #expect(FingerprintCheckRequest.parse(url) == nil)
120
+ }
121
+
122
+ @Test("rejects a trigger with no callback")
123
+ func rejectsMissingCallback() {
124
+ let url = triggerUrl(nonce: "abc", callback: nil)
125
+
126
+ #expect(FingerprintCheckRequest.parse(url) == nil)
127
+ }
128
+
129
+ @Test("rejects an https callback, which the CLI never emits")
130
+ func rejectsHttpsCallbackScheme() {
131
+ let url = triggerUrl(nonce: "abc", callback: "https://192.168.1.50:1/fingerprint-callback")
132
+
133
+ #expect(FingerprintCheckRequest.parse(url) == nil)
134
+ }
135
+
136
+ @Test("rejects a file:// callback")
137
+ func rejectsFileCallbackScheme() {
138
+ let url = triggerUrl(nonce: "abc", callback: "file:///etc/passwd")
139
+
140
+ #expect(FingerprintCheckRequest.parse(url) == nil)
141
+ }
142
+
143
+ @Test("rejects a DNS name callback, resolving no names")
144
+ func rejectsDnsNameCallbackHost() {
145
+ let url = triggerUrl(nonce: "abc", callback: "http://attacker.example/fingerprint-callback")
146
+
147
+ #expect(FingerprintCheckRequest.parse(url) == nil)
148
+ }
149
+
150
+ @Test("rejects a public IP callback, the SSRF guard")
151
+ func rejectsPublicIPCallbackHost() {
152
+ let url = triggerUrl(nonce: "abc", callback: "http://8.8.8.8:1/fingerprint-callback")
153
+
154
+ #expect(FingerprintCheckRequest.parse(url) == nil)
155
+ }
156
+
157
+ @Test("rejects a loopback callback")
158
+ func rejectsLoopbackCallbackHost() {
159
+ let url = triggerUrl(nonce: "abc", callback: "http://127.0.0.1:1/fingerprint-callback")
160
+
161
+ #expect(FingerprintCheckRequest.parse(url) == nil)
162
+ }
163
+
164
+ @Test("rejects a callback on any other path")
165
+ func rejectsWrongCallbackPath() {
166
+ let url = triggerUrl(nonce: "abc", callback: "http://192.168.1.50:1/x")
167
+
168
+ #expect(FingerprintCheckRequest.parse(url) == nil)
169
+ }
170
+
171
+ @Test("rejects an address just outside 172.16.0.0/12")
172
+ func rejectsAddressJustOutsideThe172Slash12Range() {
173
+ let url = triggerUrl(nonce: "abc", callback: "http://172.32.0.5:1/fingerprint-callback")
174
+
175
+ #expect(FingerprintCheckRequest.parse(url) == nil)
176
+ }
177
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "expo-dev-launcher",
3
3
  "title": "Expo Development Launcher",
4
- "version": "58.0.3",
4
+ "version": "58.0.4",
5
5
  "description": "Pre-release version of the Expo development launcher package for testing.",
6
6
  "repository": {
7
7
  "type": "git",
@@ -16,7 +16,7 @@
16
16
  "homepage": "https://docs.expo.dev",
17
17
  "dependencies": {
18
18
  "@expo/schema-utils": "^58.0.0",
19
- "expo-dev-menu": "~58.0.3",
19
+ "expo-dev-menu": "~58.0.4",
20
20
  "expo-manifests": "~58.0.0"
21
21
  },
22
22
  "peerDependencies": {
@@ -27,7 +27,7 @@
27
27
  "@types/jest": "^29.2.1",
28
28
  "@types/node": "^22.14.0"
29
29
  },
30
- "gitHead": "917a61b581baeb852aa4fe331da2c1395d824351",
30
+ "gitHead": "ebb1fd7569c9c9e172cb9abd73dfede027c1d674",
31
31
  "scripts": {
32
32
  "build": "pnpm build:plugin",
33
33
  "build:plugin": "expo-build --base plugin cjs:src",