Repository navigation
Security hardening for 1.0.2: connection links, Entra ID host allowlist, npm pipelines - #1040
Merged
Merged
Conversation
The OIDC host allowlist now recognizes only the Azure public and sovereign cloud suffixes (azure.com, azure.us, azure.cn). Any other host falls back to the public-cloud default. Co-authored-by: Copilot <[email protected]>
…hine A connection link can now request relaxed certificate validation only when every host is loopback (localhost, 127.0.0.0/8, ::1). For any other host the request is dropped and certificate validation stays on; users can still opt in from the connection settings. Emulator detection for links uses the same host check, and the no-authentication handler now checks the hosts like the other handlers before relaxing validation. Co-authored-by: Copilot <[email protected]>
…alidation When a connection link asks to turn off TLS certificate validation for a target on this machine, the extension now always shows a warning that names the target and lets the user turn validation off, keep it on, or cancel. This prompt is shown even when URL handling confirmations are disabled. When the request is ignored because the target is not on this machine, the connection confirmation says so. Co-authored-by: Copilot <[email protected]>
A connection link that would add a new connection now always shows a confirmation that names the target (user, hosts, database, and collection), even when URL handling confirmations are disabled. The setting still skips the follow-up prompts and links to connections that are already saved, and the add-connection prompt no longer suggests that it can be turned off. The setting description and the deep-link user manual describe the new behavior. Co-authored-by: Copilot <[email protected]>
The job that can mint npm publish credentials no longer installs dependencies, builds, restores the npm cache, or runs package scripts. The verify job, which has no OIDC permission, builds and packs the selected packages and records their SHA-256 hashes. The publish job downloads the tarballs, checks the hashes and package names, and publishes them with lifecycle scripts disabled. npm itself is installed at a pinned version with scripts disabled. Co-authored-by: Copilot <[email protected]>
The release-bound packages are now packed with --ignore-scripts. The pack step also fails when a release-bound package declares a pack, publish, or install lifecycle script, so the tarball is exactly the output of the build step. Co-authored-by: Copilot <[email protected]>
The release pipeline now checks that the package tarball name is a plain npm tarball name (no path separators, control characters or special characters) before writing it to an output variable. The step that copies the tarball checks it again and uses literal paths. Co-authored-by: Copilot <[email protected]>
Static checks now fail when any tracked .npmrc file contains an auth token, basic auth, or password entry. Pipelines inject registry credentials at build time, so none belong in the repository. The check prints only file names, so a leaked value is not repeated in the CI log. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Contributor
✅ CI passed: standard tier (ready PR)Commit
Full run: add the Code quality
Build sizeNo page, activation, VSIX or other bundle size changed by 5% or 50 KiB or more against Artifacts: VSIX | Bundle-reports-39578555334 | L1-manifest-report-39578555334 All graphs (exact bytes)
Packaged bytes. Shared chunks count in every graph that loads them, so rows do not add up. Updated in place on every run. |
Record the validated credential guard finding, independent review results, and outstanding draft and cross-vendor gates. Co-authored-by: Copilot <[email protected]>
R1 (npm credential guard) is re-rated from Medium to Low, with a probe matrix and a recommended one-line replacement. The ignored TLS consent for anonymous loopback link connections is promoted to finding R2 (Low). Co-authored-by: Copilot <[email protected]>
The guard matched only unquoted credential keys followed by '=', so a valid
quoted key such as "//registry.npmjs.org/:_authToken"=... or an indented
unscoped key passed. It also failed on commented-out lines.
The check now fails on any non-comment line naming _authToken, _auth or
_password, whatever its quoting or spacing, and ignores # and ; comments.
The error no longer assumes a real token: a ${VAR} reference is rejected
too, and the message says to revoke only if a credential was committed.
Verified with a 12-case probe matrix (root and nested tracked files) run
from the extracted step script: every credential key form fails, comments
and harmless settings pass, the repository's own .npmrc passes, and the
output contains file names only.
Addresses PR #1040 review finding R1.
Co-authored-by: Copilot <[email protected]>
…ections A connection link to 127.0.0.1 or ::1 asks the user whether to turn off TLS certificate validation, but such hosts are not classified as emulators, and NoAuthHandler applied the stored exception only to emulators. The user's answer was saved and then ignored, so the connection still failed on a self-signed certificate. NoAuthHandler now applies the exception exactly as NativeAuthHandler does: for any local or private host, whatever its emulator classification, and never for a public host. The 4-second server selection timeout follows the same rule. Tests cover the client options for both loopback forms, with and without the flag, a public host with the flag, and the full path from link consent to the anonymous handler's options. Addresses PR #1040 review finding R2. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Both findings were fixed at the author's request: R1 in 93f8a8a and R2 in e053384, with release notes in 2111d47. The review now links each fix and records its verification and the remaining gates. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Tomasz Naumowicz (tnaum-ms)
marked this pull request as ready for review
October 21, 2026 09:38
Tomasz Naumowicz (tnaum-ms)
enabled auto-merge
October 21, 2026 11:08
Guanzhou Song (guanzhousongmicrosoft)
approved these changes
Oct 21, 2026
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.
What changed
Security hardening for the 1.0.2 patch release. These changes mitigate issues that were reported to us. Each area is in its own commit.
Extension
documentDB.confirmations.showUrlHandlingConfirmationsis off. The setting still skips the follow-up prompts and links to connections that are already saved.localhost,127.0.0.0/8,::1), and only after an explicit warning that names the target. The user can turn validation off, keep it on, or cancel. For any other host the request is ignored and the confirmation says so. Emulator detection for links uses the same host check.azure.com,azure.us,azure.cn).Build and release (does not affect the installed extension)
npm-publish-documentdb-js.yml: The job that can mint publish credentials no longer installs, builds, restores the npm cache, or runs package scripts. It publishes tarballs packed by theverifyjob, after checking their hashes and package names.pack-npm-packages.ps1: Packs with--ignore-scriptsand rejects pack, publish, and install lifecycle scripts in release packages.release-npm-packages.yml: Validates the tarball file name before it is written to an output variable or used in a path..npmrccontains npm credentials.Docs: 1.0.2 changelog and release notes, the setting description, and the "Connect with a URL" user manual page.
Scope
chore: release 1.0.1.docs/ai-and-plans/features/build-and-test-stack/iterations/02-october-security-hardening/pr-1040-review.md. Both findings were fixed: the.npmrccredential check now catches any npm credential key, and accepted TLS exceptions apply to anonymous loopback connections.Validation
Case 2 checks ran on
71c76a49and passed:npm run l10n,npm run prettier-fix,npm run lint,npx vitest run(314 files, 5232 tests passed, 1 skipped),npm run build, andnpm run package.prepackscript. The publish workflow's pack, hash check, and publish logic was run locally withnpm publish --dry-run.npm-publish-documentdb-js.ymlwithdry_run=false(Trusted Publishing with a tarball and--provenance). Also a manual check of the link prompts in VS Code: a new connection, alocalhostlink withtlsAllowInvalidCertificates=true, and a public host link with the same option.