fix: replace jQuery CDN dependency in addons:open SSO template with vanilla JS - #3837
Merged
Conversation
…anilla JS Removes the external jQuery 2.0.0 script tag (loaded from ajax.googleapis.com) in writeSudoTemplate and replaces the jQuery-dependent form-building logic with vanilla JS using DOMContentLoaded and Object.keys(). Eliminates a supply-chain risk where a locally-generated auth page silently fetched a decade-old library from an external CDN. Fixes #1541 (W-23597891). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 27, 2026 19:27 — with
GitHub Actions
Inactive
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 27, 2026 19:27 — with
GitHub Actions
Inactive
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 27, 2026 19:27 — with
GitHub Actions
Inactive
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 27, 2026 19:27 — with
GitHub Actions
Inactive
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 27, 2026 21:47 — with
GitHub Actions
Inactive
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 27, 2026 21:47 — with
GitHub Actions
Inactive
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 27, 2026 21:47 — with
GitHub Actions
Inactive
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 27, 2026 21:47 — with
GitHub Actions
Inactive
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.
Summary
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js">tag from the SSO HTML page generated bywriteSudoTemplateinsrc/commands/addons/open.ts$.each,$('<input>'),$(document).ready) with a vanilla JS equivalent usingdocument.addEventListener('DOMContentLoaded', ...)andObject.keys(params).forEach(...)test/unit/commands/addons/open.unit.test.ts) to assert: the generated HTML does not containgoogleapis.com, and does containDOMContentLoadedandform.submit()Motivation: The SSO template is a locally-generated HTML page that handles authentication. Loading jQuery 2.0.0 (released 2013) from an external Google CDN at auth time is a supply-chain risk — the page silently fetches a decade-old, potentially compromised script from a third party. Vanilla JS removes the external dependency entirely with no loss of functionality.
Fixes #1541 | W-23597891
Test plan
npm test -- --grep "file path using sudo via sso"— verifies the generated HTML has nogoogleapis.comand does containDOMContentLoaded/form.submit()HEROKU_SUDO=trueand runheroku addons:open <addon> --app <app>against an app with a POST-method SSO add-on to confirm the browser opens the add-on dashboard correctly🤖 Generated with Claude Code