Actualizacion de seguridad

This commit is contained in:
Pablinux
2024-07-13 00:27:32 -05:00
parent 90f05f7ad0
commit fa92efc258
186 changed files with 75113 additions and 17648 deletions

15
node_modules/express/lib/response.js generated vendored
View File

@@ -55,6 +55,7 @@ module.exports = res
*/
var charsetRegExp = /;\s*charset\s*=/;
var schemaAndHostRegExp = /^(?:[a-zA-Z][a-zA-Z0-9+.-]*:)?\/\/[^\\\/\?]+/;
/**
* Set status `code`.
@@ -904,15 +905,23 @@ res.cookie = function (name, value, options) {
*/
res.location = function location(url) {
var loc = url;
var loc;
// "back" is an alias for the referrer
if (url === 'back') {
loc = this.req.get('Referrer') || '/';
} else {
loc = String(url);
}
// set location
return this.set('Location', encodeUrl(loc));
var m = schemaAndHostRegExp.exec(loc);
var pos = m ? m[0].length + 1 : 0;
// Only encode after host to avoid invalid encoding which can introduce
// vulnerabilities (e.g. `\\` to `%5C`).
loc = loc.slice(0, pos) + encodeUrl(loc.slice(pos));
return this.set('Location', loc);
};
/**

View File

@@ -36,7 +36,7 @@ var toString = Object.prototype.toString;
* Initialize a new `Router` with the given `options`.
*
* @param {Object} [options]
* @return {Router} which is an callable function
* @return {Router} which is a callable function
* @public
*/

View File

@@ -60,7 +60,10 @@ Route.prototype._handles_method = function _handles_method(method) {
return true;
}
var name = method.toLowerCase();
// normalize name
var name = typeof method === 'string'
? method.toLowerCase()
: method
if (name === 'head' && !this.methods['head']) {
name = 'get';
@@ -103,8 +106,10 @@ Route.prototype.dispatch = function dispatch(req, res, done) {
if (stack.length === 0) {
return done();
}
var method = typeof req.method === 'string'
? req.method.toLowerCase()
: req.method
var method = req.method.toLowerCase();
if (method === 'head' && !this.methods['head']) {
method = 'get';
}

7
node_modules/express/lib/utils.js generated vendored
View File

@@ -117,17 +117,15 @@ exports.contentDisposition = deprecate.function(contentDisposition,
/**
* Parse accept params `str` returning an
* object with `.value`, `.quality` and `.params`.
* also includes `.originalIndex` for stable sorting
*
* @param {String} str
* @param {Number} index
* @return {Object}
* @api private
*/
function acceptParams(str, index) {
function acceptParams (str) {
var parts = str.split(/ *; */);
var ret = { value: parts[0], quality: 1, params: {}, originalIndex: index };
var ret = { value: parts[0], quality: 1, params: {} }
for (var i = 1; i < parts.length; ++i) {
var pms = parts[i].split(/ *= */);
@@ -282,6 +280,7 @@ function createETagGenerator (options) {
/**
* Parse an extended query string with qs.
*
* @param {String} str
* @return {Object}
* @private
*/