Join our Newsletter — 33% off our NHI Course

What is an example of Custom URL Schemes in practice?

A Custom URL Schemes example is a mobile app that registers a scheme such as myapp:// and then opens a specific screen from another app or a web page. If the app trusts the URL too much, an attacker can trigger actions, pass malicious parameters, or redirect users. Restrict accepted parameters and treat scheme input as untrusted.

What a Custom URL Scheme Example Looks Like in a Real App

A practical example is a mobile app that registers myapp:// so a link can open a specific screen, such as a reset flow, product page, or account view. The scheme is just a routing entry point, but it becomes security-sensitive when the app accepts arbitrary parameters or performs actions without checking who supplied the URL and whether the request is expected.

That is why a custom scheme should be treated as an untrusted input channel, not as a trusted command path. The example is often harmless when it only navigates, but it becomes risky when it can trigger state changes, carry identifiers, or hand off privileged workflow steps from another app, a browser, or a malicious message.

A common pattern is a marketing or support link that opens the app directly, for example to myapp://order/12345 or myapp://invite?code=.... The same pattern can be abused if the app assumes every incoming link is legitimate, so the safer design is to validate the route, reject unexpected parameters, and require the user to confirm sensitive actions before anything irreversible happens.

Why Scheme Handling Becomes a Security Boundary

Custom URL schemes are useful because they make app-to-app handoff simple, but that simplicity also means the app may accept data from outside its trust boundary. If the app reads a scheme parameter and uses it to open content, prefill forms, or call back-end APIs, the scheme becomes part of the attack surface, not just a convenience feature.

Two failure modes matter most. First, route confusion, where the app opens the wrong screen or accepts a malformed path. Second, action confusion, where the app treats the URL as permission to perform work. The most sensitive cases are those where a link can change account state, expose private content, or move the user into a privileged workflow without a fresh trust decision.

The mobile security lesson is broader than deep links alone. Input from a custom scheme should be handled with the same discipline as any other external request: strict parsing, explicit allowlists, bounded parameter handling, and separate checks for navigation versus authority. NHIMG’s Mobile App Security Guide is a useful reference point for the related mobile attack paths, including scheme squatting and URI hijacking.

How to Build a Safer Custom Scheme Flow

The safest implementation is one that assumes the URL may be malicious even when it comes from a legitimate-looking source. Use the scheme only to identify the intended screen or intent, then enforce business rules inside the app before any sensitive state change. If a parameter is not needed, do not accept it. If a parameter is needed, constrain it to the exact format and range the app expects.

For sensitive operations, separate navigation from authorization. A URL may open the password reset view, for example, but it should not by itself authorize the reset. Likewise, a deep link into an account or order view should not bypass normal session checks, ownership checks, or server-side validation. The strongest control is to make the link a convenience mechanism, while the server remains the source of truth for privilege and state.

Practitioners should also test the negative cases, not just the happy path. Verify that unexpected parameters are ignored, that encoded or nested payloads do not alter app behavior, and that the app behaves safely when opened from a browser, another app, or a crafted message. If a scheme can trigger an action, confirm that the action still requires explicit user intent or a valid authenticated session.

Risk and Threat Considerations

Custom URL schemes are attractive to attackers because they let an external input reach a mobile app in a way that often feels trusted to users. If the app accepts the URL too broadly, an attacker may be able to steer the user into the wrong flow, inject malicious parameters, or trigger an action the app should have treated as high risk.

Failure mechanism: The app maps incoming URL data directly to navigation or action logic without sufficiently strict parsing, parameter validation, ownership checks, or confirmation for sensitive operations.

Impact: That can lead to unauthorized actions, user redirection, data exposure, abuse of privileged flows, or unreliable trust in links that look official but are attacker-controlled.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP ASVS, CIS Controls v8 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
OWASP ASVS V8 — Authorization Deep links must not bypass ownership or action checks.
V13 — Configuration Scheme handlers and routing rules are app configuration that can misroute or overexpose flows.
Recommendation — Require server-side authorization before any state-changing action opened by a custom scheme. Lock down scheme routing and reject unexpected handlers or parameters.
CIS Controls v8 CIS-16 — Application Software Security Custom URL schemes are an application security surface that needs secure design and testing.
Recommendation — Test deep-link entry points for unsafe parameter handling and unintended actions.
NIST SP 800-53 Rev 5 IA-2 — Identification and Authentication (Organizational Users) Sensitive deep-link actions should still require user authentication or reauthentication.
AC-3 — Access Enforcement The app must enforce access decisions after parsing external URL input.
Recommendation — Require reauthentication before privileged flows opened by a custom URL scheme. Enforce access checks on the server side after any scheme-driven request.

Practitioner Guidance

What to verify: Check whether the scheme is used only for navigation or whether it can also alter state, call an API, or expose account data. If it can do more than open a screen, treat it as a security control point and test it accordingly.

Common mistake: Teams often validate the path but forget the parameters. That leaves room for tampered identifiers, unexpected encodings, and flow manipulation even when the route itself looks safe.

Practitioner takeaway: A custom scheme is safe only when it is treated as untrusted input and the app still enforces its normal trust, ownership, and authorization rules after the link is parsed.