Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@ private void init() {
webSettings.setLoadWithOverviewMode(true);
webSettings.setUserAgentString(webSettings.getUserAgentString()
+ "AlphaWallet(Platform=Android&AppVersion=" + BuildConfig.VERSION_NAME + ")");
WebView.setWebContentsDebuggingEnabled(true);
// CWE-489: Web3TokenView holds session JS for a wallet that signs
// transactions. Leaving WebView contents debuggable in release builds
// lets anyone with USB access attach chrome://inspect and read the
// page's DOM/JS. Restrict to debug builds only.
WebView.setWebContentsDebuggingEnabled(BuildConfig.DEBUG);
Comment on lines +126 to +130
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

WebView.setWebContentsDebuggingEnabled(...) is process-wide. Even though this call is now gated by BuildConfig.DEBUG, there is still an unconditional WebView.setWebContentsDebuggingEnabled(true) in app/src/main/java/com/alphawallet/app/web3/Web3View.java (around line 190) which is used by production layouts (e.g. fragment_webview.xml). That means release builds can still end up with WebView debugging enabled, defeating the security goal described in the comment. Consider gating/removing the other call sites as well (or centralizing this setting so it can’t be re-enabled in release).

Copilot uses AI. Check for mistakes.

if (WebViewFeature.isFeatureSupported(WebViewFeature.ALGORITHMIC_DARKENING))
{
Expand Down
Loading