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/visiGene/hgVisiGene/hgVisiGene.c src/hg/visiGene/hgVisiGene/hgVisiGene.c index 4f0f75fe2b3..af1b6615a53 100644 --- src/hg/visiGene/hgVisiGene/hgVisiGene.c +++ src/hg/visiGene/hgVisiGene/hgVisiGene.c @@ -269,41 +269,41 @@ printf("
\n"); printf(""); printf(""); if (++count >= maxCount) break; } printf("\n"); printf("
\n"); } if (count != imageCount) { int start; int page = 0; printf("%d-%d of %d for:
", startAt+1, startAt+count, imageCount); - printf(" %s
\n", listSpec); + printf(" %s
\n", htmlEncode(listSpec)); // search term, escape before echoing (XSS) printf("Page:\n"); for (start=0; start"); } printf("%d", page); if (start != startAt) printf(""); printf(" "); } } else { printf("%d images for:
", imageCount); htmlPrintf(" %s
\n", listSpec); }