Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Harden Network Inspector server binding and adb command execution - #2647

Merged
Joaquin Jares (joj) merged 6 commits into
microsoft:masterfrom
lucygramley:fix/network-inspector-hardening
Jun 2, 2026
Merged

Joaquin Jares (joj) merged 6 commits into
microsoft:masterfrom
lucygramley:fix/network-inspector-hardening

Conversation

@lucygramley

Copy link
Copy Markdown
Contributor

Bind RSocket TCP server to loopback address, strengthen filepath validation, and refactor adb command execution to use execFile with argument arrays.

- Bind RSocket TCP server to 127.0.0.1 instead of all interfaces
- Strengthen filepath validation with strict allowlist and path traversal check
- Refactor adb command execution to use execFile with argument arrays instead of string concatenation via exec
- Update all executeQuery callers to pass argument arrays

Co-authored-by: Copilot <[email protected]>
@ConnorQi01

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@ConnorQi01

ConnorQi01 commented May 28, 2026

Copy link
Copy Markdown
Collaborator

Hi lucygramley

Thanks for the contribution and for the Network Inspector hardening work here.

Could you please create or link a corresponding issue for this PR? It would help us track the affected Network Inspector surface, the security motivation, and the intended behavior separately from the implementation.

The unit test pipeline is currently failing on Linux, Windows, and macOS. Could you please inspect the failing logs and update the PR?

One thing I noticed is that most ADB calls were moved to argument-array execution, but one path still reconstructs a command string before calling commandExecutor.execute. Could you please clarify whether that path is considered safe, or update it to avoid rebuilding a shell command string as well? It would also be useful to add validation coverage for allowed Android file paths and ADB arguments.

auto-merge was automatically disabled May 28, 2026 20:49

Head branch was pushed to by a user without write access

@lucygramley

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Commenter does not have sufficient privileges for PR 2647 in repo microsoft/vscode-react-native

@ConnorQi01

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@ConnorQi01

ConnorQi01 commented May 29, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the contribution. I noticed the pipeline is currently failing because of code formatting issues.

Could you please run the project formatting command locally, commit the formatting changes, and push the update to this PR?

One small suggestion for future PRs: when possible, please link the PR to a related issue, or create one if there is no existing issue. This helps us track the motivation, review scope, validation status, and reporting more clearly. For small or urgent fixes this may not always be necessary, but it would be helpful for changes like this.

@ConnorQi01

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@joj
Joaquin Jares (joj) merged commit 12005c5 into microsoft:master Jun 2, 2026
5 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.

3 participants