Dart Webview Flutter Ssl Verification Bypass
Description
This detector identifies Dart applications using the webview_flutter package that unsafely handle SSL certificate authentication errors, potentially allowing man-in-the-middle attacks. When SSL verification is bypassed or improperly handled, attackers can intercept and modify communications between the app and web servers.
Detection Strategy
• Scans Dart source files (excluding test files) that import the webview_flutter package
• Identifies method calls that handle SSL authentication errors
• Reports vulnerabilities when these methods contain unsafe SSL error handling that bypasses certificate verification
Vulnerable code example
import 'package:webview_flutter/webview_flutter.dart';
// VULNERABLE: unconditionally accepting all SSL certificates
NavigationDelegate insecureDelegate() => NavigationDelegate(
onSslAuthError: (SslAuthError request) => request.proceed(), // bypasses certificate validation
);
// VULNERABLE: async block still proceeds without validation...✅ Secure code example
import 'package:webview_flutter/webview_flutter.dart';
// SECURE: explicitly rejecting invalid SSL certificates
NavigationDelegate secureDelegate() => NavigationDelegate(
onSslAuthError: (SslAuthError request) => request.cancel(), // rejects untrusted certificates
);
// SECURE: async block properly cancels invalid certificates...Search for vulnerabilities in your apps for free with Fluid Attacks' automated security testing! Start your 21-day free trial and discover the benefits of the Continuous Hacking Essential plan. If you prefer the Advanced plan, which includes the expertise of Fluid Attacks' hacking team, fill out this contact form.