a53b9958fa734f73aeffb9ddfe2fbad1ca65f90c galt Mon Jan 30 16:18:41 2017 -0800 Check-in of CSP2 Content-Security-Policy work. All C-language CGIs should now support CSP2 in browser to stop major forms of XSS javascript injection. Javascript on pages is gathered together, and then emitted in a single script block at the end with a nonce that tells the browser, this is js that we generated instead of being injected by a hacker. Both inline script from script blocks and inline js event handlers had to be pulled out and separated. You will not see js sprinkled through-out the page now. Older browsers that support CSP1 or that do not understand CSP at all will still work, just without protection. External js libraries loaded at runtime need to be added to the CSP policy header in src/lib/htmshell.c. diff --git src/hg/inc/search.h src/hg/inc/search.h index 1b79236..1f1e327 100644 --- src/hg/inc/search.h +++ src/hg/inc/search.h @@ -28,31 +28,31 @@ simpleTab = 0, advancedTab = 1, filesTab = 2, }; void getSearchTrixFile(char *database, char *buf, int len); // Fill-in the name of the track search trix file boolean isSearchTracksSupported(char *database, struct cart *cart); // Return TRUE if searchTracks is supported for this database and javascript is supported too struct slPair *fileFormatSearchWhiteList(void); // Gets the whitelist of approved file formats that is allowed for search -char *fileFormatSelectHtml(char *name, char *selected, char *extraHtml); +char *fileFormatSelectHtml(char *name, char *selected, char *event, char *javascript, char *style); // returns an allocated string of HTML for the fileType select drop down struct slPair *mdbSelectPairs(struct cart *cart, struct slPair *mdbVars); // Returns the current mdb vars and vals in the table of drop down selects char *mdbSelectsHtmlRows(struct sqlConnection *conn,struct slPair *mdbSelects, struct slPair *mdbVars,int cols,boolean fileSearch); // generates the html for the table rows containing mdb var and val selects. // Assume tableSearch unless fileSearch boolean searchNameMatches(struct trackDb *tdb, struct slName *wordList); // returns TRUE if all words in preparsed list matches short or long label // A "word" can be "multiple words" (parsed from quoteed string). boolean searchDescriptionMatches(struct trackDb *tdb, struct slName *wordList);