Skip to content

Commit

Permalink
Updated vue.js from 2.6.10 to 2.6.12 due to vulnerability. (#843)
Browse files Browse the repository at this point in the history
Vulnerable JS Library
The identified library vue, version 2.6.10 is vulnerable.
https://github.com/vuejs/vue/releases/tag/v2.6.11
  • Loading branch information
mrworm authored Dec 11, 2023
1 parent c3e3595 commit 29dd89d
Showing 1 changed file with 41 additions and 20 deletions.
61 changes: 41 additions & 20 deletions apps/showcase/static/js/vue.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* Vue.js v2.6.10
* (c) 2014-2019 Evan You
* Vue.js v2.6.12
* (c) 2014-2020 Evan You
* Released under the MIT License.
*/
(function (global, factory) {
Expand Down Expand Up @@ -1969,7 +1969,7 @@
isUsingMicroTask = true;
} else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
// Fallback to setImmediate.
// Techinically it leverages the (macro) task queue,
// Technically it leverages the (macro) task queue,
// but it is still a better choice than setTimeout.
timerFunc = function () {
setImmediate(flushCallbacks);
Expand Down Expand Up @@ -2058,7 +2058,7 @@
warn(
"Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
'prevent conflicts with Vue internals' +
'prevent conflicts with Vue internals. ' +
'See: https://vuejs.org/v2/api/#data',
target
);
Expand Down Expand Up @@ -2918,7 +2918,7 @@
if (typeof key === 'string' && key) {
baseObj[values[i]] = values[i + 1];
} else if (key !== '' && key !== null) {
// null is a speical value for explicitly removing a binding
// null is a special value for explicitly removing a binding
warn(
("Invalid value for dynamic directive argument (expected string or null): " + key),
this
Expand Down Expand Up @@ -3413,6 +3413,12 @@
ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
if (config.isReservedTag(tag)) {
// platform built-in elements
if (isDef(data) && isDef(data.nativeOn)) {
warn(
("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
context
);
}
vnode = new VNode(
config.parsePlatformTagName(tag), data, children,
undefined, undefined, context
Expand Down Expand Up @@ -3538,7 +3544,7 @@
// render self
var vnode;
try {
// There's no need to maintain a stack becaues all render fns are called
// There's no need to maintain a stack because all render fns are called
// separately from one another. Nested component's render fns are called
// when parent component is patched.
currentRenderingInstance = vm;
Expand Down Expand Up @@ -5437,7 +5443,7 @@
value: FunctionalRenderContext
});

Vue.version = '2.6.10';
Vue.version = '2.6.12';

/* */

Expand Down Expand Up @@ -6110,7 +6116,7 @@
}
}

function removeVnodes (parentElm, vnodes, startIdx, endIdx) {
function removeVnodes (vnodes, startIdx, endIdx) {
for (; startIdx <= endIdx; ++startIdx) {
var ch = vnodes[startIdx];
if (isDef(ch)) {
Expand Down Expand Up @@ -6221,7 +6227,7 @@
refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
} else if (newStartIdx > newEndIdx) {
removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
}
}

Expand Down Expand Up @@ -6313,7 +6319,7 @@
if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
} else if (isDef(oldCh)) {
removeVnodes(elm, oldCh, 0, oldCh.length - 1);
removeVnodes(oldCh, 0, oldCh.length - 1);
} else if (isDef(oldVnode.text)) {
nodeOps.setTextContent(elm, '');
}
Expand Down Expand Up @@ -6542,7 +6548,7 @@

// destroy old node
if (isDef(parentElm)) {
removeVnodes(parentElm, [oldVnode], 0, 0);
removeVnodes([oldVnode], 0, 0);
} else if (isDef(oldVnode.tag)) {
invokeDestroyHook(oldVnode);
}
Expand Down Expand Up @@ -7643,7 +7649,7 @@
// skip the update if old and new VDOM state is the same.
// `value` is handled separately because the DOM value may be temporarily
// out of sync with VDOM state due to focus, composition and modifiers.
// This #4521 by skipping the unnecesarry `checked` update.
// This #4521 by skipping the unnecessary `checked` update.
cur !== oldProps[key]
) {
// some property updates can throw
Expand Down Expand Up @@ -9248,7 +9254,7 @@
var startTagClose = /^\s*(\/?)>/;
var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>"));
var doctype = /^<!DOCTYPE [^>]+>/i;
// #7298: escape - to avoid being pased as HTML comment when inlined in page
// #7298: escape - to avoid being passed as HTML comment when inlined in page
var comment = /^<!\--/;
var conditionalComment = /^<!\[/;

Expand Down Expand Up @@ -9533,7 +9539,7 @@
/* */

var onRE = /^@|^v-on:/;
var dirRE = /^v-|^@|^:/;
var dirRE = /^v-|^@|^:|^#/;
var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
var stripParensRE = /^\(|\)$/g;
Expand Down Expand Up @@ -9888,7 +9894,7 @@
}
},
comment: function comment (text, start, end) {
// adding anyting as a sibling to the root node is forbidden
// adding anything as a sibling to the root node is forbidden
// comments should still be allowed, but ignored
if (currentParent) {
var child = {
Expand Down Expand Up @@ -10157,7 +10163,7 @@
if (el.parent && !maybeComponent(el.parent)) {
warn$2(
"<template v-slot> can only appear at the root level inside " +
"the receiving the component",
"the receiving component",
el
);
}
Expand Down Expand Up @@ -10720,7 +10726,7 @@

/* */

var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function\s*(?:[\w$]+)?\s*\(/;
var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/;
var fnInvokeRE = /\([^)]*?\);*$/;
var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;

Expand Down Expand Up @@ -11489,6 +11495,8 @@
var range = node.rawAttrsMap[name];
if (name === 'v-for') {
checkFor(node, ("v-for=\"" + value + "\""), warn, range);
} else if (name === 'v-slot' || name[0] === '#') {
checkFunctionParameterExpression(value, (name + "=\"" + value + "\""), warn, range);
} else if (onRE.test(name)) {
checkEvent(value, (name + "=\"" + value + "\""), warn, range);
} else {
Expand All @@ -11508,9 +11516,9 @@
}

function checkEvent (exp, text, warn, range) {
var stipped = exp.replace(stripStringRE, '');
var keywordMatch = stipped.match(unaryOperatorsRE);
if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') {
var stripped = exp.replace(stripStringRE, '');
var keywordMatch = stripped.match(unaryOperatorsRE);
if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') {
warn(
"avoid using JavaScript unary operator as property name: " +
"\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()),
Expand Down Expand Up @@ -11565,6 +11573,19 @@
}
}

function checkFunctionParameterExpression (exp, text, warn, range) {
try {
new Function(exp, '');
} catch (e) {
warn(
"invalid function parameter expression: " + (e.message) + " in\n\n" +
" " + exp + "\n\n" +
" Raw expression: " + (text.trim()) + "\n",
range
);
}
}

/* */

var range = 2;
Expand Down

0 comments on commit 29dd89d

Please sign in to comment.