Vue version 2.6.13, released on June 1st, 2021, is a patch update to the popular JavaScript framework Vue.js, building upon the solid foundation of version 2.6.12, which came out on August 20th, 2020. While seemingly incremental, such updates can contain important bug fixes and performance improvements, enhancing the overall developer experience.
A key difference lies in the dist object. Version 2.6.13 has a file count of 218, while 2.6.12 has 223, and the unpacked size of 2.6.13 is slightly smaller at 2969791 compared to 2980098 for 2.6.12. This suggests subtle changes in the bundled files, potentially optimized for size or efficiency. The core framework remains largely consistent as both versions share the same core description, license (MIT), author, and repository. Their extensive devDependencies showcasing the robust testing and tooling Vue.js employs, including Babel, ESLint, Webpack, and various testing libraries like Karma and Jasmine which ensure stability and compatibility across different environments. Upgrading to 2.6.13 is generally recommended for developers already using Vue 2.6.x, as it likely incorporates refinements without introducing major breaking changes. Developers should always review the official changelog for a complete list of fixes and enhancements. For new projects, choosing the latest stable Vue 2 release (currently 2.6.13) provides the most up-to-date, reliable, and optimized foundation.
All the vulnerabilities related to the version 2.6.13 of the package
ReDoS vulnerability in vue package that is exploitable through inefficient regex evaluation in the parseHTML function
The ReDoS can be exploited through the parseHTML
function in the html-parser.ts
file. This flaw allows attackers to slow down the application by providing specially crafted input that causes inefficient processing of regular expressions, leading to excessive resource consumption.
To demonstrate this vulnerability, here's an example. In a Vue client-side application, create a new Vue instance with a template string that includes a <script>
tag but closes it incorrectly with something like </textarea>
.
new Vue({
el: '#app',
template: '
<div>
Hello, world!
<script>${'<'.repeat(1000000)}</textarea>
</div>'
});
Next, set up a basic HTML page (e.g., index.html) to load this JavaScript and mount the Vue instance:
<!DOCTYPE html>
<html>
<head>
<title>My first Vue app</title>
</head>
<body>
<div id=\"app\">Loading...</div>
</body>
</html>
When you visit the app in your browser at http://localhost:3000, you'll notice that the time taken to parse and mount the Vue application increases significantly due to the ReDoS vulnerability, demonstrating how the flaw can affect performance.