Skip to content

Conversation

@somalaya
Copy link
Contributor

@somalaya somalaya commented Jul 21, 2025

SDL assessment task : https://securityassurance.visualstudio.com/Threat%20Modeling/_workitems/edit/80425

As per above SDL assessment task, we have secure some input settings in webview

WebSettings settings = webView.getSettings();
settings.setAllowFileAccess(false);
settings.setAllowContentAccess(false);
settings.setAllowFileAccessFromFileURLs(false); // Requires API 16+
settings.setAllowUniversalAccessFromFileURLs(false); // Requires API 16+

Keeping the changes behind a flight which will be true only in brokered flow for now https://github.com/AzureAD/ad-accounts-for-android/pull/3168

Fixes AB#3288572

@github-actions
Copy link

❌ Work item link check failed. Description does not contain AB#{ID}.

Click here to Learn more.

@somalaya somalaya marked this pull request as ready for review July 21, 2025 16:57
Copilot AI review requested due to automatic review settings July 21, 2025 16:57
@somalaya somalaya requested a review from a team as a code owner July 21, 2025 16:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements security hardening for WebView settings in the OAuth2 authorization flow as part of an SDL (Security Development Lifecycle) assessment task. The changes disable various file access permissions to prevent potential security vulnerabilities.

Key changes:

  • Refactored WebSettings variable naming for consistency and reuse
  • Added security settings behind a feature flag to disable file access capabilities
  • Applied defensive security measures to prevent unauthorized file system access from WebView

@somalaya somalaya changed the title [SDL Assessment task] Secure webview settings [SDL Assessment task] Secure webview settings, Fixes AB#3288572 Jul 21, 2025
@github-actions
Copy link

✅ Work item link check complete. Description contains link AB#3288572 to an Azure Boards work item.

@somalaya somalaya force-pushed the somalaya/webviewSettings branch from a9eff9c to 1c5ca62 Compare August 15, 2025 17:56
@somalaya somalaya requested a review from a team as a code owner August 15, 2025 17:58
@somalaya somalaya merged commit 79e27b1 into dev Aug 15, 2025
24 of 25 checks passed
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