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/hgUserSuggestion/hgUserSuggestion.c src/hg/hgUserSuggestion/hgUserSuggestion.c index 89735098a7b..8010f1dc437 100644 --- src/hg/hgUserSuggestion/hgUserSuggestion.c +++ src/hg/hgUserSuggestion/hgUserSuggestion.c @@ -353,30 +353,34 @@ } static void printReCaptchaV3() /* output the js to perform the reCAPTCHA v3 function */ { jsInline( "\n window.onload = function() {\n" " grecaptcha.ready();\n" " };\n" ); } void printSuggestionConfirmed(char *summary, char * refID, char *userAddr, char *adminAddr, char *details, double captchaScore) /* display suggestion confirm page */ { +// these come from the cart (user input), escape before echoing into HTML (XSS) +userAddr = htmlEncode(userAddr); +summary = htmlEncode(summary); +details = htmlEncode(details); hPrintf( "
"
"You may follow up on the status of your request at any time by "
"contacting us and quoting your reference number:
%s
"
"A copy of this information has also been sent to you at %s.
Click here if you wish to make additional suggestions.
"); hPrintf( ""
"Your suggestion summary:
"
"%s
"
"Your suggestion details:
"