Skip to content

feat(mobile): add Insufficient Crypto lesson and challenges to the Android app- #1069 - #1107

Open
SeanDuggan wants to merge 26 commits into
OWASP:devfrom
SeanDuggan:mobile-split/11-insufficient-cryptography
Open

SeanDuggan wants to merge 26 commits into
OWASP:devfrom
SeanDuggan:mobile-split/11-insufficient-cryptography

Conversation

@SeanDuggan

Copy link
Copy Markdown
Member

Summary

Adds the Insufficient Cryptography lesson and challenge (OWASP Mobile Top 10 M10) to the Android app, with the matching lesson and challenge JSPs, i18n strings and cheat sheet solutions.

What's included

Android

  • InsufficientCryptoLessonFragment and InsufficientCryptoChallengeFragment, with their layouts
  • Registration in KeyValidator, ModuleInfoHelper, MainActivity and mobile_navigation.xml
  • Strings for both modules
  • Unit tests for the lesson and the challenge

Server content

  • Lesson JSP (dbf3915e…) and challenge JSP (c3d4e5f6…)
  • Lesson properties and challenge strings
  • Cheat sheet solutions for both modules
  • mobileBlurb.appLink in mobileGenericStrings.properties

Scoring

Both modules are server-scored only, with no offline key hashes. Without a signed-in server session a submitted key is rejected. With a session, the key is verified through /mobileFlagSubmit and recorded in core.results.

Testing

  • 16/16 unit tests pass and the debug APK builds.
  • Emulator run over HTTPS, signed in as a test user:
    • Lesson: a wrong key was rejected and wool was accepted. A core.results row was written.
    • Challenge: the token was decoded from shared_prefs/recovery_vault.xml (Base64, then XOR 0x42). A wrong key gave "Incorrect key." and the real token completed the module, with a matching core.results row.
    • Both modules moved to the drawer's Completed group.
  • After the last two small commits (challenge description wording and lesson counter removal), only the build and unit tests were re-run, not the emulator.

Notes for reviewers

  • This branch is stacked on the Android app shell PR (feat(mobile): android app shell #1068), so until that merges the PR also shows the shell's commits.
  • mobileBlurb.appLink is also added by the sibling category branches, so expect a trivial conflict when they rebase.
  • The lesson's completion dialog reuses the shared "Challenge complete" string.

SeanDuggan and others added 12 commits October 26, 2026 19:09
Adds the Gradle project, manifest, resources, launch/login/main activities,
navigation, preferences, authentication, key validation and progress
tracking utilities, and the home, progress, scoreboard and ADB reference
screens. Lesson and challenge screens referenced by the navigation graph are
added in the following PRs, so those destinations are not usable until then.

Part of the split of OWASP#894 (mobile app).
Disable cleartext traffic app-wide via a network security config and reject non-https server URLs at login, registration and key validation. Debug builds additionally trust user-installed CAs for local development.
The shell now builds with an empty KeyValidator.Module enum and empty
nav, menu and module-info registries. Each lesson/challenge category PR
registers its own entries. Removes the myapp://open deep link and the
KeyValidator unit test, which return with the first category.
Removes lesson/challenge strings and the Insufficient Cryptography ADB
reference card. These return with their own category PRs.
The app asks /mobileModuleStatus which modules the signed-in student can
open and greys out the rest in the navigation drawer and progress list,
with the server's reason shown when tapped. This mirrors the platform's
open floor / CTF rules: module closed, event not running, module blocked.

Advisory only: the server re-checks every module start and key request.
It fails open, so signed-out or offline use and failed requests grey out
nothing. Status refreshes on resume, drawer open, sign in and sign out.
…JDK path

Changing server_preference while signed in kept the old server's session
cookie, so it would be sent to the new server. Log out when the server
actually changes.

Remove org.gradle.java.home, which pinned a Windows Android Studio path and
overrode JAVA_HOME on other machines.
Replace the individually listed local planning docs with a single *.md rule.
Remove CHALLENGE_SOLUTIONS.txt and missing_challenges.txt, which refer to
no files in the repository.
Adds the Insufficient Cryptography module pair to the Android app, with
the matching server-side lesson/challenge JSPs and i18n content.

Android:
- InsufficientCryptoLessonFragment / InsufficientCryptoChallengeFragment
  and their layouts
- Register both modules in KeyValidator, ModuleInfoHelper, MainActivity
  navigation and mobile_navigation.xml
- Strings for both modules
- Unit tests for lesson and challenge

Server content:
- Lesson JSP (dbf3915e...) and challenge JSP (c3d4e5f6...)
- Lesson properties, challenge strings, cheatsheet solutions
- mobileBlurb.appLink in mobileGenericStrings.properties

Both modules are server-scored only (no offline key hashes): without a
signed-in server session a submitted key is rejected; with one, the key
is verified via /mobileFlagSubmit and recorded in core.results.

Tested: 16/16 unit tests; emulator run over HTTPS covering wrong and
correct key for lesson and challenge, matching core.results rows, and
the drawer Completed group.
@SeanDuggan SeanDuggan added this to the 4.0.0 milestone Nov 2, 2026
@SeanDuggan
SeanDuggan requested a review from ismisepaul November 2, 2026 10:19
@SeanDuggan SeanDuggan self-assigned this Nov 2, 2026
SeanDuggan and others added 12 commits November 2, 2026 21:06
… registration

Adds the lesson and challenge rows to coreSchema.sql plus the matching
cheatSheetCreate calls so both modules exist and score on a fresh install.
The logcat grep example rendered a literal "search_term" on the ADB Commands screen.
Register the topic in level-classification.toml (M10, CWE-327) and
regenerate docs/mobile-levels.md so the docs level-catalogue check passes.
…lter

The mobile category where clause drives open/close by category and the GetterIT module-count check. Categories added by this PR were missing, so those levels were counted as web levels.
Getter looks up each module's moduleNameLangPointer and 'category.' + moduleCategoryLangPointer in moduleNames.properties. The new levels had no entries, so the lookups threw MissingResourceException and the module, challenge and tournament listings came back incomplete.
The Android app lives in mobile/, not mobile/MobileShepherd/.
Insecure Communication is deferred to 4.0.1. Remove its key hash
entries, ProGuard rules and the cleartext-traffic comment.
…ng to it

The lesson footer now names the risk (for example 'OWASP Mobile Top 10 - M4: Insufficient Input/Output Validation') without an external URL, and no uri.properties key is required.
Drop the About dialog button that opened owasp.org and the unused hidden Top 10 FAB with its string. Lessons now name the relevant risk as plain text.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants