Skip to content

feature: Add flutter recommendation#280

Merged
3asm merged 3 commits into
masterfrom
feature/add-flutter-recommendation
May 12, 2026
Merged

feature: Add flutter recommendation#280
3asm merged 3 commits into
masterfrom
feature/add-flutter-recommendation

Conversation

@MouadAO
Copy link
Copy Markdown
Member

@MouadAO MouadAO commented May 11, 2026

Title: Add Flutter mitigations for WebView vulnerabilities

Summary:
This PR updates the recommendation guidelines for two WebView-related vulnerabilities to include Flutter-specific fixes. Since our scanners catch native Android vulnerabilities inside compiled Flutter apps, providing Dart implementations alongside the native Java fixes gives cross-platform developers directly actionable solutions.

Changes Included:

  • Call to dangerous WebView settings API: Added flutter_inappwebview Dart snippets to configure InAppWebViewSettings (disabling mixed content, restricting file access, and hardening debugging/safe browsing).
  • Webview loadurl injection: Added Dart code examples demonstrating how to validate and whitelist untrusted URLs before passing them to a Flutter WebView widget.

Why:
Addresses customer feedback where Flutter developers were only receiving native Java mitigation steps that they could not easily apply to third-party Dart packages.

@MouadAO MouadAO self-assigned this May 11, 2026
@MouadAO MouadAO changed the title feature: add flutter recommendation feature: Add flutter recommendation May 11, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.21%. Comparing base (dc9d211) to head (48a656a).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #280   +/-   ##
=======================================
  Coverage   93.21%   93.21%           
=======================================
  Files           5        5           
  Lines         280      280           
=======================================
  Hits          261      261           
  Misses         19       19           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +48 to +52
// Validate the incoming URL against the whitelist
String safeUrl = "about:blank";
if (WHITELISTED_URLS.contains(untrustedUrl)) {
safeUrl = untrustedUrl;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it worth mentioning this way to valid untrusted URLs using Dart native Uri

final uri = Uri.tryParse(untrustedUrl);
if (uri != null && uri.scheme == 'https' && uri.host == 'trusted.com') {
  safeUrl = untrustedUrl;
}

@3asm 3asm merged commit e24913a into master May 12, 2026
7 checks passed
@3asm 3asm deleted the feature/add-flutter-recommendation branch May 12, 2026 11:04
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.

4 participants