The product does not properly verify that the source of data or communication is valid.
Impact: Gain Privileges or Assume IdentityVaries by Context
An attacker can access any functionality that is inadvertently accessible to the source.
java// Android* @Override public boolean shouldOverrideUrlLoading(WebView view, String url){ ``` if (url.substring(0,14).equalsIgnoreCase("examplescheme:")){ if(url.substring(14,25).equalsIgnoreCase("getUserInfo")){ writeDataToView(view, UserData); return false; } else{ return true; } } }
// iOS* -(BOOL) webView:(UIWebView *)exWebView shouldStartLoadWithRequest:(NSURLRequest *)exRequest navigationType:(UIWebViewNavigationType)exNavigationType { ``` NSURL *URL = [exRequest URL]; if ([[URL scheme] isEqualToString:@"exampleScheme"]) { NSString *functionString = [URL resourceSpecifier]; if ([functionString hasPrefix:@"specialFunction"]) {
objective-cjavascript