Escape curl command to fix XSS vulnerability.
This commit is contained in:
2
dist/swagger-ui.js
vendored
2
dist/swagger-ui.js
vendored
@@ -25926,7 +25926,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
|||||||
// adds curl output
|
// adds curl output
|
||||||
var curlCommand = this.model.asCurl(this.map, {responseContentType: contentType});
|
var curlCommand = this.model.asCurl(this.map, {responseContentType: contentType});
|
||||||
curlCommand = curlCommand.replace('!', '!');
|
curlCommand = curlCommand.replace('!', '!');
|
||||||
$( 'div.curl', $(this.el)).html('<pre>' + curlCommand + '</pre>');
|
$( 'div.curl', $(this.el)).html('<pre>' + _.escape(curlCommand) + '</pre>');
|
||||||
|
|
||||||
// only highlight the response if response is less than threshold, default state is highlight response
|
// only highlight the response if response is less than threshold, default state is highlight response
|
||||||
var opts = this.options.swaggerOptions;
|
var opts = this.options.swaggerOptions;
|
||||||
|
|||||||
6
dist/swagger-ui.min.js
vendored
6
dist/swagger-ui.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -704,7 +704,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
|||||||
// adds curl output
|
// adds curl output
|
||||||
var curlCommand = this.model.asCurl(this.map, {responseContentType: contentType});
|
var curlCommand = this.model.asCurl(this.map, {responseContentType: contentType});
|
||||||
curlCommand = curlCommand.replace('!', '!');
|
curlCommand = curlCommand.replace('!', '!');
|
||||||
$( 'div.curl', $(this.el)).html('<pre>' + curlCommand + '</pre>');
|
$( 'div.curl', $(this.el)).html('<pre>' + _.escape(curlCommand) + '</pre>');
|
||||||
|
|
||||||
// only highlight the response if response is less than threshold, default state is highlight response
|
// only highlight the response if response is less than threshold, default state is highlight response
|
||||||
var opts = this.options.swaggerOptions;
|
var opts = this.options.swaggerOptions;
|
||||||
|
|||||||
Reference in New Issue
Block a user