a1d7c07c50f1d895337de121680ea672b261c058
max
Mon Aug 17 02:26:36 2026 -0700
escape reflected/echoed user input across several CGIs (XSS), refs #38057
Route user-, DB- and hub-derived values through htmlEncode (HTML/attribute text),
cgiEncode (values composed into URLs), jsonStringEscape (values placed in a JS string
literal inside an inline script) or, for hgMirror, the existing mustBeClean sanitizer.
Covers hgHubConnect, hgUserSuggestion, hgLiftOver, hgBlat, hgc pubs, hgVisiGene,
hgSession, hgTrackUi, hgGenome, phyloPng, hgFileSearch, hgLinkIn, hgPal, hui,
hgPhyloPlace, hgMirror, hgCustom and hgSearch.
diff --git src/hg/hgHubConnect/hgHubConnect.c src/hg/hgHubConnect/hgHubConnect.c
index b2a8085c088..65d37febc54 100644
--- src/hg/hgHubConnect/hgHubConnect.c
+++ src/hg/hgHubConnect/hgHubConnect.c
@@ -472,31 +472,31 @@
}
void hgHubConnectDeveloperMode()
/* Put up the controls for the "Hub Development" Tab, which includes a button to run the
* hubCheck utility on a hub and load a hub with the udcTimeout and measureTiming
* variables turned on */
{
// put out the top of our page
char *hubUrl = cartOptionalString(cart, "validateHubUrl");
// the outer div for all the elements in the tab
puts("
\n"
" You may also contact us if you have any "
"issues or questions on hub development.");
puts("
"); // .tabSection
@@ -577,40 +577,40 @@
void printSearchAndFilterBoxes(int searchEnabled, char *hubSearchTerms, char *dbFilter)
/* Create the text boxes for search and database filtering along with the required
* javscript */
{
printf("");
}
void printSearchTerms(char *hubSearchTerms)
/* Write out a reminder about the current search terms and a note about
* how to navigate detailed search results */
{
printf("Displayed list restricted by above search terms \n");
puts("\n");
jsOnEventById("click", "hubDeleteSearchButton",
"document.searchHubForm.elements['hubSearchTerms'].value='';"
"document.searchHubForm.elements['hubDbFilter'].value='';"
@@ -1627,31 +1627,31 @@
puts("
");
jsOnEventByIdF("click", "windowX", "closeIframe()");
if (isEmpty(hubUrl))
printf("Please wait, loading and checking hub. This usually takes a minute or two but can take up to 20 minutes for big hubs.");
else
{
puts("
");
puts("
");
jsOnEventByIdF("click", "reloadButton", "reloadIframe()");
jsOnEventByIdF("click", "closeButton", "closeIframe()");
jsInline("document.onkeydown = function(evt) { if (evt.keyCode===27) { closeIframe() } };");
int retVal = doValidateNewHub(hubUrl);
if (retVal == 0)
- printf("