Also check package name validity in InstallPackageRequest#63401
Merged
RyanCavanaugh merged 1 commit intomicrosoft:mainfrom Apr 15, 2026
Merged
Also check package name validity in InstallPackageRequest#63401RyanCavanaugh merged 1 commit intomicrosoft:mainfrom
RyanCavanaugh merged 1 commit intomicrosoft:mainfrom
Conversation
RyanCavanaugh
approved these changes
Apr 14, 2026
DanielRosenwasser
approved these changes
Apr 14, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds package-name validation to the typings installer’s installPackage request path (code actions), and introduces a new tsserver baseline + unit test to ensure invalid package names are rejected.
Changes:
- Validate
InstallPackageRequest.packageNameand return a failure response for invalid names. - Add a unit test that sends crafted
applyCodeActionCommandrequests with invalid package names. - Add a new reference baseline capturing the expected rejection behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/baselines/reference/tsserver/codeFix/install-package-rejects-invalid-package-names.js | New baseline verifying invalid package names are rejected during code action application. |
| src/typingsInstallerCore/typingsInstaller.ts | Adds early package-name validation and returns an error response instead of attempting install. |
| src/testRunner/unittests/tsserver/codeFix.ts | Adds a unit test to exercise the new validation via applyCodeActionCommand. |
Member
Author
|
@typescript-bot cherry-pick this to release-6.0 |
Collaborator
Collaborator
|
Hey, @jakebailey! I've created #63407 for you. |
jakebailey
added a commit
that referenced
this pull request
Apr 15, 2026
…e-6.0 (#63407) Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
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.
Extends #63368 to the code action.
This is still not a security boundary; any client that can send these args can already run commands locally.