Skip to content

[MEDIUM] fix(android): detect enabled legacy mock locations - #367

Open
OskarEichler wants to merge 1 commit into
GantMan:masterfrom
OskarEichler:codex/security-fix-legacy-mock-location
Open

[MEDIUM] fix(android): detect enabled legacy mock locations#367
OskarEichler wants to merge 1 commit into
GantMan:masterfrom
OskarEichler:codex/security-fix-legacy-mock-location

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

  • treat the legacy secure setting value 1 as mock locations enabled
  • keep disabled (0) and missing values false
  • add a focused JVM regression test

Security impact

On Android versions before API 23, Settings.Secure.ALLOW_MOCK_LOCATION uses 1 for enabled and 0 for disabled. The current comparison is inverted, so a device with mock locations enabled is reported as safe while a device with the setting disabled is reported as capable of mocking location. Applications using canMockLocation() or trustFall() as a risk signal therefore receive a false negative on Android 5.x.

Verification

  • :jail-monkey:testDebugUnitTest: 1 test passed
  • :jail-monkey:compileDebugJavaWithJavac: passed
  • unchanged v3.0.0 Android compile baseline: passed
  • git diff --check: passed

This PR contains only the legacy-setting inversion fix and its regression coverage.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant