Why it matters

Deep links, intent extras, push payloads and server responses all reach code that may build queries, load URLs or make decisions. Treating them as trusted turns a crafted link into an injection or a bypassed check.

How to meet it

  • Parse links and extras strictly: check the scheme, host and path against an allowlist and reject anything else.
  • Use parameterized queries for local databases and safe parsers for structured data.
  • Validate on the server as well; the client's checks can be bypassed.

MASTG tests in the local projects

The local projects run these OWASP MASTG v2.0.0 tests for MASVS-CODE-4, as tests you can repeat on your own machine.

MASTG testPlatformProject
MASTG-TEST-0370: Missing Input Validation in Custom URL Scheme HandlersiOSKeep an iOS app's storage, links and web bridge in bounds · LinkTests
MASTG-TEST-0395: Missing Input Validation in Universal Link HandlersiOSKeep an iOS app's storage, links and web bridge in bounds · LinkTests
MASTG-TEST-0394: Missing Input Validation in Custom URL Scheme HandlersAndroidRepair an Android app's links, components, network policy and storage · LinkTests

Guides on this site

Practice

References

  1. MASVS-CODE-4 (OWASP MASVS v2.1.0)
  2. MASVS-CODE: Code Quality (OWASP MASVS v2.1.0)

List data from the publisher. A guide is listed as the main subject when the weakness or risk is what the guide is about, and as covering it when a dedicated section or worked example addresses it.

Control statements are quoted from OWASP MASVS v2.1.0, licensed CC BY-SA 4.0; the rest is this site's summary. MASTG tests are those the iOS and Android projects here run, with their titles from mas.owasp.org. License.