From f252a0a26f86faf56af8e185c735de4ef0f175a3 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 16 Apr 2026 06:36:04 +0000 Subject: [PATCH] Gate cleartext HTTP traffic settings to non-production variants NSAllowsArbitraryLoads on iOS and the withAndroidCleartextTraffic plugin were applied unconditionally to all build variants, including production. This exposed production users to potential man-in-the-middle attacks. Now both settings are only applied for development and preview variants, using the existing APP_VARIANT infrastructure. --- apps/mobile/app.config.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/mobile/app.config.ts b/apps/mobile/app.config.ts index 35631b7475..c0eca2a88c 100644 --- a/apps/mobile/app.config.ts +++ b/apps/mobile/app.config.ts @@ -77,9 +77,11 @@ const config: ExpoConfig = { supportsTablet: true, bundleIdentifier: variant.iosBundleIdentifier, infoPlist: { - NSAppTransportSecurity: { - NSAllowsArbitraryLoads: true, - }, + ...(APP_VARIANT !== "production" && { + NSAppTransportSecurity: { + NSAllowsArbitraryLoads: true, + }, + }), ITSAppUsesNonExemptEncryption: false, }, }, @@ -128,7 +130,7 @@ const config: ExpoConfig = { ], "expo-secure-store", "expo-router", - "./plugins/withAndroidCleartextTraffic.cjs", + ...(APP_VARIANT !== "production" ? ["./plugins/withAndroidCleartextTraffic.cjs"] : []), ], extra: { appVariant: APP_VARIANT,