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/hgc/hgc.c src/hg/hgc/hgc.c index 20c8590..c7a6d17 100644 --- src/hg/hgc/hgc.c +++ src/hg/hgc/hgc.c @@ -263,34 +263,30 @@ struct cart *cart; /* User's settings. */ char *seqName; /* Name of sequence we're working on. */ int winStart, winEnd; /* Bounds of sequence. */ char *database; /* Name of mySQL database. */ char *organism; /* Colloquial name of organism. */ char *genome; /* common name, e.g. Mouse, Human */ char *scientificName; /* Scientific name of organism. */ struct hash *trackHash; /* A hash of all tracks - trackDb valued */ void printLines(FILE *f, char *s, int lineSize); char mousedb[] = "mm3"; -/* JavaScript to automatically submit the form when certain values are - * changed. */ -char *onChangeAssemblyText = "onchange=\"document.orgForm.submit();\""; - #define NUMTRACKS 9 int prevColor[NUMTRACKS]; /* used to optimize color change html commands */ int currentColor[NUMTRACKS]; /* used to optimize color change html commands */ int maxShade = 9; /* Highest shade in a color gradient. */ Color shadesOfGray[10+1]; /* 10 shades of gray from white to black */ Color shadesOfRed[16]; boolean exprBedColorsMade = FALSE; /* Have the shades of red been made? */ int maxRGBShade = 16; struct bed *sageExpList = NULL; char ncbiOmimUrl[255] = {"http://www.ncbi.nlm.nih.gov/omim/"}; struct palInfo { @@ -7188,30 +7184,31 @@ index = mustOpen(indexTn.forCgi, "w"); if (qName == NULL) qName = partPsl->qName; htmStartDirDepth(index, qName, 2); fprintf(index, "