Skip to content

Commit

Permalink
[SECURITY-944]
Browse files Browse the repository at this point in the history
  • Loading branch information
Wadeck authored and daniel-beck committed Jun 19, 2018
1 parent f46842c commit 8697bdf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion core/src/main/java/hudson/model/BuildTimelineWidget.java
Expand Up @@ -23,6 +23,7 @@
*/
package hudson.model;

import hudson.Util;
import hudson.util.RunList;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;
Expand Down Expand Up @@ -64,7 +65,9 @@ public TimelineEventList doData(StaplerRequest req, @QueryParameter long min, @Q
Event e = new Event();
e.start = new Date(r.getStartTimeInMillis());
e.end = new Date(r.getStartTimeInMillis()+r.getDuration());
e.title = r.getFullDisplayName();
// due to SimileAjax.HTML.deEntify (in simile-ajax-bundle.js), "&lt;" are transformed back to "<", but not the "&#60";
// to protect against XSS
e.title = Util.escape(r.getFullDisplayName()).replace("&lt;", "&#60;");
// what to put in the description?
// e.description = "Longish description of event "+r.getFullDisplayName();
// e.durationEvent = true;
Expand Down
Expand Up @@ -56,7 +56,7 @@ THE SOFTWARE.
onSuccess: function(t) {
if (t.status != 0) {
try {
eventSource1.loadJSON(eval('('+t.responseText+')'),'.');
eventSource1.loadJSON(JSON.parse(t.responseText),'.');
getData(eventSource1, current-1, min, max);
} catch (e) {
alert(e);
Expand Down

0 comments on commit 8697bdf

Please sign in to comment.