From cf8956ebebb5a47ac17629710db7fa1f5b616faf Mon Sep 17 00:00:00 2001 From: Jochen Delabie Date: Fri, 17 Jul 2026 22:19:06 +0200 Subject: [PATCH] Phase 3 (part 1): harden the results tab and manifest Security, correctness and UX fixes to the build-results tab, plus manifest cleanup. Does not touch the /mini viewer or migrate the SDK (see below). Tab (tb-build-info) - Remove the SRI-less unpkg.com text-encoding script from infoTab.html (3.1); window.TextDecoder is native in every browser Azure DevOps supports. - embedDialog: only frame https URLs on testingbot.com; anything else shows a message instead of loading an attacker-suppliable page (3.5, dialog.js). - info.js pagination/UX (3.4): use a stable page size captured from the first response instead of the current page's count (fixed corrupted page links on a partial last page), guard against an infinite loop when count is 0, render an error state instead of leaving "LOADING" forever, wrap pagination clicks in try/catch, and guard build.orchestrationPlan. Manifest (3.6) - Rebrand "Visual Studio Team Services"/VSTS -> Azure DevOps. - Cut scopes to the minimum actually used: vso.build + vso.serviceendpoint_query (drop vso.build_execute, vso.test, vso.test_write, vso.serviceendpoint_manage). Deferred / blocked (documented in MODERNIZATION.md) - Removing the API secret from the browser (finding #1) is blocked: /mini needs md5(key:secret:session_id) and the TestingBot public API exposes no endpoint to sign it server-side, so keeping the embedded viewer keeps the secret in the attachment. The vss-web-extension-sdk -> azure-devops-extension-sdk/React port is large and the old SDK still works, so it is a separate later PR. Verified: npm run package builds the vsix (no unpkg in the bundled tab, scopes and rebrand present in the compiled manifest); the URL allowlist and pagination math were unit-checked (partial-last-page, count=0, subdomain-spoof, non-https). NOTE: browser/manifest changes need a live-org smoke test before release, and the reduced scopes force re-authorization on upgrade. --- MODERNIZATION.md | 18 ++++++++++-- tb-build-info/infoTab.html | 1 - tb-build-info/scripts/dialog.js | 25 ++++++++++++++--- tb-build-info/scripts/info.js | 49 +++++++++++++++++++++++---------- vss-extension.json | 6 ++-- 5 files changed, 74 insertions(+), 25 deletions(-) diff --git a/MODERNIZATION.md b/MODERNIZATION.md index 72ec65c..0f630b0 100644 --- a/MODERNIZATION.md +++ b/MODERNIZATION.md @@ -10,11 +10,25 @@ _Date: 2026-07-17. Applies to repo `vso-testingbot-plugin` (marketplace: `testin > drift resolved via `scripts/stamp-version.js`, immediate correctness bugs fixed. > - **Phase 2 — DONE (PR #18):** tasks rewritten in TypeScript, runtime tunnel via > `testingbot-tunnel-launcher` (jar deleted), secret pipeline variables, tests. -> - **Phase 3 — PENDING:** results-tab / SDK rewrite, including moving the `/mini` -> URL signing server-side so the secret leaves the browser (finding #1). +> - **Phase 3 — PARTIAL (PR #19):** results-tab hardening — unpkg.com CDN script +> removed, pagination + error-state bugs fixed, `embedDialog` URL allowlisted; +> manifest rebranded and scopes cut to `vso.build` + `vso.serviceendpoint_query`. +> **Still PENDING:** (a) moving the `/mini` share-URL signing server-side so the +> secret leaves the browser (finding #1) — **blocked**: the TestingBot public +> API exposes no endpoint that returns the `md5(key:secret:session_id)` share +> hash, so keeping the embedded `/mini` viewer requires the secret in the +> browser until TestingBot adds such an endpoint; (b) the `vss-web-extension-sdk` +> → `azure-devops-extension-sdk` / React port (large, and the old SDK keeps +> working, so deferred to its own PR). > - **Phase 4 — PENDING:** CI/CD, lint, publishing. > > Items marked "PENDING" below are the genuinely outstanding work. +> +> **Release note for PR #19:** the scope reduction and tab changes are +> browser/manifest-side and cannot be exercised outside a live Azure DevOps org. +> Smoke-test the results tab (attachment load + API call) with the packaged vsix +> before publishing; the reduced scopes force installed users to re-authorize on +> upgrade. ## 1. Executive summary diff --git a/tb-build-info/infoTab.html b/tb-build-info/infoTab.html index e7e303f..f8ada21 100644 --- a/tb-build-info/infoTab.html +++ b/tb-build-info/infoTab.html @@ -2,7 +2,6 @@ TestingBot Info -