A production build that points to staging APIs or includes debug tooling exposes real users to test data, unstable endpoints, and developer-only interfaces. More critically, staging endpoints typically have weaker auth, lower rate limits, and no data residency guarantees — a production release hitting a staging backend may log user PII into non-compliant systems. CWE-489 (active debug code) and CWE-200 (information exposure) both apply: redux-logger printing state trees to device logs, or a localhost URL falling back to a staging server, creates information exposure paths that violate user trust and may constitute a GDPR Art. 5 processing purpose violation. App store reviewers who discover staging URLs during dynamic analysis can reject the binary.
High because production builds pointing to staging APIs expose real user data to non-compliant endpoints and give reviewers grounds to reject binaries containing active debug tooling.
Gate all debug tooling behind __DEV__ and drive API URLs from environment variables, never from hardcoded strings in source.
// src/config.ts
export const API_URL = process.env.EXPO_PUBLIC_API_URL ?? 'https://api.yourapp.com';
// Conditionally load debug middleware
const middleware: Middleware[] = [thunk];
if (__DEV__) {
const { createLogger } = await import('redux-logger');
middleware.push(createLogger());
}
Set EXPO_PUBLIC_API_URL as an EAS secret for production builds (eas secret:create --scope project --name EXPO_PUBLIC_API_URL --value https://api.yourapp.com). Verify by running eas build --profile production --local and grepping the bundle for staging hostnames before submitting.
mobile-store-readiness.build-config.no-debug-in-releasehigh__DEV__, debug, test, localhost, 127.0.0.1, staging API endpoints, or mock data endpoints in source files. Check for environment-based API URL selection. Verify that release/production builds point to production APIs, not staging or test endpoints. Look for debug logging libraries (e.g., redux-logger, react-native-debugger) and verify they're excluded from release builds.localhost, 127.0.0.1, or staging URLs should appear in non-test source files. Development-only libraries are excluded via conditional imports or build flags. Report even on pass: "Scanned X source files, found Y debug references (all properly guarded by DEV or environment checks)."api-staging.example.com), includes debug tools or logging, or contains hardcoded localhost/test URLs outside of __DEV__ guards.security-headers) covers production endpoint security that complements this build configuration check."Release build uses staging API: https://api-staging.example.com instead of production API" or "redux-logger is imported and enabled in production bundle".env.development (for local testing)
.env.staging (for staging builds)
.env.production (for release builds)
const API_URL = process.env.REACT_APP_API_URL || 'https://api.example.com';
eas secret:create --scope project --name API_URL --value https://api.example.com
let middlewares = [];
if (__DEV__) {
middlewares.push(require('redux-logger').default);
}