Android security hardening — 4 low-risk fixes from audit

Open
#184 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
android, react-native, typescript
Domain
mobile, security

Research direction

Start with android/app/src/main/AndroidManifest.xml and src/screens/SettingsScreen.tsx, then inspect the production Babel config and the listed logging files. Check how the production Expo build handles SYSTEM_ALERT_WINDOW and console statements. Done means all four audit items are addressed and the production build and backup-import behavior are verified.

Written by the indexing model from the issue text.

Description

enhancement

Context

A full security audit against the Android Security Best Practices checklist was performed on 2026-10-30. The app passes 44/48 checks. These 4 remaining items are all low-risk hardening improvements — no critical or high-risk issues were found.

The app's claim of being offline, privacy-first, and secure is substantiated by the audit.

[!NOTE]
This issue description was written by an AI agent (Antigravity / Claude Opus 4.6).


Checklist

1. Set android:allowBackup="false"

File: android/app/src/main/AndroidManifest.xml (L16)
Risk: LOW

android:allowBackup="true" allows full AsyncStorage data extraction via adb backup on Android ≤12. While the app stores no PII, users may type personal info into goal/camp names.

Fix: Set android:allowBackup="false", or define a restrictive android:fullBackupContent if Google Drive backup is desired.


2. Validate keys on backup import

File: src/screens/SettingsScreen.tsx (~L126-142)
Risk: LOW-MEDIUM

The import flow does JSON.parse() on user-supplied files and writes all entries to AsyncStorage via multiSet without validating key prefixes. A crafted backup file could inject arbitrary keys.

Fix: Filter incoming keys to known prefixes before writing:

const validPrefixes = ['@climbstack/', '@levelup/', 'app_language'];
const filteredEntries = backupData.data.filter(
  ([key]: [string, string]) => validPrefixes.some(p => key.startsWith(p))
);
await AsyncStorage.multiSet(filteredEntries);

3. Verify SYSTEM_ALERT_WINDOW is stripped from production builds

File: android/app/src/main/AndroidManifest.xml (L5)
Risk: LOW

This permission is declared in the main manifest (needed by React Native dev menu). Verify that eas build --profile production removes it. If not, move it to the debug-only manifest variant.


4. Strip console.log/error from production builds

Files: PeaksContext.tsx, PlannerContext.tsx, HomeScreen.tsx, calendar.ts, and others (~20 occurrences)
Risk: LOW

No PII is logged, but error objects in logcat could expose internal storage key names. Best practice is to strip console statements in production.

Fix: Add babel-plugin-transform-remove-console to the production Babel config, or wrap logs in __DEV__ checks.


AI Generation Disclosure

This issue was created by an AI agent (Antigravity, Claude Opus 4.6 Thinking). All files and line references were identified through automated codebase analysis.

Dominant language
TypeScript
Stars
4
Forks
4
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GiZano/LevelUp

All issues in GiZano/LevelUp

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.