Fix UWORKER initialization crash by bypassing Wi-Fi Datastore queries in Android#5290
Open
jardondiego wants to merge 3 commits into
Open
Fix UWORKER initialization crash by bypassing Wi-Fi Datastore queries in Android#5290jardondiego wants to merge 3 commits into
jardondiego wants to merge 3 commits into
Conversation
Fixed line too long and trailing whitespace issues to pass the CI.
This adds a unit test to verify that wifi.configure() safely returns early when executed inside a UWORKER environment, preventing a crash caused by illegal Datastore queries for Wi-Fi credentials.
fernandofloresg
approved these changes
May 22, 2026
| @@ -0,0 +1,40 @@ | |||
| # Copyright 2024 Google LLC | |||
Collaborator
There was a problem hiding this comment.
Suggested change
| # Copyright 2024 Google LLC | |
| # Copyright 2026 Google LLC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR fixes a critical initialization crash that occurs when untrusted workers (UWORKERs) attempt to set up Android emulators.
The Bug
During the Android device initialization sequence, wifi.configure() is called to ensure the device is connected to the network. This function attempts to retrieve Wi-Fi credentials (SSID/password) by calling db_config.get(), which queries Google Cloud Datastore.
However, UWORKER containers run under a restricted security boundary and are explicitly denied IAM permissions to access Datastore (to prevent malicious fuzzers from escalating privileges or stealing project secrets). When the Datastore SDK intercepts the request, it returns a 403 Missing or insufficient permissions exception. Because this exception is
unhandled, it violently crashes the entire setup process, preventing the UWORKER from ever reaching the fuzzing loop.
The Fix
This PR introduces an environment check at the top of wifi.configure():
This gracefully short-circuits the function for untrusted workers, bypassing the illegal Datastore query.
Notes