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

Skip to content

Add destination path validation for certificate deployment - #2658

Merged
Joaquin Jares (joj) merged 7 commits into
microsoft:masterfrom
lucygramley:fix/cert-destination-path-validation
Jun 2, 2026
Merged

Add destination path validation for certificate deployment#2658
Joaquin Jares (joj) merged 7 commits into
microsoft:masterfrom
lucygramley:fix/cert-destination-path-validation

Conversation

@lucygramley

Copy link
Copy Markdown
Contributor
  • Validate destination paths against allowed platform-specific directories before writing certificate files.
  • Await CSR app name extraction before performing filesystem operations.
  • Reject paths containing traversal sequences.

- Validate destination path against allowed platform-specific directories before writing certificate files
- Await CSR app name validation before performing any filesystem operations
- Reject paths containing traversal sequences

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

Copy link
Copy Markdown
Collaborator

Thanks for the contribution and for working on certificate deployment path validation.

Could you please create or link a corresponding issue for this PR? It would help us track the affected certificate deployment flow, the expected mitigation, and the platform-specific assumptions.

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

For this change, I would especially suggest adding or updating tests around the allowed destination paths for iOS, macOS, and Windows. The new allowlist looks fairly strict, so we should verify that valid simulator/device certificate deployment paths still work while traversal or unexpected paths are rejected.

auto-merge was automatically disabled May 28, 2026 21:35

Head branch was pushed to by a user without write access

@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).

@ConnorQi01

ConnorQi01 commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the update. The latest pipeline run is still failing on a formatting check in src/extension/networkInspector/certificateProvider.ts.

The relevant Prettier error is:

D:\a\1\s\src\extension\networkInspector\certificateProvider.ts
  361:29  error  Replace `␍⏎················`Destination·path·is·not·within·an·allowed·directory:·${destination}`,␍⏎············` with ``Destination·path·is·not·within·an·allowed·directory:·${destination}``  prettier/prettier

It looks like the formatter expects this error message to stay on a single line:

Destination path is not within an allowed directory: ${destination}

Could you please run the project formatting command locally, commit the formatting update, and push it back to this PR? That should clear this pipeline failure.

@ConnorQi01

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

@joj

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

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

@joj

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

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

@joj
Joaquin Jares (joj) merged commit e2226e7 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